getEncoder function

Function? getEncoder(
  1. String format
)

Returns the proper Encoder for the given format.

Only the encoders that the image library supports are returned.

Implementation

Function? getEncoder(String format) {
  switch (format) {
    case 'png':
      return encodePng;
    case 'ico':
      return encodeIco;
    case 'jpg':
    case 'jpeg':
      return encodeJpg;
    case 'gif':
      return encodeGif;
    case 'tga':
      return encodeTga;
  }
}