use of loci.formats.codec.QTRLECodec in project bioformats by openmicroscopy.
the class NativeQTReader method uncompress.
/**
* Uncompresses an image plane according to the the codec identifier.
*/
private byte[] uncompress(byte[] pixs, String code) throws FormatException, IOException {
CodecOptions options = new MJPBCodecOptions();
options.width = getSizeX();
options.height = getSizeY();
options.bitsPerSample = bitsPerPixel;
options.channels = bitsPerPixel < 40 ? bitsPerPixel / 8 : (bitsPerPixel - 32) / 8;
options.previousImage = canUsePrevious ? prevPixels : null;
options.littleEndian = isLittleEndian();
options.interleaved = isRGB();
if (code.equals("raw "))
return pixs;
else if (code.equals("rle ")) {
return new QTRLECodec().decompress(pixs, options);
} else if (code.equals("rpza")) {
return new RPZACodec().decompress(pixs, options);
} else if (code.equals("mjpb")) {
((MJPBCodecOptions) options).interlaced = interlaced;
return new MJPBCodec().decompress(pixs, options);
} else if (code.equals("jpeg")) {
return new JPEGCodec().decompress(pixs, options);
} else {
throw new UnsupportedCompressionException("Unsupported codec : " + code);
}
}
Aggregations