|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jj2000.disp.BlkImgDataSrcImageProducer
This class provides an ImageProducer for the BlkImgDataSrc interface. It will request data from the BlkImgDataSrc source and deliver it to the registered image consumers. The data is requested line by line, starting at the top of each tile. The tiles are requested in raster-scan order.
The image data is not rescaled to fit the available dynamic range (not even the alpha values for RGBA data).
BlkImgDataSrc sources with 1, 3 and 4 components are supported. If 1, it is assumed to be gray-level data. If 3 it is assumed to be RGB data, in that order. If 4 it is assumed to be RGBA data (RGB plus alpha plane), in that order. All components must have the same size.
ImageProducer
,
BlkImgDataSrc
Field Summary | |
private static java.awt.image.ColorModel |
cm
The default color model (0xAARRGGBB) used in Java |
private java.util.Vector |
consumers
The list of image consumers for this image producer |
private static int |
GRAY
The gray-level image type (256 levels). |
private static int |
RGB
The color image type (24 bits RGB). |
private static int |
RGBA
The color image type (32 bits RGBA). |
private BlkImgDataSrc |
src
The source of image data |
private int |
type
The type of image: GRAY, RGB or RGBA |
Constructor Summary | |
BlkImgDataSrcImageProducer(BlkImgDataSrc src)
Creates an image producer which uses 'src' as the source of image data. |
Method Summary | |
void |
addConsumer(java.awt.image.ImageConsumer ic)
Registers an image consumer with this image producer. |
static java.awt.Image |
createImage(BlkImgDataSrc src)
Returns an Image object given an BlkImgDataSrc source. |
static java.awt.Image |
createImage(BlkImgDataSrc src,
java.awt.Component c)
Returns an Image object given an BlkImgDataSrc source. |
boolean |
isConsumer(java.awt.image.ImageConsumer ic)
This method determines if the given image consumer, 'ic', is registered with this image producer. |
void |
removeConsumer(java.awt.image.ImageConsumer ic)
Removes the given image consumer 'ic' from the list of consumers registered with this producer. |
void |
requestTopDownLeftRightResend(java.awt.image.ImageConsumer ic)
Starts the delivery of pixel data in the top-down letf-right order to the image consumer 'ic'. |
void |
startProduction(java.awt.image.ImageConsumer ic)
Registers the given ImageConsumer object as a consumer and starts an immediate reconstruction of the image data which will then be delivered to this consumer and any other consumer which may have already been registered with the producer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private volatile java.util.Vector consumers
private BlkImgDataSrc src
private int type
private static final int GRAY
private static final int RGB
private static final int RGBA
private static final java.awt.image.ColorModel cm
Constructor Detail |
public BlkImgDataSrcImageProducer(BlkImgDataSrc src)
src
- The source of image data.Method Detail |
public static java.awt.Image createImage(BlkImgDataSrc src)
This method uses the JVM default Toolkit, which might not be what it is desired.
src
- The source of image data.
public static java.awt.Image createImage(BlkImgDataSrc src, java.awt.Component c)
This method uses the component's toolkit. The toolkit of a component may change if it is moved from one frame to another one, since it is the frame that controls which toolkit is used.
src
- The source of image data.c
- The component to use to generate the 'Image' object from the
'ImageProducer'.
public final void addConsumer(java.awt.image.ImageConsumer ic)
addConsumer
in interface java.awt.image.ImageProducer
ic
- The image consumer to which image data has to be delivered.startProduction(java.awt.image.ImageConsumer)
public boolean isConsumer(java.awt.image.ImageConsumer ic)
isConsumer
in interface java.awt.image.ImageProducer
ic
- The image consumer to test.
public void removeConsumer(java.awt.image.ImageConsumer ic)
removeConsumer
in interface java.awt.image.ImageProducer
ic
- The image consumer to be removedpublic void startProduction(java.awt.image.ImageConsumer ic)
Delivery is performed in "parallel" to all the registered image consumers. By "parallel" it is meant that each line of the image is delivered to all consumers before delivering the next line.
If the data returned by the BlkImgDataSrc source happens to be progressive (see BlkImgDataSrc and DataBlk) then the abort condition is sent to the image consumers and no further data is delivered.
Once all the data is sent to a consumer this one is automatically removed from the list of registered ones, unless an abort happens.
To start the BlkImgDataSrc is set to tile (0,0), and the tiles are produced in raster sacn order. Once the last tile is produced, setTile(0,0) is called again, which signals that we are done with the current tile, which might free up resources.
startProduction
in interface java.awt.image.ImageProducer
ic
- The image consumer to registerpublic void requestTopDownLeftRightResend(java.awt.image.ImageConsumer ic)
Currently this call is ignored (which is perfectly legal according to the ImageProducer interface specification).
requestTopDownLeftRightResend
in interface java.awt.image.ImageProducer
ic
- The image consumer to which the data is sent in top-down,
left-right order.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |