prepareRgb method

VisionImageInput prepareRgb(
  1. Uint8List rgb, {
  2. required int height,
  3. required int width,
})

Implementation

VisionImageInput prepareRgb(
  Uint8List rgb, {
  required int height,
  required int width,
}) {
  final (outH, outW) = resizedSize(height, width);
  if (rgb.length != height * width * 3) {
    throw ArgumentError('expected height * width * 3 packed RGB bytes');
  }
  final pixels = _resizeRgb(rgb, height, width, outH, outW);
  return _patchify(
    List.filled(temporalPatchSize, pixels),
    outH,
    outW,
    patchSize,
    mergeSize,
  );
}