quicktime.std.image
Class QTImage

java.lang.Object
  |
  +--quicktime.std.image.QTImage
All Implemented Interfaces:
quicktime.jdirect.InterfaceLib, quicktime.jdirect.PrimitivesLib, quicktime.jdirect.QuickTimeLib, quicktime.jdirect.SharedLibrary, com.apple.jdirect.SharedLibrary

public class QTImage
extends java.lang.Object
implements quicktime.jdirect.QuickTimeLib

The QTImage class provides static methods and constants for compressing and decompressing QuickTime images.

Instance of this class can be used to associate an ImageDescription with the encoded Image data that the description describes.


Fields inherited from interface quicktime.jdirect.QuickTimeLib
JDirect_MacOSX, libraryInstance, name
 
Constructor Summary
QTImage(ImageDescription id, EncodedImage im)
          Associate an image description with the image data that is described by the description.
 
Method Summary
static ImageDescription compress(QDGraphics src, QDRect srcRect, int quality, int cType, EncodedImage data)
          Compresses a single frame image that is currently stored as a pixel map.
static ImageDescription convert(ImageDescription srcDD, EncodedImage srcData, int colorDepth, ColorTable clut, int accuracy, int quality, int cType, CodecComponent codec, EncodedImage dstData)
          Converts the format of a compressed image.
static void decompress(EncodedImage data, ImageDescription desc, QDGraphics dst, QDRect dstRect, int mode)
          Decompresses a single frame image into a pixel map structure.
static void decompress(EncodedImage data, ImageDescription desc, QDGraphics dst, QDRect srcRect, QDRect dstRect, int mode, Region mask)
          Decompresses a single frame image into a pixel map structure.
static ImageDescription fCompress(QDGraphics src, QDRect srcRect, int colorDepth, int quality, int cType, CodecComponent c, ColorTable clut, int flags, EncodedImage data)
          Compresses a single frame image that is currently stored as a pixel map.
static void fDecompress(EncodedImage data, ImageDescription desc, QDGraphics dst, QDRect srcRect, Matrix matrix, int mode, Region mask, PixMap matte, QDRect matteRect, int accuracy, CodecComponent codec)
          Decompresses a single frame image into a pixel map structure.
static int getCompressedSize(ImageDescription desc, EncodedImage data)
          Determines the size in bytes of a compressed image.
static int getCompressionTime(QDGraphics src, QDRect srcRect, int colorDepth, int cType, CodecComponent c, int spatialQuality, int temporalQuality)
          Determines the estimated amount of time required to compress a given image.
 ImageDescription getDescription()
          Return the description that describes the associated data.
 EncodedImage getImage()
          Return the image data
static int getMaxCompressionSize(QDGraphics src, QDRect srcRect, int colorDepth, int quality, int cType, CodecComponent c)
          Determines the maximum size an image will be after compression.
static float getSimilarity(QDGraphics src, QDRect srcRect, ImageDescription desc, EncodedImage data)
          Compares a compressed image to a picture stored in a pixel map and returns a value indicating the relative similarity of the two images.
static void trim(ImageDescription desc, EncodedImage inData, EncodedImage outData, QDRect trimRect)
          Ajusts a compressed image to the boundaries defined by a QDRect specified by your application.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QTImage

public QTImage(ImageDescription id,
               EncodedImage im)
Associate an image description with the image data that is described by the description.
Parameters:
id - the image description
im - the image data
Method Detail

getImage

public EncodedImage getImage()
Return the image data

getDescription

public ImageDescription getDescription()
Return the description that describes the associated data.

compress

public static final ImageDescription compress(QDGraphics src,
                                              QDRect srcRect,
                                              int quality,
                                              int cType,
                                              EncodedImage data)
                                       throws QTException
Compresses a single frame image that is currently stored as a pixel map. The size of the compressed image can be obtained from the ImageDescription object which is returned.

QuickTime::CompressImage

