public ImgCCITT(int width,
int height,
boolean reverseBits,
int typeCCITT,
int parameters,
byte[] data) throws BadElementException {
super((URL)null);
if (typeCCITT != CCITTG4 && typeCCITT != CCITTG3_1D && typeCCITT != CCITTG3_2D)
throw new BadElementException("The CCITT compression type must be CCITTG4, CCITTG3_1D or CCITTG3_2D");
if (reverseBits)
TIFFFaxDecoder.reverseBits(data);
type = IMGRAW;
scaledHeight = height;
setTop(scaledHeight);
scaledWidth = width;
setRight(scaledWidth);
colorspace = parameters;
bpc = typeCCITT;
rawData = data;
plainWidth = getWidth();
plainHeight = getHeight();
}
Creates an Image with CCITT compression. Parameters:
width - the exact width of the image
height - the exact height of the image
reverseBits - reverses the bits in data.
Bit 0 is swapped with bit 7 and so on.
typeCCITT - the type of compression in data. It can be
CCITTG4, CCITTG31D, CCITTG32D
parameters - parameters associated with this stream. Possible values are
CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFLINE and CCITT_ENDOFBLOCK or a
combination of them
data - the image data
Throws:
BadElementException - on error
|