|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--quicktime.app.image.QTImageProducer
The QTImageProducer implements the java.awt.image.ImageProducer interface for a single source QuickTime object. The QuickTime source can be a single frame (ie. still image) or a mutliple frame source such as a movie, sprite world animation, effect, etc. The QTImageProducer can produce images for multiple ImageConsumers.
The isRedrawing() method returns true if the source QT object is an object that requires redrawing. In this case the ImageObserver of this Producer should explicitly call the redraw() method and repaint the resultant Image to see any changes in the source of the pixel data. For instance a typical movie will be a sequence of images over time, and for consequent frames to be seen the producer must be redraw. The act of redrawing the producer will also result in the registered consumers being notified and given the changed pixels. Redrawing can also be optimised to only redraw those pixels within a specified region.
When the source is originally added to the Producer it is drawn. If the source is not or does not require redrawing then consequent calls to redraw will have no effect as the source pixels have not changed. If the redrawing characteristics of the QTDrawable source change then you must call setRedrawing(true) to tell the producer that it should redraw the source's pixel data before the redraw method is called. By default an QTImageProduce is seen as potentially presenting dynamic or changing image data.
Fields inherited from interface quicktime.app.image.Redrawable |
kMultiFrame, kSingleFrame |
Constructor Summary | |
QTImageProducer(QTDrawable qtSource,
java.awt.Dimension initSize)
Creates an ImageProducer from the specified qtSource. |
Method Summary | |
void |
addConsumer(java.awt.image.ImageConsumer ic)
This method is used to register an ImageConsumer with the ImageProducer for access to the image data during a later reconstruction of the Image. |
java.awt.Dimension |
getSize()
This returns the rendered size of the qtSource pixel data as specified in the constructor. |
boolean |
isConsumer(java.awt.image.ImageConsumer ic)
This method determines if a given ImageConsumer object is currently registered with this ImageProducer as one of its consumers. |
boolean |
isRedrawing()
Returns true if the image data may be altered or different upon different calls of the redraw method of the QTDrawable interface |
boolean |
isSingleFrame()
Returns true if the Redrawable only has a single frame to render and thus will never need to re-acquire or redraw its image. |
void |
redraw(Region invalidRgn)
This method is called to redraw the QuickTime image source and update any of the current ImageConsumers with the new pixels that have been generated. |
void |
removeConsumer(java.awt.image.ImageConsumer ic)
This method removes the given ImageConsumer object from the list of consumers currently registered to receive image data. |
void |
requestTopDownLeftRightResend(java.awt.image.ImageConsumer ic)
This method is used by an ImageConsumer to request that the ImageProducer attempt to resend the image data one more time in TOPDOWNLEFTRIGHT order so that higher quality conversion algorithms which depend on receiving pixels in order can be used to produce a better output version of the image. |
void |
setRedrawing(boolean redrawFlag)
If true then the redraw method of the object will fetch new image data from its image source. |
void |
startProduction(java.awt.image.ImageConsumer ic)
This method both 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. |
void |
updateConsumers(Region invalidRgn)
This method can be called by an application to have the QTImageProducer to update the pixel data for each of the registered ImageConsumers when the source QTDrawable object has drawn. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public QTImageProducer(QTDrawable qtSource, java.awt.Dimension initSize) throws QTException
qtSource
- the source of pixel data for the ImageProducer.initSize
- the intial size of the source dataMethod Detail |
public boolean isSingleFrame()
isSingleFrame
in interface Redrawable
quicktime.app.image.Redrawable
public void addConsumer(java.awt.image.ImageConsumer ic)
addConsumer
in interface java.awt.image.ImageProducer
startProduction(java.awt.image.ImageConsumer)
public boolean isConsumer(java.awt.image.ImageConsumer ic)
isConsumer
in interface java.awt.image.ImageProducer
public void removeConsumer(java.awt.image.ImageConsumer ic)
removeConsumer
in interface java.awt.image.ImageProducer
public void startProduction(java.awt.image.ImageConsumer ic)
startProduction
in interface java.awt.image.ImageProducer
addConsumer(java.awt.image.ImageConsumer)
public void requestTopDownLeftRightResend(java.awt.image.ImageConsumer ic)
ic.setHints(TOPDOWNLEFTRIGHT | < otherhints >); ic.setPixels(...); // As many times as needed ic.imageComplete();
requestTopDownLeftRightResend
in interface java.awt.image.ImageProducer
ImageConsumer.setHints(int)
public void redraw(Region invalidRgn) throws QTException
invalidRgn
- if null the whole image is redrawn and all of the pixels
are grabbed and sent to the consumers. If not null then the qtSource
invalidates the region specified, which can result in a faster draw. Also only those
pixels that are within the bounds of the region are sent to the consumers.public void updateConsumers(Region invalidRgn) throws QTException
invalidRgn
- enter null to copy all pixels, or specify a region that specifies the changed pixel data,
which can econimize the copying of the pixel data to only those areas that have changed.public void setRedrawing(boolean redrawFlag)
setRedrawing
in interface Redrawable
redrawFlag
- boolean determining whether the current image is redrawn (false)
of fresh or updated image data is first retrieved (true).public boolean isRedrawing()
isRedrawing
in interface Redrawable
public java.awt.Dimension getSize()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |