readPlane method

void readPlane(
  1. InputBuffer input,
  2. int width,
  3. int height,
  4. int? bitDepth, [
  5. int? compression,
  6. Uint16List? lineLengths,
  7. int planeNum = 0,
])

Implementation

void readPlane(InputBuffer input, int width, int height, int? bitDepth,
    [int? compression, Uint16List? lineLengths, int planeNum = 0]) {
  compression ??= input.readUint16();

  switch (compression) {
    case COMPRESS_NONE:
      _readPlaneUncompressed(input, width, height, bitDepth!);
      break;
    case COMPRESS_RLE:
      lineLengths ??= _readLineLengths(input, height);
      _readPlaneRleCompressed(
          input, width, height, bitDepth!, lineLengths, planeNum);
      break;
    default:
      throw ImageException('Unsupported compression: $compression');
  }
}