public class RMImageData
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
static RMImageData |
EMPTY |
Constructor and Description |
---|
RMImageData() |
Modifier and Type | Method and Description |
---|---|
static boolean |
canRead(byte[] bytes)
Returns whether image reader can read the file provided in the byte array.
|
static boolean |
canRead(java.lang.String anExt)
Returns whether given extension is supported.
|
RMImageData |
clone()
Standard clone implementation.
|
Image |
createImage()
Creates the image for this ImageData.
|
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.
|
Image |
getImage()
Returns the buffered image for image data.
|
static RMImageData |
getImageData(java.lang.Object aSource,
int aPageIndex)
Returns an image data loaded from aSource.
|
double |
getImageHeight()
Returns the actual display height of the image in printer's points using the image DPI if available.
|
double |
getImageWidth()
Returns the actual display width of the image in printer's points using the image DPI if available.
|
java.lang.String |
getName()
Returns the name for the image (assigned from our hashCode).
|
RMImageData |
getPage(int aPage)
Returns the image data for an alternate page.
|
int |
getPageCount()
Returns the total number of pages for the image.
|
int |
getPageIndex()
Returns the page index for 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).
|
WebURL |
getSourceURL()
Returns the source URL, if loaded from URL.
|
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.
|
boolean |
hasAlpha()
Returns whether image has transparency.
|
boolean |
isColor()
Returns whether the image is non-grayscale.
|
boolean |
isIndexedColor()
Returns whether image uses a color map.
|
boolean |
isValid()
Returns whether the image was loaded successfully.
|
void |
paint(Painter aPntr,
double x,
double y,
double w,
double h)
Draws image data in given rect.
|
void |
readBasicInfo()
Reads basic image info.
|
public static RMImageData EMPTY
public static RMImageData getImageData(java.lang.Object aSource, int aPageIndex)
public java.lang.Object getSource()
public WebURL getSourceURL()
public void readBasicInfo()
public java.lang.String getName()
public java.lang.String getType()
public int getWidth()
public int getHeight()
public double getImageWidth()
public double getImageHeight()
public boolean isColor()
public boolean hasAlpha()
public int getSamplesPerPixel()
public int getBitsPerSample()
public int getBitsPerPixel()
public int getBytesPerRow()
public Image getImage()
public Image createImage()
public byte[] getBytes()
public byte[] getBytesDecoded()
public boolean isIndexedColor()
public byte[] getColorMap()
public int getAlphaColorIndex()
public int getPageIndex()
public int getPageCount()
public RMImageData getPage(int aPage)
public boolean isValid()
public boolean equals(java.lang.Object anObj)
equals
in class java.lang.Object
public RMImageData clone()
clone
in class java.lang.Object
public void paint(Painter aPntr, double x, double y, double w, double h)
public static boolean canRead(java.lang.String anExt)
public static boolean canRead(byte[] bytes)