quicktime.app.image
Class ImagePresenter

java.lang.Object
  |
  +--quicktime.app.image.ImagePresenter
All Implemented Interfaces:
Compositable, Drawable, ImageSettable, ImageSpec, Listener, QTDrawable, Transformable
Direct Known Subclasses:
MoviePresenter, QTEffectPresenter

Deprecated. since QTJava 6.1

public class ImagePresenter
extends java.lang.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 Summary
ImagePresenter(QDRect initialSize)
          Deprecated. since QTJava 6.1
 
Method Summary
 void addedTo(java.lang.Object interest)
          Deprecated. since QTJava 6.1
protected  void doDraw()
          Deprecated. since QTJava 6.1
static ImagePresenter fromFile(QTFile qtFile)
          Deprecated. since QTJava 6.1
static ImagePresenter fromGraphicsImporter(GraphicsImporter importer)
          Deprecated. since QTJava 6.1
static ImagePresenter fromGraphicsImporterDrawer(GraphicsImporterDrawer imageFile)
          Deprecated. since QTJava 6.1
static ImagePresenter fromGWorld(QDGraphics grafPort)
          Deprecated. since QTJava 6.1
static ImagePresenter fromGWorld(QDGraphics port, QDRect rect, int colorDepth, int quality, int codecType, CodecComponent codec)
          Deprecated. since QTJava 6.1
static ImagePresenter fromImageSequence(ImageDataSequence image, int nth)
          Deprecated. since QTJava 6.1
static ImagePresenter fromImageSpec(ImageSpec image)
          Deprecated. since QTJava 6.1
static ImagePresenter fromPict(Pict p)
          Deprecated. since QTJava 6.1
static ImagePresenter fromQTImage(EncodedImage data, ImageDescription desc)
          Deprecated. since QTJava 6.1
 Region getClip()
          Deprecated. since QTJava 6.1
 ImageDescription getDescription()
          Deprecated. since QTJava 6.1
 QDRect getDisplayBounds()
          Deprecated. since QTJava 6.1
 DSequence getDSequence()
          Deprecated. since QTJava 6.1
 GraphicsMode getGraphicsMode()
          Deprecated. since QTJava 6.1
 QDGraphics getGWorld()
          Deprecated. since QTJava 6.1
 EncodedImage getImage()
          Deprecated. since QTJava 6.1
 java.awt.Dimension getInitialSize()
          Deprecated. since QTJava 4.0
 Matrix getMatrix()
          Deprecated. since QTJava 6.1
 QDDimension getOriginalSize()
          Deprecated. since QTJava 6.1
 boolean isRedrawOptimised()
          Deprecated. since QTJava 6.1
 void redraw(Region invalidRgn)
          Deprecated. since QTJava 6.1
 void removedFrom(java.lang.Object interest)
          Deprecated. since QTJava 6.1
 void removeImageData()
          Deprecated. since QTJava 6.1
 void setClip(Region reg)
          Deprecated. since QTJava 6.1
 void setDisplayBounds(QDRect bounds)
          Deprecated. since QTJava 6.1
 void setGraphicsMode(GraphicsMode mode)
          Deprecated. since QTJava 6.1
 void setGWorld(QDGraphics cgp)
          Deprecated. since QTJava 6.1
 void setImageData(EncodedImage ei)
          Deprecated. since QTJava 6.1
 void setImageData(EncodedImage data, ImageDescription desc)
          Deprecated. since QTJava 6.1
 void setLocation(int x, int y)
          Deprecated. since QTJava 6.1
 void setMatrix(Matrix matrix)
          Deprecated. since QTJava 6.1
 void setRedrawOptimised(boolean flag)
          Deprecated. since QTJava 6.1
 java.lang.String toString()
          Deprecated. since QTJava 6.1
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImagePresenter

public ImagePresenter(QDRect initialSize)
Deprecated. since QTJava 6.1

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

Method Detail

fromFile

public static ImagePresenter fromFile(QTFile qtFile)
                               throws java.io.IOException,
                                      QTException
Deprecated. since QTJava 6.1

