|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--quicktime.app.image.ImagePresenter
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)
Creates an emtpy ImagePresenter object - you will need to set the image data and description before this object is usable. |
Method Summary | |
void |
addedTo(java.lang.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. |
protected void |
doDraw()
This is the method that blits the data directly to the destination QDGraphics. |
static ImagePresenter |
fromFile(QTFile qtFile)
This creates an ImagePresenter object from a file. |
static ImagePresenter |
fromGraphicsImporter(GraphicsImporter importer)
This creates an ImagePresenter object from a GraphicsImporter. |
static ImagePresenter |
fromGraphicsImporterDrawer(GraphicsImporterDrawer imageFile)
This creates an ImagePresenter object from an GraphicsImporterDrawer object. |
static ImagePresenter |
fromGWorld(QDGraphics grafPort)
This creates an ImagePresenter object from the PixMap of the QDGraphics object. |
static ImagePresenter |
fromGWorld(QDGraphics port,
QDRect rect,
int colorDepth,
int quality,
int codecType,
CodecComponent codec)
This creates an ImagePresenter object from PixMap source, bounds QDRect, color depth, compression quality, codec type, and codec component. |
static ImagePresenter |
fromImageSequence(ImageDataSequence image,
int nth)
This creates an ImagePresenter object from nth first image of any ImageDataSequence object |
static ImagePresenter |
fromImageSpec(ImageSpec image)
This creates an ImagePresenter object from an ImageSpec object. |
static ImagePresenter |
fromPict(Pict p)
This creates an ImagePresenter object from a Pict object that is stored in memory. |
static ImagePresenter |
fromQTImage(EncodedImage data,
ImageDescription desc)
This creates an ImagePresenter object from raw image data and ImageDescription. |
Region |
getClip()
Returns a region that defines the current clipping region for the object. |
ImageDescription |
getDescription()
This method should return an ImageDescription that describes the image data that the class contains. |
QDRect |
getDisplayBounds()
QTCanvas calls this method when it needs to ask the client for its boundary. |
DSequence |
getDSequence()
Returns the DSequence that is used by the ImagePresenter. |
GraphicsMode |
getGraphicsMode()
This gets the current GraphicsMode for the compositor. |
QDGraphics |
getGWorld()
QTCanvas calls this method to get the destination QDGraphics of its client. |
EncodedImage |
getImage()
This method returns the actual image data. |
java.awt.Dimension |
getInitialSize()
Deprecated. since QTJava 4.0 |
Matrix |
getMatrix()
This will return the client's current display transformations |
QDDimension |
getOriginalSize()
This method returns the original size before the transformations specified in the returned matrix are applied. |
boolean |
isRedrawOptimised()
Returns the current state of the optimisation for drawing flag. |
void |
redraw(Region invalidRgn)
QTCanvas calls this method when the client should redraw itself. |
void |
removedFrom(java.lang.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. |
void |
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. |
void |
setClip(Region reg)
Sets a region that will define the clipping region for the object |
void |
setDisplayBounds(QDRect bounds)
QTCanvas calls this method when it needs to tell the client to adjust its location, width and/or height. |
void |
setGraphicsMode(GraphicsMode mode)
This sets the GraphicsMode for the Compositor when it draws its composited contents to its destination QDGraphics (typically the QTCanvas). |
void |
setGWorld(QDGraphics cgp)
QTCanvas calls this method to give the client the QDGraphics object it should use to do its drawing. |
void |
setImageData(EncodedImage ei)
If you have already set the image data and you have image data in the same general parameters as previously set (ie. |
void |
setImageData(EncodedImage data,
ImageDescription desc)
Sets the current image data and description. |
void |
setLocation(int x,
int y)
A convenience method to set the position of a QTDrawable object. |
void |
setMatrix(Matrix matrix)
This method assigns a mapping matrix to the sequence. |
void |
setRedrawOptimised(boolean flag)
Returns the state of the optimisation for redraw flag. |
java.lang.String |
toString()
Returns a String representation of this object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ImagePresenter(QDRect initialSize)
Method Detail |
public static ImagePresenter fromFile(QTFile qtFile) throws java.io.IOException, QTException
qtFile
- the QTFile.public static ImagePresenter fromGraphicsImporter(GraphicsImporter importer) throws java.io.IOException, QTException
importer
- the GraphicsImporter object.public static ImagePresenter fromGraphicsImporterDrawer(GraphicsImporterDrawer imageFile) throws java.io.IOException, QTException
imageFile
- the image file objectpublic static ImagePresenter fromImageSpec(ImageSpec image) throws QTException
image
- the imagenth
- the index into the ImageDataSequence object of the image data that should be usedpublic static ImagePresenter fromImageSequence(ImageDataSequence image, int nth) throws QTException
image
- the imagenth
- the index into the ImageDataSequence object of the image data that should be usedpublic static ImagePresenter fromGWorld(QDGraphics grafPort) throws QTException
grafPort
- the grafPort that will be used to create the ImagePresenter object from.public static ImagePresenter fromGWorld(QDGraphics port, QDRect rect, int colorDepth, int quality, int codecType, CodecComponent codec) throws QTException
port
- a QDGraphics object from which the PixMap will be used.rect
- the QDRect object - this may not be nullcolorDepth
- the int value.quality
- the int value.codecType
- the int value.codec
- the CodecComponent object.public static ImagePresenter fromPict(Pict p) throws QTException
p
- the pict handlepublic static ImagePresenter fromQTImage(EncodedImage data, ImageDescription desc) throws QTException
data
- the image data.desc
- the ImageDescription object.public void setImageData(EncodedImage data, ImageDescription desc) throws QTException
setImageData
in interface ImageSettable
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.public void setImageData(EncodedImage ei) throws QTException
ei
- the new encoded image datapublic void setRedrawOptimised(boolean flag)
flag
- the new setting.public boolean isRedrawOptimised()
public void removeImageData() throws QTException
public ImageDescription getDescription()
getDescription
in interface ImageSpec
public DSequence getDSequence()
public Region getClip() throws QTException
getClip
in interface QTDrawable
public void setClip(Region reg) throws StdQTException
setClip
in interface QTDrawable
reg
- the new clipping regionpublic void addedTo(java.lang.Object interest)
addedTo
in interface Listener
interest
- the object that is to be the source of interest for the
the object that implements this interface.public void removedFrom(java.lang.Object interest)
removedFrom
in interface Listener
interest
- the object that was the source of interest for the
the object that implements this interface.public Matrix getMatrix() throws StdQTException
getMatrix
in interface Transformable
public void setMatrix(Matrix matrix) throws QTException
setMatrix
in interface Transformable
matrix
- a Matrix object that specifies how to transform the image during
decompressionpublic java.awt.Dimension getInitialSize() throws QTException
()
public QDDimension getOriginalSize() throws QTException
getOriginalSize
in interface Transformable
public EncodedImage getImage()
getImage
in interface ImageSpec
public QDGraphics getGWorld()
getGWorld
in interface QTDrawable
public void setGWorld(QDGraphics cgp) throws QTException
setGWorld
in interface QTDrawable
cgp
- a QDGraphics objectpublic void setDisplayBounds(QDRect bounds) throws StdQTException
setDisplayBounds
in interface Drawable
bounds
- the new size and location.public void setLocation(int x, int y) throws QTException
setLocation
in interface QTDrawable
x
- the new x locationy
- the new y locationpublic QDRect getDisplayBounds()
getDisplayBounds
in interface Drawable
public void redraw(Region invalidRgn) throws QTException
redraw
in interface Drawable
invalidRgn
- the invalidRgn that the client should redrawprotected final void doDraw() throws QTException
public void setGraphicsMode(GraphicsMode mode) throws QTException
setGraphicsMode
in interface Compositable
mode
- the new GraphicsMode for this presenterpublic GraphicsMode getGraphicsMode()
getGraphicsMode
in interface Compositable
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |