|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object O2Plib.image.PixReader
public class PixReader
Nested Class Summary | |
---|---|
(package private) class |
PixReader.PixObserver
PixObserver implements our own (rather than default) image observer |
Field Summary | |
---|---|
byte[] |
bytePix
8-bits/pixel image if it exists |
char[] |
charPix
16-bits/pixel image if it exists. |
boolean |
dbugFlag
To track additional loading info |
boolean |
errorLoadingImageFlag
set after image loaded |
java.awt.Image |
image
image instance |
java.lang.String |
imgFile
full file path name of the input image |
java.lang.String |
imgType
image type: "TIFF", "JPG", "GIF", "PPX" |
int[] |
intPix
16-bits/pixel image if it exists packed in LSB of 232-bit int Data may be 8-bits to 16/bits/pixel |
static boolean |
isColorImageFlag
The image was a RGB color image converted to grayscale using the NTSC color transform. |
boolean |
isLoadedFlag
set after image loaded |
int |
maxGrayPixel
maxGrayPixel pixel value in the image |
int |
minGrayPixel
minGrayPixel pixel value in the image |
int |
nBitsPerPixel
# of bits/pixel in the image |
int |
nBytesPerPixel
# of bytes/pixel in the image |
int |
nCols
# of columns in the image |
private static boolean |
NEVER
Debugging |
int |
nPixels
# of columns X # rows in the image |
int |
nRows
# of rows in the image |
static int |
nth
dump sequantially named pictures using numbered image files |
static java.lang.String |
VERSION
Version for this module |
Constructor Summary | |
---|---|
PixReader()
PixReader() - Constructor to use when reading an image file |
|
PixReader(int[] intPix)
PixReader() - Constructor to use when converting an int[] pix to a char[] pixel array using getCharPix(). |
|
PixReader(java.lang.String imgFileName)
PixReader() - init the state of the image reader |
Method Summary | |
---|---|
void |
clearImageReader(java.lang.String imgFileName)
clearImageReader() - init the state of the image reader |
char[] |
getCharPix()
getCharPix() - map the image to char[]. |
private static byte[] |
getPixelDataFromImage(java.awt.Image img,
int width,
int height)
getPixelDataFromImage() - get the pixel data from the image |
boolean |
loadGifOrJpegPix(java.lang.String imageFile)
loadGifOrJpegPix() - read GIF or JPEG pix file into this obj as bytePix[] and return as intPix[]. |
boolean |
loadJpeg2000Pix(java.lang.String imageFile)
loadJpeg2000Pix() - read JPEG2000 pix file into this obj as either charPix[] or bytePix[] depending on whether it is > 8-bits/pixel or not. |
boolean |
loadPPXpix(java.lang.String imageFile)
loadPPXpix() - read GELLAB-II PPX pix file into this obj as bytePix[] and return as int{ox[]. |
boolean |
loadTiffPix(java.lang.String imageFile)
loadTiffPix() - read Tiff pix file into this obj as a grayscale intPix[]. |
PixReader |
readImageFile(java.lang.String imgFile)
readImageFile() - read an image fileread new image file. |
void |
setDebugFlag(boolean dbugFlag)
setDebugFlag() - flag to track additional loading info |
private java.lang.String |
showMediaTrackerStatusBits(java.lang.String msg,
java.net.URL imageURL,
java.lang.String imageFile,
java.awt.MediaTracker tracker)
showMediaTrackerStatusBits() - print the media tracker status bits |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String VERSION
private static final boolean NEVER
public static int nth
public boolean dbugFlag
public boolean isLoadedFlag
public boolean errorLoadingImageFlag
public java.awt.Image image
public static boolean isColorImageFlag
public java.lang.String imgFile
public java.lang.String imgType
public int nRows
public int nCols
public int nPixels
public int nBytesPerPixel
public int nBitsPerPixel
public int minGrayPixel
public int maxGrayPixel
public byte[] bytePix
public char[] charPix
public int[] intPix
Constructor Detail |
---|
public PixReader()
public PixReader(int[] intPix)
intPix
- is integer arraygetCharPix()
public PixReader(java.lang.String imgFileName)
imgFileName
- image that will be readingMethod Detail |
---|
public void clearImageReader(java.lang.String imgFileName)
imgFileName
- image that will be readingpublic void setDebugFlag(boolean dbugFlag)
dbugFlag
- - debug flag statuspublic PixReader readImageFile(java.lang.String imgFile)
imgFile
- is the full path of the image to read
public char[] getCharPix()
public boolean loadTiffPix(java.lang.String imageFile)
imageFile
- image file name
public boolean loadPPXpix(java.lang.String imageFile)
imageFile
- image file name
public boolean loadGifOrJpegPix(java.lang.String imageFile)
imageFile
- image file name
public boolean loadJpeg2000Pix(java.lang.String imageFile)
imageFile
- image file name
private static byte[] getPixelDataFromImage(java.awt.Image img, int width, int height)
img
- image to usewidth
- of imageheight
- of image
private java.lang.String showMediaTrackerStatusBits(java.lang.String msg, java.net.URL imageURL, java.lang.String imageFile, java.awt.MediaTracker tracker)
msg
- to add prefix to status stringimageURL
- imageFile
- tracker
- MediaTracker being used
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |