All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class quicktime.app.image.ImagePresenter

java.lang.Object
   |
   +----quicktime.app.image.ImagePresenter

public class ImagePresenter
extends Object
implements QTDrawable, Compositable, ImageSettable
This class represents an image that is loaded into memory. Its focus is on performance so if the image data that is presented to the ImagePresenter is in a format that is non-optimal for drawing the data will generally be converted to a format that is optimal, at the expense of a greater usage of memory (see setImageData methods). This process is controlled by the optimised redrawing flag, which if true (the default), may convert the image to a better format for drawing performance.


Constructor Index

 o ImagePresenter(QDRect)
Creates an emtpy ImagePresenter object - you will need to set the image data and description before this object is usable.

Method Index

 o addedTo(Object)
This method is called by the specified object when the instance of the class that implements this interface is added to the object that is the source of the interest.
 o doDraw()
This is the method that blits the data directly to the destination QDGraphics.
 o fromFile(QTFile)
This creates an ImagePresenter object from a file.
 o fromGraphicsImporter(GraphicsImporter)
This creates an ImagePresenter object from a GraphicsImporter.
 o fromGraphicsImporterDrawer(GraphicsImporterDrawer)
This creates an ImagePresenter object from an GraphicsImporterDrawer object.
 o fromGWorld(QDGraphics)
This creates an ImagePresenter object from the PixMap of the QDGraphics object.
 o fromGWorld(QDGraphics, QDRect, int, int, int, CodecComponent)
This creates an ImagePresenter object from PixMap source, bounds QDRect, color depth, compression quality, codec type, and codec component.
 o fromImageSequence(ImageDataSequence, int)
This creates an ImagePresenter object from nth first image of any ImageDataSequence object
 o fromImageSpec(ImageSpec)
This creates an ImagePresenter object from an ImageSpec object.
 o fromPict(Pict)
This creates an ImagePresenter object from a Pict object that is stored in memory.
 o fromQTImage(EncodedImage, ImageDescription)
This creates an ImagePresenter object from raw image data and ImageDescription.
 o getClip()
Returns a region that defines the current clipping region for the object.
 o getDescription()
This method should return an ImageDescription that describes the image data that the class contains.
 o getDisplayBounds()
QTCanvas calls this method when it needs to ask the client for its boundary.
 o getDSequence()
Returns the DSequence that is used by the ImagePresenter.
 o getGraphicsMode()
This gets the current GraphicsMode for the compositor.
 o getGWorld()
QTCanvas calls this method to get the destination QDGraphics of its client.
 o getImage()
This method returns the actual image data.
 o getInitialSize()
This method returns the original size before the transformations specified in the returned matrix are applied.
 o getMatrix()
This will return the client's current display transformations
 o isRedrawOptimised()
Returns the current state of the optimisation for drawing flag.
 o redraw(Region)
QTCanvas calls this method when the client should redraw itself.
 o removedFrom(Object)
This method is called by the specified object when the instance of the class that implements this interface is removed from the object that is the source of the interest.
 o removeImageData()
This method removes the previously set encoded image data and description from the ImagePresenter and will remove it from any destination QDGraphics it is currently drawing into.
 o setClip(Region)
Sets a region that will define the clipping region for the object
 o setDisplayBounds(QDRect)
QTCanvas calls this method when it needs to tell the client to adjust its location, width and/or height.
 o setGraphicsMode(GraphicsMode)
This sets the GraphicsMode for the Compositor when it draws its composited contents to its destination QDGraphics (typically the QTCanvas).
 o setGWorld(QDGraphics)
QTCanvas calls this method to give the client the QDGraphics object it should use to do its drawing.
 o setImageData(EncodedImage)
