toJpeg method

Future<JpegImage> toJpeg({
  1. int quality = 100,
})

Converts the image to a JpegImage, helping when one wants to display it or make JPEG treatment on it.

Implementation

Future<JpegImage> toJpeg({
  int quality = 100,
}) async {
  final jpegQuality = quality.clamp(0, 100);
  final wrappedImage = await AnalysisImageUtils().yuv420toJpeg(
    wrapped(),
    jpegQuality,
  );
  return wrappedImage.unwrap() as JpegImage;
}