This creates an ImagePresenter object from a file.

Parameters:
qtFile - the QTFile.
java.io.IOException
QTException

fromGraphicsImporter

public static ImagePresenter fromGraphicsImporter(GraphicsImporter importer)
                                           throws java.io.IOException,
                                                  QTException
Deprecated. since QTJava 6.1

This creates an ImagePresenter object from a GraphicsImporter.

Parameters:
importer - the GraphicsImporter object.
java.io.IOException
QTException

fromGraphicsImporterDrawer

public static ImagePresenter fromGraphicsImporterDrawer(GraphicsImporterDrawer imageFile)
                                                 throws java.io.IOException,
                                                        QTException
Deprecated. since QTJava 6.1

This creates an ImagePresenter object from an GraphicsImporterDrawer object.

Parameters:
imageFile - the image file object
java.io.IOException
QTException

fromImageSpec

public static ImagePresenter fromImageSpec(ImageSpec image)
                                    throws QTException
Deprecated. since QTJava 6.1

This creates an ImagePresenter object from an ImageSpec object.

Parameters:
image - the image
QTException

fromImageSequence

public static ImagePresenter fromImageSequence(ImageDataSequence image,
                                               int nth)
                                        throws QTException
Deprecated. since QTJava 6.1

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
QTException

fromGWorld

public static ImagePresenter fromGWorld(QDGraphics grafPort)
                                 throws QTException
Deprecated. since QTJava 6.1

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.
QTException

fromGWorld

public static ImagePresenter fromGWorld(QDGraphics port,
                                        QDRect rect,
                                        int colorDepth,
                                        int quality,
                                        int codecType,
                                        CodecComponent codec)
                                 throws QTException
Deprecated. since QTJava 6.1

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.
QTException

fromPict

public static ImagePresenter fromPict(Pict p)
                               throws QTException
Deprecated. since QTJava 6.1

This creates an ImagePresenter object from a Pict object that is stored in memory.

Parameters:
p - the pict handle
QTException

fromQTImage

public static ImagePresenter fromQTImage(EncodedImage data,
                                         ImageDescription desc)
                                  throws QTException
Deprecated. since QTJava 6.1

This creates an ImagePresenter object from raw image data and ImageDescription.

Parameters:
data - the image data.
desc - the ImageDescription object.
QTException

setImageData

public void setImageData(EncodedImage data,
                         ImageDescription desc)
                  throws QTException
Deprecated. since QTJava 6.1

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.

Specified by:
setImageData in interface ImageSettable
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.
QTException

setImageData

public void setImageData(EncodedImage ei)
                  throws QTException
Deprecated. since QTJava 6.1

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
QTException

setRedrawOptimised

public void setRedrawOptimised(boolean flag)
Deprecated. since QTJava 6.1

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.

isRedrawOptimised

public boolean isRedrawOptimised()
Deprecated. since QTJava 6.1

Returns the current state of the optimisation for drawing flag.

Returns:
a boolean

removeImageData

public void removeImageData()
                     throws QTException
Deprecated. since QTJava 6.1

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.

QTException

getDescription

public ImageDescription getDescription()
Deprecated. since QTJava 6.1

This method should return an ImageDescription that describes the image data that the class contains.

Specified by:
getDescription in interface ImageSpec
Returns:
the ImageDescription of an Image

getDSequence

public DSequence getDSequence()
Deprecated. since QTJava 6.1

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.


getClip

public Region getClip()
               throws QTException
Deprecated. since QTJava 6.1

Returns a region that defines the current clipping region for the object.

Specified by:
getClip in interface QTDrawable
Returns:
the clipping region
QTException

setClip

public void setClip(Region reg)
             throws StdQTException
Deprecated. since QTJava 6.1

Sets a region that will define the clipping region for the object

Specified by:
setClip in interface QTDrawable
Parameters:
reg - the new clipping region
StdQTException

addedTo

public void addedTo(java.lang.Object interest)
Deprecated. since QTJava 6.1

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.

Specified by:
addedTo in interface Listener
Parameters:
interest - the object that is to be the source of interest for the the object that implements this interface.

