inverted method

UGrayImage inverted()

Implementation

UGrayImage inverted() {
  final Uint8List out = Uint8List(width * height);
  for (int y = 0; y < height; y++) {
    final int src = y * stride;
    final int dst = y * width;
    for (int x = 0; x < width; x++) {
      out[dst + x] = 255 - data[src + x];
    }
  }
  return UGrayImage(out, width, height, left: left, top: top, sourceWidth: sourceWidth, sourceHeight: sourceHeight);
}