Parameters:
src - the QDGraphics that contains the PixMap for compressing. This may NOT be null.
srcRect - a Rect defining the portion of the image to compress
quality - the desired compressed image quality
cType - a compressor type
data - a encoded image object to receive the compressed image data. It is your program's responsibility to make sure that this object can receive at least as much data as indicated by the getMaxCompressionSize method.
Returns:
an ImageDescription object. Your application should store this image description with the compressed image data.

fCompress

public static final ImageDescription fCompress(QDGraphics src,
                                               QDRect srcRect,
                                               int colorDepth,
                                               int quality,
                                               int cType,
                                               CodecComponent c,
                                               ColorTable clut,
                                               int flags,
                                               EncodedImage data)
                                        throws QTException
Compresses a single frame image that is currently stored as a pixel map. The size of the compressed image can be obtained from the ImageDescription object which is returned.

QuickTime::FCompressImage

Parameters:
src - a QDGraphics that contains the PixMap for compressing. This may NOT be null.
srcRect - a QDRect defining the portion of the image to compress
colorDepth - the depth at which the image is likely to be viewed
quality - the desired compressed image quality
cType - a compressor type
c - a compressor or codec identifier
clut - a custom color lookup table
flags - flags providing further control information
data - a EncodedImage object to receive the compressed image data. It is your program's responsibility to make sure that this object can receive at least as much data as indicated by the getMaxCompressionSize method.
Returns:
an ImageDescription object. Your application should store this image description with the compressed image data.

convert

public static final ImageDescription convert(ImageDescription srcDD,
                                             EncodedImage srcData,
                                             int colorDepth,
                                             ColorTable clut,
                                             int accuracy,
                                             int quality,
                                             int cType,
                                             CodecComponent codec,
                                             EncodedImage dstData)
                                      throws QTException
Converts the format of a compressed image.

QuickTime::ConvertImage

Parameters:
srcDD - the image description structure that describes the compressed image
srcData - the encoded image data to convert
colorDepth - the depth at which the recompressed image is likely to be viewed
clut - a custom color look up table
accuracy - the accuracy for the decompressed image
quality - the desired compressed image quality
cType - the compressor type
codec - a CodecComponent
destData - a EncodedImage object to receive the converted image data. It is your program's responsibility to make sure that this object can receive at least as much data as indicated by the getMaxCompressionSize method.
Returns:
an ImageDescription object defining the converted image data. Your application should store this image description with the converted image data.

trim

public static final void trim(ImageDescription desc,
                              EncodedImage inData,
                              EncodedImage outData,
                              QDRect trimRect)
                       throws StdQTException
Ajusts a compressed image to the boundaries defined by a QDRect specified by your application.

QuickTime::TrimImage

Parameters:
desc - an ImageDescription object that describes the compressed image. On return from this method, the compressor updates this image description to refer to the resized image.
inData - the encoded image data
outData - a encoded image object to receive the trimmed image. Your application should create this object at least as large as the source image.
trimRect - defines the desired dimensions of the trimmed image

decompress

public static final void decompress(EncodedImage data,
                                    ImageDescription desc,
                                    QDGraphics dst,
                                    QDRect dstRect,
                                    int mode)
                             throws StdQTException,
                                    QDException
Decompresses a single frame image into a pixel map structure.

QuickTime::DecompressImage

Parameters:
data - a EncodedImage object that contains the compressed image data
desc - an ImageDescription object that defines the compressed image
dst - a QDGraphics that contains the PixMap where the decompressed image is to be displayed. This may NOT be null.
dstRect - a QDRect into which the decompressed image is to be loaded
mode - the transfer mode for the operation

decompress

public static final void decompress(EncodedImage data,
                                    ImageDescription desc,
                                    QDGraphics dst,
                                    QDRect srcRect,
                                    QDRect dstRect,
                                    int mode,
                                    Region mask)
                             throws StdQTException,
                                    QDException
Decompresses a single frame image into a pixel map structure.

QuickTime::DecompressImage

