Image constructor

Image({
  1. required int width,
  2. required int height,
  3. int numChannels = 3,
  4. bool withPalette = false,
  5. Palette? palette,
  6. ExifData? exif,
  7. IccProfile? iccp,
  8. Map<String, String>? textData,
  9. int loopCount = 0,
  10. FrameType frameType = FrameType.sequence,
  11. Color? backgroundColor,
  12. int frameDuration = 0,
  13. int frameIndex = 0,
})

Creates an image with the given dimensions and format.

Implementation

Image({
  required int width,
  required int height,
  int numChannels = 3,
  bool withPalette = false,
  Palette? palette,
  ExifData? exif,
  IccProfile? iccp,
  this.textData,
  this.loopCount = 0,
  this.frameType = FrameType.sequence,
  this.backgroundColor,
  this.frameDuration = 0,
  this.frameIndex = 0,
}) {
  frames.add(this);
  _initialize(
    width,
    height,
    numChannels: numChannels,
    withPalette: withPalette,
    palette: palette,
    exif: exif,
    iccp: iccp,
  );
}