If you have already set the image data and you have image data in the same general parameters as previously set (ie.
 o setImageData(EncodedImage, ImageDescription)
Sets the current image data and description.
 o setLocation(int, int)
A convenience method to set the position of a QTDrawable object.
 o setMatrix(Matrix)
This method assigns a mapping matrix to the sequence.
 o setRedrawOptimised(boolean)
Returns the state of the optimisation for redraw flag.
 o toString()
Returns a String representation of this object.

Constructors

 o ImagePresenter
 public ImagePresenter(QDRect initialSize)
Creates an emtpy ImagePresenter object - you will need to set the image data and description before this object is usable.

Methods

 o fromFile
 public static ImagePresenter fromFile(QTFile qtFile) throws IOException, QTException
This creates an ImagePresenter object from a file.

Parameters:
qtFile - the QTFile.
 o fromGraphicsImporter
 public static ImagePresenter fromGraphicsImporter(GraphicsImporter importer) throws IOException, QTException
This creates an ImagePresenter object from a GraphicsImporter.

Parameters:
importer - the GraphicsImporter object.
 o fromGraphicsImporterDrawer
 public static ImagePresenter fromGraphicsImporterDrawer(GraphicsImporterDrawer imageFile) throws IOException, QTException
This creates an ImagePresenter object from an GraphicsImporterDrawer object.

Parameters:
imageFile - the image file object
 o fromImageSpec
 public static ImagePresenter fromImageSpec(ImageSpec image) throws QTException
This creates an ImagePresenter object from an ImageSpec object.

Parameters:
image - the image
nth - the index into the ImageDataSequence object of the image data that should be used
 o fromImageSequence
 public static ImagePresenter fromImageSequence(ImageDataSequence image,
                                                int nth) throws QTException
This creates an ImagePresenter object from nth first image of any ImageDataSequence object

Parameters:
image - the image
nth - the index into the ImageDataSequence object of the image data that should be used
 o fromGWorld
 public static ImagePresenter fromGWorld(QDGraphics grafPort) throws QTException
This creates an ImagePresenter object from the PixMap of the QDGraphics object. It will not be compressed.

Parameters:
grafPort - the grafPort that will be used to create the ImagePresenter object from.
 o fromGWorld
 public static ImagePresenter fromGWorld(QDGraphics port,
                                         QDRect rect,
                                         int colorDepth,
                                         int quality,
                                         int codecType,
                                         CodecComponent codec) throws QTException
This creates an ImagePresenter object from PixMap source, bounds QDRect, color depth, compression quality, codec type, and codec component. This will circumvent the normal restrictions placed on an ImagePresenter in that the data will be kept in the format you specify, even if that is not an optimal format for rendering.

Parameters:
port - a QDGraphics object from which the PixMap will be used.
rect - the QDRect object - this may not be null
colorDepth - the int value.
quality - the int value.
codecType - the int value.
codec - the CodecComponent object.
 o fromPict
 public static ImagePresenter fromPict(Pict p) throws QTException
This creates an ImagePresenter object from a Pict object that is stored in memory.

Parameters:
p - the pict handle
 o fromQTImage
 public static ImagePresenter fromQTImage(EncodedImage data,
                                          ImageDescription desc) throws QTException
This creates an ImagePresenter object from raw image data and ImageDescription.

Parameters:
data - the image data.
desc - the ImageDescription object.
 o setImageData
 public void setImageData(EncodedImage data,
                          ImageDescription desc) throws QTException
Sets the current image data and description. If the data is specified then it may be recompressed if the format of the data is not optimal for redrawing and the redraw optimised flag is set to true. If you pass in null for the EncodedImage argument then the application must call the setImageData (EncodedImage) method after this to ensure that the ImagePresenter has both required data and description. The data formats that are not recompressed are any known pixel format (which includes the rawCodecType), animation, vector or QuickDraw formats.

Parameters:
data - the new image data for display or null to allow the application to keep the data in its preferred format.
desc - describes the format of the image data - this may NOT be null.
 o setImageData
 public void setImageData(EncodedImage ei) throws QTException
If you have already set the image data and you have image data in the same general parameters as previously set (ie. the same ImageDescription will describe the data) then this call can be used to just replace the changed image data.

Parameters:
ei - the new encoded image data
 o setRedrawOptimised
 public void setRedrawOptimised(boolean flag)
Returns the state of the optimisation for redraw flag. If true, then when image data is set the ImagePresenter may decompress the image data to a format that is optimised for performance at the expense of possibly greater memory usage. If false, then setting the image data will not decompress the image data. The default is true. Changing this flag will not alter the current image data format, it only effects consequent calls to the setImageData (EncodedImage, ImageDescription) calls.

Parameters:
flag - the new setting.
 o isRedrawOptimised
 public boolean isRedrawOptimised()
Returns the current state of the optimisation for drawing flag.

Returns:
a boolean
 o removeImageData
 public void removeImageData() throws QTException
This method removes the previously set encoded image data and description from the ImagePresenter and will remove it from any destination QDGraphics it is currently drawing into.

 o getDescription
 public ImageDescription getDescription()
This method should return an ImageDescription that describes the image data that the class contains.

Returns:
the ImageDescription of an Image
 o getDSequence
 public DSequence getDSequence()
Returns the DSequence that is used by the ImagePresenter. This object may be null if the ImagePresenter is not currently attached to a valid destination QDGraphics. The application should not cache this sequence object for any length of time - as if the destination QDGraphics is changed the DSequence is thrown away and a new one is created.

 o getClip
 public Region getClip() throws QTException
Returns a region that defines the current clipping region for the object.

Returns:
the clipping region
 o setClip
 public synchronized void setClip(Region reg) throws StdQTException
Sets a region that will define the clipping region for the object

Parameters:
reg - the new clipping region
 o addedTo
 public void addedTo(Object interest)
This method is called by the specified object when the instance of the class that implements this interface is added to the object that is the source of the interest.

Parameters:
interest - the object that is to be the source of interest for the the object that implements this interface.
 o removedFrom
 public void removedFrom(Object interest)
This method is called by the specified object when the instance of the class that implements this interface is removed from the object that is the source of the interest.

Parameters:
interest - the object that was the source of interest for the the object that implements this interface.
 o getMatrix
 public Matrix getMatrix() throws StdQTException
This will return the client's current display transformations

Returns:
the display transformations of the client
 o setMatrix
 public void setMatrix(Matrix matrix) throws QTException
This method assigns a mapping matrix to the sequence.

QuickTime::SetDSequenceMatrix

Parameters:
matrix - a Matrix object that specifies how to transform the image during decompression
 o getInitialSize
 public Dimension getInitialSize() throws QTException
This method returns the original size before the transformations specified in the returned matrix are applied.

 o getImage
 public EncodedImage getImage()
This method returns the actual image data.

Returns:
the image data
 o getGWorld
 public QDGraphics getGWorld()
QTCanvas calls this method to get the destination QDGraphics of its client.

Returns:
a QDGraphics object or null
 o setGWorld
 public void setGWorld(QDGraphics cgp) throws QTException
QTCanvas calls this method to give the client the QDGraphics object it should use to do its drawing. If the incoming QDGraphics is the QDGraphics.scratch then the drawable will not be visible and can disable itself. If a client is unable to set the graphics world it should throw an exception.

Parameters:
cgp - a QDGraphics object
 o setDisplayBounds
 public void setDisplayBounds(QDRect bounds) throws StdQTException
QTCanvas calls this method when it needs to tell the client to adjust its location, width and/or height. All values are in pixels.

Parameters:
bounds - the new size and location.
 o setLocation
 public void setLocation(int x,
                         int y) throws QTException
A convenience method to set the position of a QTDrawable object.

Parameters:
x - the new x location
y - the new y location
 o getDisplayBounds
 public QDRect getDisplayBounds()
QTCanvas calls this method when it needs to ask the client for its boundary. All values are in pixels.

Returns:
the boundary of the client
 o redraw
 public synchronized void redraw(Region invalidRgn) throws QTException
QTCanvas calls this method when the client should redraw itself. If the canvas is able to discern that only a part of the client's drawing area needs to be redrawn - then this area shall be passed in using the invalidRgn. Otherwise this will be null in which case the client should redraw itself entirely.

Parameters:
invalidRgn - the invalidRgn that the client should redraw
 o doDraw
 protected final void doDraw() throws QTException
This is the method that blits the data directly to the destination QDGraphics.

 o setGraphicsMode
 public void setGraphicsMode(GraphicsMode mode) throws QTException
This sets the GraphicsMode for the Compositor when it draws its composited contents to its destination QDGraphics (typically the QTCanvas).

Parameters:
mode - the new GraphicsMode for this presenter
 o getGraphicsMode
 public GraphicsMode getGraphicsMode()
This gets the current GraphicsMode for the compositor.

Returns:
a GraphicsMode
 o toString
 public String toString()
Returns a String representation of this object.

Returns:
a String
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index