|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ach.image.ImageInfo
ImageInfo.java
Copyright (c) 1997, 2005 Helge Hackbarth, All Rights Reserved.
A class describing properties of an image according to tags defined
in the TIFF file format.
NOTE: Most of the image information fields like width, height,
xResolution, yResolution, maxGrayLevel, bitsPerSample etc. are only
set for TIFF files. If you need this information also for images
read from GIF or JPEG files, please refer to the methods / property
fields available through the EMemImageSource-class in this package.
THE AUTHOR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY
OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, OR NON-INFRINGEMENT. THE AUTHOR SHALL NOT BE LIABLE FOR ANY
DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
Field Summary | |
java.lang.String |
annotationExtension
Filename extension that is expected for annotation file (default: ".xml") |
java.lang.String |
annotations
Annotations (XML formatted string) for the image |
static boolean |
annotationsAllowed
Flag if annotations are allowed to be read for the image (static, so it controls all instances) |
java.lang.String |
artist
Artist that created that image |
short |
bitsPerSample
Bits per sample |
static byte |
BLUEIDX
Index for RGB-Palette |
byte[] |
bytePixels
Array of bytes containing image data (if palette image with more than 16 colors) |
int |
bytesPerRow
Number of bytes per row (if stored bitwise packed) |
static int |
CCITTFAXG3
Compression type |
static int |
CCITTFAXG4
Compression type |
static int |
CCITTG3
Compression type |
static byte |
CMYK
Photometric interpretation |
java.awt.image.ColorModel |
colorModel
Current Java style ColorModel |
int |
compression
Current compression type |
java.lang.String |
errorMsg
Error message of last operation |
static byte |
GIF87
Sub-format for image data |
static byte |
GIF89A
Sub-format for image data |
static byte |
GRAYBLACK0
Photometric interpretation |
short[] |
grayRespCurve
Gray response curve (allows a nonlinear gray distribution) |
short |
grayRespUnit
Gray response unit (controls interpretation of gray response curve) |
static byte |
GRAYWHITE0
Photometric interpretation |
static byte |
GREENIDX
Index for RGB-Palette |
boolean |
hasChanged
Flag if image was modified |
int |
height
Vertical number of pixels |
static byte |
ifBMP
Predefined image file format |
static byte |
ifGIF
Predefined image file format |
static byte |
ifJPG
Predefined image file format |
static byte |
ifPNG
Predefined image file format |
static byte |
ifTIF
Predefined image file format |
static byte |
ifUNKNOWN
Predefined image file format |
java.lang.String |
imageDescription
Description of the image |
java.lang.String |
imageNameMasks
Name-masks for file dialog (seperated by pathSeparatorChar) |
byte[] |
imgFileBA
ByteArray that might contain the image-file as byte array (alternative to passing the file as imgName or imgURL) |
byte |
imgFormat
Current image file format |
java.lang.String |
imgName
(Path-)name of image file |
java.net.URL |
imgURL
URL of image file (read from local file if URL == null) |
static byte |
INTEL
Sub-format for image data |
int[] |
intPixels
Array of integers containing image data (if truecolor image) |
static int |
JPEG
Compression type |
static int |
LZW
Compression type |
short |
maxGrayLevel
Maximum gray level (e.g. 15 for 4 bit images, 255 for 8 bit images) |
static byte |
MOTOROLA
Sub-format for image data |
int |
numPages
Number of pages. |
short |
orientation
Orientation of the image orientation values: 1 NOP 2 mirror horizontally 3 rotate 180 degree 4 rotate 180 degree and mirror horizontally 5 rotate 270 degree anticlockwise and mirror horizontally 6 rotate 270 degree anticlockwise 7 rotate 90 degree anticlockwise and mirror horizontally 8 rotate 90 degree anticlockwise |
static int |
PACKBITS
Compression type |
byte[] |
packedPixels
Array of bytes containing packed image data (if palette image with 16 or less colors) |
int |
page
Current of page number within a multi document TIFF file (counting start at 1). |
static byte |
PALETTECOL
Photometric interpretation |
short |
photometricInt
Current photometric interpretation |
short |
planarConfig
Sample values continously or seperated in planes |
short |
predictor
Predictor controls whether the image data are horizontally differentiated |
static byte |
REDIDX
Index for RGB-Palette |
static byte |
RGB
Photometric interpretation |
byte[] |
rgbPalette
RGB-palette (array of 256 * 3 bytes for red, green and blue. 0 <= red, green, blue <= 255. |
short |
samplePlanes
Number of sample planes (in rare cases red, green and blue samples might be stored in seperate planes). |
short |
samplesPerPixel
Samples per pixel (e.g. 3 for RGB true color images) |
static byte |
sfUNKNOWN
Sub-format for image data |
ShapeList[] |
shapeLists
Array of ShapeLists that contains annotations parsed into vector graphic objects. |
java.lang.String |
software
Software that was used to create that image |
byte |
subFormat
Current image file subformat (set to ifGIF / ifTIF / ...). |
static byte |
TRANSPARMASK
Photometric interpretation |
static int |
UNCOMPRESSED
Compression type |
int |
width
Horizontal number of pixels |
Rational |
xResolution
Horizontal resolution in pixels per inch |
static byte |
YCBCR
Photometric interpretation |
Rational |
yResolution
Vertical resolution in pixels per inch |
Constructor Summary | |
ImageInfo()
Constructor for ImageInfo |
Method Summary | |
int |
calcPixelSize()
calulate real number of bits per pixel according to mapSize of ColorModel Note: ColorModel.getPixelSize() usually reports 8 even if mapsize < 256 (especially required for JDK 1.2) |
void |
createImageProducer()
Create an image producer from imgName or imgUrl. |
void |
detectImageFormat()
Method to detect image format from file extension |
void |
getAnnotations()
Load annotation file (expected with same name like imgName or imgUrl but with extension ".xml"). |
void |
run()
Allows to run the creation of an image producer asynchronously as seperate thread. |
void |
setAsynchronousTools(java.awt.Toolkit toolkit,
ImgProdObserver imgProdObserver,
boolean asyncMode)
Define all necessary parameters to be able to start image production as an asynchronous thread afterwards. |
void |
setDefaults()
Set default values for important image info variables |
java.lang.String |
toString()
Returns information about the image |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final byte ifUNKNOWN
public static final byte ifGIF
public static final byte ifJPG
public static final byte ifBMP
public static final byte ifTIF
public static final byte ifPNG
public java.lang.String imageNameMasks
public java.lang.String annotationExtension
public static final byte sfUNKNOWN
public static final byte INTEL
public static final byte MOTOROLA
public static final byte GIF87
public static final byte GIF89A
public static final int UNCOMPRESSED
public static final int CCITTG3
public static final int CCITTFAXG3
public static final int CCITTFAXG4
public static final int LZW
public static final int JPEG
public static final int PACKBITS
public static final byte GRAYWHITE0
public static final byte GRAYBLACK0
public static final byte RGB
public static final byte PALETTECOL
public static final byte TRANSPARMASK
public static final byte CMYK
public static final byte YCBCR
public static final byte REDIDX
public static final byte GREENIDX
public static final byte BLUEIDX
public java.lang.String imgName
public java.net.URL imgURL
public byte[] imgFileBA
public byte imgFormat
public byte subFormat
public int numPages
public int page
public boolean hasChanged
public int width
public int height
public Rational xResolution
public Rational yResolution
public short maxGrayLevel
public int bytesPerRow
public short bitsPerSample
samplesPerPixel
public short samplesPerPixel
public short samplePlanes
public int compression
public short predictor
public short photometricInt
public short planarConfig
samplePlanes
public short grayRespUnit
public short[] grayRespCurve
public byte[] rgbPalette
public java.lang.String artist
public java.lang.String software
public java.lang.String imageDescription
public static boolean annotationsAllowed
public java.lang.String annotations
public ShapeList[] shapeLists
public short orientation
public java.awt.image.ColorModel colorModel
public byte[] bytePixels
public int[] intPixels
public byte[] packedPixels
public java.lang.String errorMsg
Constructor Detail |
public ImageInfo()
Method Detail |
public void detectImageFormat()
public void setDefaults()
public void getAnnotations()
public void createImageProducer() throws java.awt.AWTException
public void run()
run
in interface java.lang.Runnable
public void setAsynchronousTools(java.awt.Toolkit toolkit, ImgProdObserver imgProdObserver, boolean asyncMode)
toolkit
- is the Toolkit provided by AWT classesimgProdObserver
- used during asynchronous loading to
inform the observing class when loading is finished.mode
- controls whether loading is done asynchronously or synchronouslypublic int calcPixelSize()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |