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.
-
ImagePresenter(QDRect)
- Creates an emtpy ImagePresenter object - you will need to set the image data and description
before this object is usable.
-
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.
-
doDraw()
- This is the method that blits the data directly to the destination QDGraphics.
-
fromFile(QTFile)
- This creates an ImagePresenter object from a file.
-
fromGraphicsImporter(GraphicsImporter)
- This creates an ImagePresenter object from a GraphicsImporter.
-
fromGraphicsImporterDrawer(GraphicsImporterDrawer)
- This creates an ImagePresenter object from an GraphicsImporterDrawer object.
-
fromGWorld(QDGraphics)
- This creates an ImagePresenter object from the PixMap of the QDGraphics object.
-
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.
-
fromImageSequence(ImageDataSequence, int)
- This creates an ImagePresenter object from nth first image of any ImageDataSequence object
-
fromImageSpec(ImageSpec)
- This creates an ImagePresenter object from an ImageSpec object.
-
fromPict(Pict)
- This creates an ImagePresenter object from a Pict object that is stored in memory.
-
fromQTImage(EncodedImage, ImageDescription)
- This creates an ImagePresenter object from raw image data and ImageDescription.
-
getClip()
- Returns a region that defines the current clipping region for the object.
-
getDescription()
- This method should return an ImageDescription that describes
the image data that the class contains.
-
getDisplayBounds()
- QTCanvas calls this method when it needs to ask the client for its boundary.
-
getDSequence()
- Returns the DSequence that is used by the ImagePresenter.
-
getGraphicsMode()
- This gets the current GraphicsMode for the compositor.
-
getGWorld()
- QTCanvas calls this method to get the destination QDGraphics of its client.
-
getImage()
- This method returns the actual image data.
-
getInitialSize()
- This method returns the original size before the transformations
specified in the returned matrix are applied.
-
getMatrix()
- This will return the client's current display transformations
-
isRedrawOptimised()
- Returns the current state of the optimisation for drawing flag.
-
redraw(Region)
- QTCanvas calls this method when the client should redraw itself.
-
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.
-
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.
-
setClip(Region)
- Sets a region that will define the clipping region for the object
-
setDisplayBounds(QDRect)
- QTCanvas calls this method when it needs to tell the client to adjust its
location, width and/or height.
-
setGraphicsMode(GraphicsMode)
- This sets the GraphicsMode for the Compositor when it draws its composited
contents to its destination QDGraphics (typically the QTCanvas).
-
setGWorld(QDGraphics)
- QTCanvas calls this method to give the client the QDGraphics object it should
use to do its drawing.
-
setImageData(EncodedImage)
- If you have already set the image data and you have image data in the same
general parameters as previously set (ie.
-
setImageData(EncodedImage, ImageDescription)
- Sets the current image data and description.
-
setLocation(int, int)
- A convenience method to set the position of a QTDrawable object.
-
setMatrix(Matrix)
- This method assigns a mapping matrix to the sequence.
-
setRedrawOptimised(boolean)
- Returns the state of the optimisation for redraw flag.
-
toString()
- Returns a String representation of this object.
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.
fromFile
public static ImagePresenter fromFile(QTFile qtFile) throws IOException, QTException
- This creates an ImagePresenter object from a file.
- Parameters:
- qtFile - the QTFile.
fromGraphicsImporter
public static ImagePresenter fromGraphicsImporter(GraphicsImporter importer) throws IOException, QTException
- This creates an ImagePresenter object from a GraphicsImporter.
- Parameters:
- importer - the GraphicsImporter object.
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
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
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
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.
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.
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
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.
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.
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
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.
isRedrawOptimised
public boolean isRedrawOptimised()
- Returns the current state of the optimisation for drawing flag.
- Returns:
- a boolean
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.
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
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.
getClip
public Region getClip() throws QTException
- Returns a region that defines the current clipping region for the object.
- Returns:
- the clipping region
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
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.
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.
getMatrix
public Matrix getMatrix() throws StdQTException
- This will return the client's current display transformations
- Returns:
- the display transformations of the client
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
getInitialSize
public Dimension getInitialSize() throws QTException
- This method returns the original size before the transformations
specified in the returned matrix are applied.
getImage
public EncodedImage getImage()
- This method returns the actual image data.
- Returns:
- the image data
getGWorld
public QDGraphics getGWorld()
- QTCanvas calls this method to get the destination QDGraphics of its client.
- Returns:
- a QDGraphics object or null
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
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.
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
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
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
doDraw
protected final void doDraw() throws QTException
- This is the method that blits the data directly to the destination QDGraphics.
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
getGraphicsMode
public GraphicsMode getGraphicsMode()
- This gets the current GraphicsMode for the compositor.
- Returns:
- a GraphicsMode
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