|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectucar.jpeg.jj2000.disp.BlkImgDataSrcImageProducer
public class 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
Constructor Summary | |
---|---|
BlkImgDataSrcImageProducer(BlkImgDataSrc src)
Creates an image producer which uses 'src' as the source of image data. |
Method Summary | |
---|---|
void |
addConsumer(ImageConsumer ic)
Registers an image consumer with this image producer. |
static Image |
createImage(BlkImgDataSrc src)
Returns an Image object given an BlkImgDataSrc source. |
static Image |
createImage(BlkImgDataSrc src,
Component c)
Returns an Image object given an BlkImgDataSrc source. |
boolean |
isConsumer(ImageConsumer ic)
This method determines if the given image consumer, 'ic', is registered with this image producer. |
void |
removeConsumer(ImageConsumer ic)
Removes the given image consumer 'ic' from the list of consumers registered with this producer. |
void |
requestTopDownLeftRightResend(ImageConsumer ic)
Starts the delivery of pixel data in the top-down letf-right order to the image consumer 'ic'. |
void |
startProduction(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 |
Constructor Detail |
---|
public BlkImgDataSrcImageProducer(BlkImgDataSrc src)
src
- The source of image data.once
- If the image is to be produced only once or not.Method Detail |
---|
public static 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 Image createImage(BlkImgDataSrc src, 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(ImageConsumer ic)
addConsumer
in interface ImageProducer
ic
- The image consumer to which image data has to be delivered.startProduction(java.awt.image.ImageConsumer)
public boolean isConsumer(ImageConsumer ic)
isConsumer
in interface ImageProducer
ic
- The image consumer to test.
public void removeConsumer(ImageConsumer ic)
removeConsumer
in interface ImageProducer
ic
- The image consumer to be removedpublic void startProduction(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 ImageProducer
ic
- The image consumer to registerpublic void requestTopDownLeftRightResend(ImageConsumer ic)
Currently this call is ignored (which is perfectly legal according to the ImageProducer interface specification).
requestTopDownLeftRightResend
in interface ImageProducer
ic
- The image consumer to which the data is sent in top-down,
left-right order.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |