encodeParam.setCompressedText(ztextArray);
}
// Parse prior IDAT chunks
InputStream seqStream =
new SequenceInputStream( Collections.enumeration( streamVec ));
InputStream infStream =
new InflaterInputStream(seqStream, new Inflater());
dataStream = new DataInputStream(infStream);
// Create an empty WritableRaster
int depth = bitDepth;
if ((colorType == PNG_COLOR_GRAY) &&
(bitDepth < 8) && output8BitGray) {
depth = 8;
}
if ((colorType == PNG_COLOR_PALETTE) && expandPalette) {
depth = 8;
}
int width = bounds.width;
int height = bounds.height;
int bytesPerRow = (outputBands*width*depth + 7)/8;
int scanlineStride =
(depth == 16) ? (bytesPerRow/2) : bytesPerRow;
theTile = createRaster(width, height, outputBands,
scanlineStride,
depth);
if (performGammaCorrection && (gammaLut == null)) {
initGammaLut(bitDepth);
}
if ((postProcess == POST_GRAY_LUT) ||
(postProcess == POST_GRAY_LUT_ADD_TRANS) ||
(postProcess == POST_GRAY_LUT_ADD_TRANS_EXP)) {
initGrayLut(bitDepth);
}
decodeImage(interlaceMethod == 1);
// Free resources associated with compressed data.
dataStream.close();
infStream.close();
seqStream.close();
streamVec = null;
SampleModel sm = theTile.getSampleModel();
ColorModel cm;