open static method

Future<Image?> open(
  1. String filename, {
  2. num? heightMm,
  3. num? dpi,
})

Implementation

static Future<Image?> open(final String filename,
    {final num? heightMm, final num? dpi}) async {
  imglib.Image? decodeImg = await imglib.decodePngFile(filename);
  if (decodeImg != null) {
    final argbPixels = _getArgbPixels(decodeImg);
    if (heightMm != null && dpi != null) {
      decodeImg = _resizeHeightMax(decodeImg, heightMm, dpi);
    }
    return Image(argbPixels, decodeImg.width, decodeImg.height);
  }
  return null;
}