Class PDFTiledImage
- java.lang.Object
- 
- com.inductiveautomation.rm.pdf.reader.PDFTiledImage
 
- 
- All Implemented Interfaces:
- java.awt.image.ImageConsumer
 
 public class PDFTiledImage extends java.lang.Object implements java.awt.image.ImageConsumerThis class handles drawing images as tiles, for when allocating a BufferedImage for the entire pdf image would be too expensive. It implements ImageConsumer, and assumes that it will be passes an ImageProducer that knows how to generate itself top-down/left-right.It keeps a BufferedImage only as large as a single tile. When drawImage() is called, the imageProducer is told to generate the image data. As soon as a single tile is filled, it is drawn and the Buffer is reused for the next tile. We could cut out the imageProducer middle-man and just go directly from the codec... 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classPDFTiledImage.TiledImageProxy
 - 
Constructor SummaryConstructors Constructor Description PDFTiledImage()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddrawImage(java.awt.image.ImageProducer ip, java.awt.Graphics2D destination)The main entry point.static voiddrawTiledImage(java.awt.image.ImageProducer ip, java.awt.Graphics2D destination)intgetHeight()Returns the height of the entire image.java.awt.image.WritableRastergetTileBuffer()intgetTileHeight()Returns the height of the tile (it's a strip)intgetWidth()Returns the width of the entire image.voidimageComplete(int status)ImageConsumer method.voidsetColorModel(java.awt.image.ColorModel model)voidsetDimensions(int width, int height)ImageConsumer method.voidsetHints(int hintflags)voidsetPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, byte[] pixels, int off, int scansize)voidsetPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, int[] pixels, int off, int scansize)voidsetProperties(java.util.Hashtable props)
 
- 
- 
- 
Method Detail- 
getTileHeightpublic int getTileHeight() Returns the height of the tile (it's a strip)
 - 
getWidthpublic int getWidth() Returns the width of the entire image.
 - 
getHeightpublic int getHeight() Returns the height of the entire image.
 - 
imageCompletepublic void imageComplete(int status) ImageConsumer method. Releases the tile.- Specified by:
- imageCompletein interface- java.awt.image.ImageConsumer
 
 - 
setHintspublic void setHints(int hintflags) - Specified by:
- setHintsin interface- java.awt.image.ImageConsumer
 
 - 
setColorModelpublic void setColorModel(java.awt.image.ColorModel model) - Specified by:
- setColorModelin interface- java.awt.image.ImageConsumer
 
 - 
setDimensionspublic void setDimensions(int width, int height)ImageConsumer method. Assumption is that this will be called before any calls to setPixels()- Specified by:
- setDimensionsin interface- java.awt.image.ImageConsumer
 
 - 
getTileBufferpublic java.awt.image.WritableRaster getTileBuffer() 
 - 
setPixelspublic void setPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, byte[] pixels, int off, int scansize)- Specified by:
- setPixelsin interface- java.awt.image.ImageConsumer
 
 - 
setPixelspublic void setPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, int[] pixels, int off, int scansize)- Specified by:
- setPixelsin interface- java.awt.image.ImageConsumer
 
 - 
setPropertiespublic void setProperties(java.util.Hashtable props) - Specified by:
- setPropertiesin interface- java.awt.image.ImageConsumer
 
 - 
drawImagepublic void drawImage(java.awt.image.ImageProducer ip, java.awt.Graphics2D destination)The main entry point. Images are drawn at 0,0 so destination should have the image transform applied to it.
 - 
drawTiledImagepublic static void drawTiledImage(java.awt.image.ImageProducer ip, java.awt.Graphics2D destination)
 
- 
 
-