ImageGeneratioConfigs constructor
const
ImageGeneratioConfigs({
- bool captureOnlyBackgroundImageArea = true,
- bool allowEmptyEditCompletion = true,
- bool generateInsideSeparateThread = true,
- bool generateImageInBackground = !kIsWeb || !kDebugMode,
- bool captureOnlyDrawingBounds = true,
- bool awaitLoadingDialogContext = false,
- double? customPixelRatio,
- int pngLevel = 6,
- PngFilter pngFilter = PngFilter.none,
- bool singleFrame = false,
- int jpegQuality = 100,
- JpegChroma jpegChroma = JpegChroma.yuv444,
- OutputFormat outputFormat = OutputFormat.jpg,
- ProcessorConfigs processorConfigs = const ProcessorConfigs(),
- Size maxOutputSize = const Size(2000, 2000),
- Size maxThumbnailSize = const Size(100, 100),
Creates a new instance of ImageGeneratioConfigs.
- The allowEmptyEditCompletion parameter controls if empty edit completions are allowed.
- The generateInsideSeparateThread parameter controls if image generation occurs inside an isolate.
- The generateImageInBackground parameter controls if image generation runs in the background.
- The captureOnlyDrawingBounds parameter controls if only image bounds are generated.
- The customPixelRatio parameter set the pixel ratio of the image relative to the content.
- The processorConfigs parameter set the processor configs.
Implementation
const ImageGeneratioConfigs({
this.captureOnlyBackgroundImageArea = true,
this.allowEmptyEditCompletion = true,
this.generateInsideSeparateThread = true,
this.generateImageInBackground = !kIsWeb || !kDebugMode,
this.captureOnlyDrawingBounds = true,
this.awaitLoadingDialogContext = false,
this.customPixelRatio,
this.pngLevel = 6,
this.pngFilter = PngFilter.none,
this.singleFrame = false,
this.jpegQuality = 100,
this.jpegChroma = JpegChroma.yuv444,
this.outputFormat = OutputFormat.jpg,
this.processorConfigs = const ProcessorConfigs(),
this.maxOutputSize = const Size(2000, 2000),
this.maxThumbnailSize = const Size(100, 100),
}) : assert(jpegQuality > 0 && jpegQuality <= 100,
'jpegQuality must be between 1 and 100'),
assert(captureOnlyDrawingBounds || !captureOnlyBackgroundImageArea,
'When [captureOnlyDrawingBounds] is true must [captureOnlyBackgroundImageArea] be false'),
assert(
pngLevel >= 0 && pngLevel <= 9, 'pngLevel must be between 0 and 9'),
assert(customPixelRatio == null || customPixelRatio > 0,
'customPixelRatio must be greater than 0');