public class RMImageData extends RMObject
Modifier and Type | Class and Description |
---|---|
static interface |
RMImageData.ImageReader
An interface for classes that can handle image reading for RMImageData.
|
Constructor and Description |
---|
RMImageData()
Returns an empty RMImageData (useless except for legacy unarchival).
|
RMImageData(java.awt.Image anImage)
Returns an image reader for an image.
|
RMImageData(java.lang.Object aSource,
int pageNumber)
Returns an image data for a given source (and page number, if image type supports it).
|
Modifier and Type | Method and Description |
---|---|
java.awt.Image |
awt()
Return AWT version of imageData.
|
static boolean |
canRead(java.lang.String anExt)
Returns whether given extension is supported.
|
boolean |
equals(java.lang.Object anObj)
Standard equals implementation.
|
int |
getAlphaColorIndex()
Color map support: returns the index of the transparent color in a color map image.
|
int |
getBitsPerPixel()
Returns the number of bits per pixel (derived from bits per sample and samples per pixel).
|
int |
getBitsPerSample()
Returns 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[] |
getBytesDecoded()
Returns the decoded image bytes for the image.
|
int |
getBytesPerRow()
Returns the number of bytes per row (derived from width and bits per pixel).
|
byte[] |
getColorMap()
Color map support: returns the bytes of color map from a color map image.
|
int |
getHeight()
Returns the number of pixels vertically.
|
float |
getHeight2D()
Returns the actual display height of the image in printer's points using the image DPI if available.
|
static RMImageData |
getImageData(java.lang.Object aSource,
int page)
Returns an image data loaded from aSource.
|
RMShape |
getImageShape()
Returns an RMShape representation of image data (for vector image type like PDF).
|
java.lang.String |
getName()
Returns the name for the image (assigned from our hashCode).
|
RMImageData |
getPage(int aPage)
Returns the image data for a successive page.
|
int |
getPageCount()
Returns the total number of pages for the image.
|
int |
getPageNumber()
Returns the page number for the image.
|
RMImageData.ImageReader |
getReader()
Returns the reader used to load the image.
|
int |
getSamplesPerPixel()
Returns the number of samples per pixel (RGB=3, RGBA=4, GrayScale=1, etc.).
|
java.lang.Object |
getSource()
Returns the original source for the image (byte[], File, InputStream or whatever).
|
java.lang.String |
getType()
Returns the type for the image (one of gif, jpg, png, pdf, etc.).
|
int |
getWidth()
Returns the number of pixels horizontally.
|
float |
getWidth2D()
Returns the actual display width of the image in printer's points using the image DPI if available.
|
boolean |
hasAlpha()
Color map support: returns whether color map image has a transparent color.
|
boolean |
hasColorMap()
Returns whether image uses a color map.
|
java.lang.Object |
initWithArchiver(RMArchiver anArchiver)
Legacy unarchival.
|
boolean |
isColor()
Returns whether the image is non-grayscale.
|
boolean |
isValid()
Returns whether the image was loaded successfully.
|
clone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, undoClone, undoCopy, undoEquals
public RMImageData()
public RMImageData(java.lang.Object aSource, int pageNumber)
public RMImageData(java.awt.Image anImage)
public static RMImageData getImageData(java.lang.Object aSource, int page)
public static boolean canRead(java.lang.String anExt)
public java.lang.Object getSource()
public byte[] getBytes()
public byte[] getBytesDecoded()
public java.lang.String getName()
public java.lang.String getType()
public int getPageNumber()
public int getPageCount()
public int getWidth()
public int getHeight()
public float getWidth2D()
public float getHeight2D()
public boolean isColor()
public int getSamplesPerPixel()
public int getBitsPerSample()
public int getBitsPerPixel()
public int getBytesPerRow()
public boolean hasAlpha()
public int getAlphaColorIndex()
public boolean hasColorMap()
public byte[] getColorMap()
public RMImageData getPage(int aPage)
public RMShape getImageShape()
public RMImageData.ImageReader getReader()
public boolean isValid()
public boolean equals(java.lang.Object anObj)
equals
in class java.lang.Object
public java.awt.Image awt()
public java.lang.Object initWithArchiver(RMArchiver anArchiver)
initWithArchiver
in interface RMArchiver.Archiving
initWithArchiver
in class RMObject