Parameters:
data - a EncodedImage object that contains the compressed image data
desc - an ImageDescription object that defines the compressed image
dst - a QDGraphics that contains the PixMap where the decompressed image is to be displayed. This may NOT be null.
srcRect - a QDRect defining the portion of the image to decompress
dstRect - a QDRect into which the decompressed image is to be loaded
mode - the transfer mode for the operation
mask - a clipping region in the destination coordinate system

fDecompress

public static final void fDecompress(EncodedImage data,
                                     ImageDescription desc,
                                     QDGraphics dst,
                                     QDRect srcRect,
                                     Matrix matrix,
                                     int mode,
                                     Region mask,
                                     PixMap matte,
                                     QDRect matteRect,
                                     int accuracy,
                                     CodecComponent codec)
                              throws StdQTException,
                                     QDException
Decompresses a single frame image into a pixel map structure.

QuickTime::FDecompressImage

Parameters:
data - a EncodedImage object that contains the compressed image data
desc - an ImageDescription object that defines the compressed image
dst - a QDGraphics that contains the PixMap where the decompressed image is to be displayed. This may NOT be null.
srcRect - a QDRect defining the portion of the image to decompress
matrix - a Matrix specifies how to transform the image during decompression
mode - the transfer mode for the operation
mask - a Region in the destination coordinate system
matte - a PixMap that contains a blend matte
matteRect - a QDRect defining a portion of the blend matte to apply
accuracy - the accuracy desired in the decompressed image
codec - a codec component

getMaxCompressionSize

public static final int getMaxCompressionSize(QDGraphics src,
                                              QDRect srcRect,
                                              int colorDepth,
                                              int quality,
                                              int cType,
                                              CodecComponent c)
                                       throws StdQTException,
                                              QDException
Determines the maximum size an image will be after compression. The size returned is in the number of bytes that the encoded image will require.

see QuickTime::GetMaxCompressionSize

Parameters:
src - is a QDGraphics that contains the PixMap to be compressed. This may NOT be null.
srcRect - points to the QDRect defining the portion of the source image that is to be compressed
colorDepth - the depth at which the image is to be compressed
quality - the desired compressed image quality
cType - a compressor type
c - a compressor component
Returns:
size of the compressed pixmap

getCompressedSize

public static final int getCompressedSize(ImageDescription desc,
                                          EncodedImage data)
                                   throws StdQTException
Determines the size in bytes of a compressed image.

QuickTime::GetCompressedImageSize

Parameters:
desc - an ImageDescription object that defines the compressed image
data - a EncodedImage object that contains the compressed image data
Returns:
the size of the compressed image in bytes

getCompressionTime

public static final int getCompressionTime(QDGraphics src,
                                           QDRect srcRect,
                                           int colorDepth,
                                           int cType,
                                           CodecComponent c,
                                           int spatialQuality,
                                           int temporalQuality)
                                    throws StdQTException,
                                           QDException
Determines the estimated amount of time required to compress a given image.

see QuickTime::GetCompressionTime

Parameters:
src - a QDGraphics that contains a PixMap object that will be compressed. This may be null.
srcRect - a QDRect defining the portion of the source image that is to be compressed
colorDepth - the depth at which the image is to be compressed
cType - a compressor type
c - the compressor component
spatialQuality - the desired compressed image spatial quality
temporalQuality - the desired compressed image temporal quality
Returns:
the compression time in milliseconds

getSimilarity

public static final float getSimilarity(QDGraphics src,
                                        QDRect srcRect,
                                        ImageDescription desc,
                                        EncodedImage data)
                                 throws StdQTException,
                                        QDException
Compares a compressed image to a picture stored in a pixel map and returns a value indicating the relative similarity of the two images.

QuickTime::GetSimilarity

Parameters:
src - a QDGraphics that contains a PixMap object containing a noncompressed image.
srcRect - a QDRect defining the portion of the source image to compare to the compressed image
desc - an ImageDescription object that defines the compressed image
data - an EncodedImage object that contains the compressed image data
Returns:
the relative similarity value