isImageBlurred static method

bool isImageBlurred(
  1. Uint8List rgbaBytes,
  2. int width,
  3. int height
)

rgbaBytes must be a tightly-packed RGBA buffer (width * height * 4 bytes). Returns true if the image is blurry.

Implementation

static bool isImageBlurred(Uint8List rgbaBytes, int width, int height) {
  final Pointer<Uint8> inputPointer = malloc<Uint8>(rgbaBytes.length);

  try {
    inputPointer.asTypedList(rgbaBytes.length).setAll(0, rgbaBytes);
    return _blurCheck(inputPointer, width, height);
  } finally {
    malloc.free(inputPointer);
  }
}