Class PDFCCITTFaxProducer
java.lang.Object
java.io.OutputStream
com.inductiveautomation.rm.pdf.reader.PDFCCITTFaxProducer
- All Implemented Interfaces:
ImageProducer
,Closeable
,Flushable
,AutoCloseable
This class is an image producer that uses the RBCodecCCITTFaxDecoder to produce the bits of a 1bpp monochrome image.
This is used as an optimization for when decoding the entire image at once would be too expensive.
Instead of holding on to all the bytes of a decompressed 8bpp BufferedImage,
this class holds on to the compressed bit stream and produces the image as needed.
-
Constructor Summary
ConstructorsConstructorDescriptionPDFCCITTFaxProducer
(RBCodecCCITTFaxDecode decoder) Create a new image producer for the codec. -
Method Summary
Modifier and TypeMethodDescriptionvoid
ImageProducer method - add a new consumervoid
flush()
getCodec()
returns the decoder, should you need it.boolean
ImageProducer method - check to see if we are sending bits to icvoid
produce()
The blood & gutsvoid
ImageProducer methodvoid
ImageProducer method - send all the bits to the given consumervoid
ImageProducer method - kicks things off.void
write
(byte[] b) void
write
(int b) Methods inherited from class java.io.OutputStream
close, nullOutputStream, write
-
Constructor Details
-
PDFCCITTFaxProducer
Create a new image producer for the codec.
-
-
Method Details
-
addConsumer
ImageProducer method - add a new consumer- Specified by:
addConsumer
in interfaceImageProducer
-
isConsumer
ImageProducer method - check to see if we are sending bits to ic- Specified by:
isConsumer
in interfaceImageProducer
-
removeConsumer
ImageProducer method- Specified by:
removeConsumer
in interfaceImageProducer
-
startProduction
ImageProducer method - kicks things off.- Specified by:
startProduction
in interfaceImageProducer
-
requestTopDownLeftRightResend
ImageProducer method - send all the bits to the given consumer- Specified by:
requestTopDownLeftRightResend
in interfaceImageProducer
-
produce
public void produce()The blood & guts -
getCodec
returns the decoder, should you need it. -
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-