Package com.reportmill.graphics
Class RMImageData
java.lang.Object
com.reportmill.base.RMObject
com.reportmill.graphics.RMImageData
- All Implemented Interfaces:
- RMArchiver.Archiving,- Cloneable
This class manages image data. Each instance holds the raw image data and provides methods to return
 attributes of the decoded image.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic interfaceAn interface for classes that can handle image reading for RMImageData.
- 
Constructor SummaryConstructorsConstructorDescriptionReturns an empty RMImageData (useless except for legacy unarchival).RMImageData(Image anImage) Returns an image reader for an image.RMImageData(Object aSource, int pageNumber) Returns an image data for a given source (and page number, if image type supports it).
- 
Method SummaryModifier and TypeMethodDescriptionawt()Return AWT version of imageData.static booleanReturns whether given extension is supported.booleanStandard equals implementation.intColor map support: returns the index of the transparent color in a color map image.intReturns the number of bits per pixel (derived from bits per sample and samples per pixel).intReturns the number of bits per sample (eg, 24 bit RGB image is 8 bits per sample).byte[]getBytes()Returns the original bytes for the image (loaded from the source).byte[]Returns the decoded image bytes for the image.intReturns the number of bytes per row (derived from width and bits per pixel).byte[]Color map support: returns the bytes of color map from a color map image.intReturns the number of pixels vertically.floatReturns the actual display height of the image in printer's points using the image DPI if available.static RMImageDatagetImageData(Object aSource, int page) Returns an image data loaded from aSource.Returns an RMShape representation of image data (for vector image type like PDF).getName()Returns the name for the image (assigned from our hashCode).getPage(int aPage) Returns the image data for a successive page.intReturns the total number of pages for the image.intReturns the page number for the image.Returns the reader used to load the image.intReturns the number of samples per pixel (RGB=3, RGBA=4, GrayScale=1, etc.).Returns the original source for the image (byte[], File, InputStream or whatever).getType()Returns the type for the image (one of gif, jpg, png, pdf, etc.).intgetWidth()Returns the number of pixels horizontally.floatReturns the actual display width of the image in printer's points using the image DPI if available.booleanhasAlpha()Color map support: returns whether color map image has a transparent color.booleanReturns whether image uses a color map.initWithArchiver(RMArchiver anArchiver) Legacy unarchival.booleanisColor()Returns whether the image is non-grayscale.booleanisValid()Returns whether the image was loaded successfully.Methods inherited from class com.reportmill.base.RMObjectclone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, undoClone, undoCopy, undoEquals
- 
Constructor Details- 
RMImageDatapublic RMImageData()Returns an empty RMImageData (useless except for legacy unarchival).
- 
RMImageDataReturns an image data for a given source (and page number, if image type supports it).
- 
RMImageDataReturns an image reader for an image.
 
- 
- 
Method Details- 
getImageDataReturns an image data loaded from aSource. If image type supports multiple pages, page number can be specified.
- 
canReadReturns whether given extension is supported.
- 
getSourceReturns the original source for the image (byte[], File, InputStream or whatever).
- 
getBytespublic byte[] getBytes()Returns the original bytes for the image (loaded from the source).
- 
getBytesDecodedpublic byte[] getBytesDecoded()Returns the decoded image bytes for the image.
- 
getNameReturns the name for the image (assigned from our hashCode).
- 
getTypeReturns the type for the image (one of gif, jpg, png, pdf, etc.).
- 
getPageNumberpublic int getPageNumber()Returns the page number for the image.
- 
getPageCountpublic int getPageCount()Returns the total number of pages for the image.
- 
getWidthpublic int getWidth()Returns the number of pixels horizontally.
- 
getHeightpublic int getHeight()Returns the number of pixels vertically.
- 
getWidth2Dpublic float getWidth2D()Returns the actual display width of the image in printer's points using the image DPI if available.
- 
getHeight2Dpublic float getHeight2D()Returns the actual display height of the image in printer's points using the image DPI if available.
- 
isColorpublic boolean isColor()Returns whether the image is non-grayscale.
- 
getSamplesPerPixelpublic int getSamplesPerPixel()Returns the number of samples per pixel (RGB=3, RGBA=4, GrayScale=1, etc.).
- 
getBitsPerSamplepublic int getBitsPerSample()Returns the number of bits per sample (eg, 24 bit RGB image is 8 bits per sample).
- 
getBitsPerPixelpublic int getBitsPerPixel()Returns the number of bits per pixel (derived from bits per sample and samples per pixel).
- 
getBytesPerRowpublic int getBytesPerRow()Returns the number of bytes per row (derived from width and bits per pixel).
- 
hasAlphapublic boolean hasAlpha()Color map support: returns whether color map image has a transparent color.
- 
getAlphaColorIndexpublic int getAlphaColorIndex()Color map support: returns the index of the transparent color in a color map image.
- 
hasColorMappublic boolean hasColorMap()Returns whether image uses a color map.
- 
getColorMappublic byte[] getColorMap()Color map support: returns the bytes of color map from a color map image.
- 
getPageReturns the image data for a successive page.
- 
getImageShapeReturns an RMShape representation of image data (for vector image type like PDF).
- 
getReaderReturns the reader used to load the image.
- 
isValidpublic boolean isValid()Returns whether the image was loaded successfully.
- 
equalsStandard equals implementation.
- 
awtReturn AWT version of imageData.
- 
initWithArchiverLegacy unarchival.- Specified by:
- initWithArchiverin interface- RMArchiver.Archiving
- Overrides:
- initWithArchiverin class- RMObject
 
 
-