|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object eap.fits.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.
The output image will first be gamma corrected, meaning the pixel values
are raised to the power of 1/γ, where γ is set by
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,
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(ChangeListener l)
add a change listener to receive change events when significant progress has been made digitizing the image |
void |
addConsumer(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 |
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(ImageConsumer ic)
returns true if the given integer consumer is registered. |
void |
removeChangeListener(ChangeListener l)
remove a change listener |
void |
removeConsumer(ImageConsumer ic)
unregister the given integer consumer. |
void |
requestTopDownLeftRightResend(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(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(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, 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(ColorModel color)
public ColorModel getColorModel()
public void setGamma(double gamma)
public void addChangeListener(ChangeListener l)
public void removeChangeListener(ChangeListener l)
public void setChangeIncrement(double increment)
public double getProgress()
public void abortSend()
public void imageComplete(int status)
imageComplete
in interface RealImageConsumer
public void setDimensions(int width, int height)
setDimensions
in interface RealImageConsumer
public void setMinMax(double min, double max)
setMinMax
in interface RealImageConsumer
public void setHints(int hintflags)
setHints
in interface RealImageConsumer
public void setPixels(int x, int y, int w, int h, double[] pixels, int offset, int scansize)
setPixels
in interface RealImageConsumer
public double scalePixel(double pixel)
public byte digitizeToByte(double pixel)
public int digitizeToInt(double pixel)
public void addConsumer(ImageConsumer ic)
addConsumer
in interface ImageProducer
public boolean isConsumer(ImageConsumer ic)
isConsumer
in interface ImageProducer
public void removeConsumer(ImageConsumer ic)
removeConsumer
in interface ImageProducer
public void startProduction(ImageConsumer ic)
RealImageProducer.startProduction(RealImageConsumer)
.
startProduction
in interface ImageProducer
public void requestTopDownLeftRightResend(ImageConsumer ic)
RealImageProducer
requestTopDownLeftRightResend
in interface ImageProducer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |