matrix property

  1. @override
Uint8List matrix
override

Fetches luminance data for the underlying bitmap. Values should be fetched using: {@code int luminance = arrayy * width + x}

@return A row-major 2D array of luminance values. Do not use result.length as it may be larger than width * height bytes on some platforms. Do not modify the contents of the result.

Implementation

@override
Uint8List get matrix {
  final matrix = _delegate.matrix;
  final length = width * height;
  final invertedMatrix = Uint8List(length);
  for (int i = 0; i < length; i++) {
    invertedMatrix[i] = (255 - matrix[i]);
  }
  return invertedMatrix;
}