fromRgba static method

Future<DetectableImage> fromRgba(
  1. List<int> bytes,
  2. int width,
  3. int height
)

Implementation

static Future<DetectableImage> fromRgba(List<int> bytes, int width, int height) async {

  // decode pixels
  List<int> pixels = ImageHelper.toPixelsFromRgba(bytes);

  // get luminance
  var source = zxing.RGBLuminanceSource(width, height, pixels);

  // get bitmap
  zxing.BinaryBitmap bitmap = zxing.BinaryBitmap(HybridBinarizer(source));

  return DetectableImage(bitmap);
}