removedFrom

public void removedFrom(java.lang.Object interest)
Deprecated. since QTJava 6.1

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.

Specified by:
removedFrom in interface Listener
Parameters:
interest - the object that was the source of interest for the the object that implements this interface.

getMatrix

public Matrix getMatrix()
                 throws StdQTException
Deprecated. since QTJava 6.1

This will return the client's current display transformations

Specified by:
getMatrix in interface Transformable
Returns:
the display transformations of the client
StdQTException

setMatrix

public void setMatrix(Matrix matrix)
               throws QTException
Deprecated. since QTJava 6.1

This method assigns a mapping matrix to the sequence.

QuickTime::SetDSequenceMatrix

Specified by:
setMatrix in interface Transformable
Parameters:
matrix - a Matrix object that specifies how to transform the image during decompression
QTException

getInitialSize

public java.awt.Dimension getInitialSize()
                                  throws QTException
Deprecated. since QTJava 4.0

This method returns the original size before the transformations specified in the returned matrix are applied.

QTException
See Also:
()

getOriginalSize

public QDDimension getOriginalSize()
                            throws QTException
Deprecated. since QTJava 6.1

This method returns the original size before the transformations specified in the returned matrix are applied.

Specified by:
getOriginalSize in interface Transformable
Returns:
the original size of the image data presented.
QTException

getImage

public EncodedImage getImage()
Deprecated. since QTJava 6.1

This method returns the actual image data.

Specified by:
getImage in interface ImageSpec
Returns:
the image data

getGWorld

public QDGraphics getGWorld()
Deprecated. since QTJava 6.1

QTCanvas calls this method to get the destination QDGraphics of its client.

Specified by:
getGWorld in interface QTDrawable
Returns:
a QDGraphics object or null

setGWorld

public void setGWorld(QDGraphics cgp)
               throws QTException
Deprecated. since QTJava 6.1

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.

Specified by:
setGWorld in interface QTDrawable
Parameters:
cgp - a QDGraphics object
QTException

setDisplayBounds

public void setDisplayBounds(QDRect bounds)
                      throws StdQTException
Deprecated. since QTJava 6.1

QTCanvas calls this method when it needs to tell the client to adjust its location, width and/or height. All values are in pixels.

Specified by:
setDisplayBounds in interface Drawable
Parameters:
bounds - the new size and location.
StdQTException

setLocation

public void setLocation(int x,
                        int y)
                 throws QTException
Deprecated. since QTJava 6.1

A convenience method to set the position of a QTDrawable object.

Specified by:
setLocation in interface QTDrawable
Parameters:
x - the new x location
y - the new y location
QTException

getDisplayBounds

public QDRect getDisplayBounds()
Deprecated. since QTJava 6.1

QTCanvas calls this method when it needs to ask the client for its boundary. All values are in pixels.

Specified by:
getDisplayBounds in interface Drawable
Returns:
the boundary of the client

redraw

public void redraw(Region invalidRgn)
            throws QTException
Deprecated. since QTJava 6.1

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.

Specified by:
redraw in interface Drawable
Parameters:
invalidRgn - the invalidRgn that the client should redraw
QTException

doDraw

protected final void doDraw()
                     throws QTException
Deprecated. since QTJava 6.1

This is the method that blits the data directly to the destination QDGraphics.

QTException

setGraphicsMode

public void setGraphicsMode(GraphicsMode mode)
                     throws QTException
Deprecated. since QTJava 6.1

This sets the GraphicsMode for the Compositor when it draws its composited contents to its destination QDGraphics (typically the QTCanvas).

Specified by:
setGraphicsMode in interface Compositable
Parameters:
mode - the new GraphicsMode for this presenter
QTException

getGraphicsMode

public GraphicsMode getGraphicsMode()
Deprecated. since QTJava 6.1

This gets the current GraphicsMode for the compositor.

Specified by:
getGraphicsMode in interface Compositable
Returns:
a GraphicsMode

toString

public java.lang.String toString()
Deprecated. since QTJava 6.1

Returns a String representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
a String