Class PDFCCITTFaxProducer
- java.lang.Object
-
- java.io.OutputStream
-
- com.inductiveautomation.rm.pdf.reader.PDFCCITTFaxProducer
-
- All Implemented Interfaces:
java.awt.image.ImageProducer
,java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
public class PDFCCITTFaxProducer extends java.io.OutputStream implements java.awt.image.ImageProducer
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
Constructors Constructor Description PDFCCITTFaxProducer(RBCodecCCITTFaxDecode decoder)
Create a new image producer for the codec.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addConsumer(java.awt.image.ImageConsumer ic)
ImageProducer method - add a new consumervoid
flush()
RBCodecCCITTFaxDecode
getCodec()
returns the decoder, should you need it.boolean
isConsumer(java.awt.image.ImageConsumer ic)
ImageProducer method - check to see if we are sending bits to icvoid
produce()
The blood & gutsvoid
removeConsumer(java.awt.image.ImageConsumer ic)
ImageProducer methodvoid
requestTopDownLeftRightResend(java.awt.image.ImageConsumer ic)
ImageProducer method - send all the bits to the given consumervoid
startProduction(java.awt.image.ImageConsumer ic)
ImageProducer method - kicks things off.void
write(byte[] b)
void
write(int b)
-
-
-
Constructor Detail
-
PDFCCITTFaxProducer
public PDFCCITTFaxProducer(RBCodecCCITTFaxDecode decoder)
Create a new image producer for the codec.
-
-
Method Detail
-
addConsumer
public void addConsumer(java.awt.image.ImageConsumer ic)
ImageProducer method - add a new consumer- Specified by:
addConsumer
in interfacejava.awt.image.ImageProducer
-
isConsumer
public boolean isConsumer(java.awt.image.ImageConsumer ic)
ImageProducer method - check to see if we are sending bits to ic- Specified by:
isConsumer
in interfacejava.awt.image.ImageProducer
-
removeConsumer
public void removeConsumer(java.awt.image.ImageConsumer ic)
ImageProducer method- Specified by:
removeConsumer
in interfacejava.awt.image.ImageProducer
-
startProduction
public void startProduction(java.awt.image.ImageConsumer ic)
ImageProducer method - kicks things off.- Specified by:
startProduction
in interfacejava.awt.image.ImageProducer
-
requestTopDownLeftRightResend
public void requestTopDownLeftRightResend(java.awt.image.ImageConsumer ic)
ImageProducer method - send all the bits to the given consumer- Specified by:
requestTopDownLeftRightResend
in interfacejava.awt.image.ImageProducer
-
produce
public void produce()
The blood & guts
-
getCodec
public RBCodecCCITTFaxDecode getCodec()
returns the decoder, should you need it.
-
write
public void write(byte[] b) throws java.io.IOException
- Overrides:
write
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException
- Specified by:
flush
in interfacejava.io.Flushable
- Overrides:
flush
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
write
public void write(int b) throws java.io.IOException
- Specified by:
write
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
-