ExrCompressor constructor

ExrCompressor(
  1. int type,
  2. ExrPart hdr,
  3. int? maxScanLineSize, [
  4. int? numScanLines,
])

Implementation

factory ExrCompressor(int type, ExrPart hdr, int? maxScanLineSize,
    [int? numScanLines]) {
  switch (type) {
    case RLE_COMPRESSION:
      return ExrRleCompressor(hdr, maxScanLineSize);
    case ZIPS_COMPRESSION:
      return ExrZipCompressor(hdr, maxScanLineSize, numScanLines ?? 1);
    case ZIP_COMPRESSION:
      return ExrZipCompressor(hdr, maxScanLineSize, numScanLines ?? 16);
    case PIZ_COMPRESSION:
      return ExrPizCompressor(hdr, maxScanLineSize, numScanLines ?? 32);
    case PXR24_COMPRESSION:
      return ExrPxr24Compressor(hdr, maxScanLineSize, numScanLines ?? 16);
    case B44_COMPRESSION:
      return ExrB44Compressor(
          hdr, maxScanLineSize, numScanLines ?? 32, false);
    case B44A_COMPRESSION:
      return ExrB44Compressor(hdr, maxScanLineSize, numScanLines ?? 32, true);
    default:
      throw ImageException('Invalid compression type: $type');
  }
}