|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.io.fits.ImageDigitizer
public class ImageDigitizer
****************************************************************************
This class converts a stream of double-valued pixels from a
RealImageProducer into a stream of integer pixels. This class
implements the Java ImageProducer interface, so it can be used to create
a Java Image.
setGamma(double). Then it is scaled so that the smallest real pixel
value corresponds to the smallest ingeger or byte value and the
largest real value corresponds to the largest ingeter or byte value.
Since digitization can take time, you can register ChangeListeners to
monitor the progress of the digitization.
*****************************************************************************
| Constructor Summary | |
|---|---|
ImageDigitizer(RealImageProducer source,
java.awt.image.ColorModel color)
*********************************************************************** Create an ImageDigitizer using a given color model and which will digitize the data from a given source. |
|
| Method Summary | |
|---|---|
void |
abortSend()
*********************************************************************** abort the image we are sending if we are actually sending an image ************************************************************************ |
void |
addChangeListener(javax.swing.event.ChangeListener l)
*********************************************************************** add a change listener to receive change events when significant progress has been made digitizing the image ************************************************************************ |
void |
addConsumer(java.awt.image.ImageConsumer ic)
*********************************************************************** register an integer image consumer |
byte |
digitizeToByte(double pixel)
*********************************************************************** this is where the actual digitization happens for byte color models ************************************************************************ |
int |
digitizeToInt(double pixel)
*********************************************************************** this is where the actual digitization happens for int color models ************************************************************************ |
java.awt.image.ColorModel |
getColorModel()
*********************************************************************** get the color model for the digitized pixels ************************************************************************ |
double |
getProgress()
*********************************************************************** returns the fraction of pixels which have been processed ************************************************************************ |
void |
imageComplete(int status)
*********************************************************************** pass along the image complete message to the integer image |
boolean |
isConsumer(java.awt.image.ImageConsumer ic)
*********************************************************************** returns true if the given integer consumer is registered |
void |
removeChangeListener(javax.swing.event.ChangeListener l)
*********************************************************************** remove a change listener ************************************************************************ |
void |
removeConsumer(java.awt.image.ImageConsumer ic)
*********************************************************************** unregister the given integer consumer |
void |
requestTopDownLeftRightResend(java.awt.image.ImageConsumer ic)
*********************************************************************** passes the request up to the RealImageProducer
************************************************************************ |
double |
scalePixel(double pixel)
*********************************************************************** return a pixel value scaled so that min -> 0 and max -> 1 and with gamma correction applied |
void |
setChangeIncrement(double increment)
*********************************************************************** set the interval at which change events are fired in terms of fraction of completion ************************************************************************ |
void |
setColorModel(java.awt.image.ColorModel color)
*********************************************************************** set the color model for the digitized pixels. |
void |
setDimensions(int width,
int height)
*********************************************************************** pass this information along to the integer image stream |
void |
setGamma(double gamma)
*********************************************************************** set the gamma correction factor to used in the digitization. |
void |
setHints(int hintflags)
*********************************************************************** pass this information along to the integer image stream |
void |
setImageSource(RealImageProducer source)
*********************************************************************** set the RealImageProducer source for the digitizer. |
void |
setMinMax(double min,
double max)
*********************************************************************** The RealImageProducer calls this method to indicate the pixel limits |
void |
setNaNvalue(byte value)
*********************************************************************** set the digitized byte pixel value to use for NaN pixels ************************************************************************ |
void |
setNaNvalue(int value)
*********************************************************************** set the digitized int pixel value to use for NaN pixels ************************************************************************ |
void |
setPixels(int x,
int y,
int w,
int h,
double[] pixels,
int offset,
int scansize)
*********************************************************************** the RealImageProducer calls this method to deliver a set of pixels. |
void |
startProduction(java.awt.image.ImageConsumer ic)
*********************************************************************** Begin producing pixels for the integer consumers. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ImageDigitizer(RealImageProducer source,
java.awt.image.ColorModel color)
source - the source of double valued pixel data.color - The color model to use in the digitized image.
************************************************************************| Method Detail |
|---|
public void setImageSource(RealImageProducer source)
public void setNaNvalue(int value)
public void setNaNvalue(byte value)
public void setColorModel(java.awt.image.ColorModel color)
public java.awt.image.ColorModel getColorModel()
public void setGamma(double gamma)
public void addChangeListener(javax.swing.event.ChangeListener l)
public void removeChangeListener(javax.swing.event.ChangeListener l)
public void setChangeIncrement(double increment)
public double getProgress()
public void abortSend()
public void imageComplete(int status)
imageComplete in interface RealImageConsumerstatus - DOCUMENT ME!
public void setDimensions(int width,
int height)
setDimensions in interface RealImageConsumerwidth - DOCUMENT ME!height - DOCUMENT ME!
public void setMinMax(double min,
double max)
setMinMax in interface RealImageConsumermin - DOCUMENT ME!max - DOCUMENT ME!public void setHints(int hintflags)
setHints in interface RealImageConsumerhintflags - DOCUMENT ME!
public void setPixels(int x,
int y,
int w,
int h,
double[] pixels,
int offset,
int scansize)
setPixels in interface RealImageConsumerx - DOCUMENT ME!y - DOCUMENT ME!w - DOCUMENT ME!h - DOCUMENT ME!pixels - DOCUMENT ME!offset - DOCUMENT ME!scansize - DOCUMENT ME!public double scalePixel(double pixel)
public byte digitizeToByte(double pixel)
public int digitizeToInt(double pixel)
public void addConsumer(java.awt.image.ImageConsumer ic)
addConsumer in interface java.awt.image.ImageProducerpublic boolean isConsumer(java.awt.image.ImageConsumer ic)
isConsumer in interface java.awt.image.ImageProducerpublic void removeConsumer(java.awt.image.ImageConsumer ic)
removeConsumer in interface java.awt.image.ImageProducerpublic void startProduction(java.awt.image.ImageConsumer ic)
RealImageProducer.startProduction(RealImageConsumer).
************************************************************************
startProduction in interface java.awt.image.ImageProducerpublic void requestTopDownLeftRightResend(java.awt.image.ImageConsumer ic)
RealImageProducer
************************************************************************
requestTopDownLeftRightResend in interface java.awt.image.ImageProducer
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||