quicktime.qd
Class Pict

java.lang.Object
  |
  +--quicktime.QTObject
        |
        +--quicktime.util.QTHandleRef
              |
              +--quicktime.qd.Pict
All Implemented Interfaces:
java.lang.Cloneable, quicktime.jdirect.InterfaceLib, quicktime.jdirect.PrimitivesLib, quicktime.jdirect.QTStreamingLib, quicktime.jdirect.QuickTimeLib, quicktime.jdirect.SharedLibrary, com.apple.jdirect.SharedLibrary

public final class Pict
extends QTHandleRef
implements quicktime.jdirect.QuickTimeLib, java.lang.Cloneable, quicktime.jdirect.QTStreamingLib

The Pict class represents sequences of drawing commands, while providing a common medium for sharing image data. Methods are implemented for a corresponding QuickDraw structure used by QuickTime. refer to Pictures in QuickDraw


Fields inherited from interface quicktime.jdirect.QuickTimeLib
JDirect_MacOSX, libraryInstance, name
 
Fields inherited from interface quicktime.jdirect.QTStreamingLib
JDirect_MacOSX, libraryInstance
 
Constructor Summary
Pict(byte[] pictBytes)
          Create a Pict object from an array of bytes.
 
Method Summary
 void close()
          Completes the collection of drawing commands and picture comments that define your picture.
 Pict compress(int quality, int cType)
          This allows your application to compress a single-frame image stored as a picture.
 void draw(QDGraphics cg, QDRect frameRect)
          To draw a picture on any type of output device.
 void drawTrimmed(QDGraphics cg, QDRect frameRect, Region trimMask, int doDither)
          Allows the drawing of an image that is stored as a picture.
 Pict fCompress(int colorDepth, int quality, int doDither, int compressAgain, int cType, int codec)
          This allows your application to compress a single-frame image with more variance that stored as a picture.
static Pict fromFile(java.io.File file)
          Opens a PICT that is stored in the file.
static Pict fromGraphicsExporter(GraphicsExporter ge)
          Creates a new Pict containing the image currently in use by this import component.
static Pict fromGraphicsImporter(GraphicsImporter gi)
          Creates a new Pict containing the image currently in use by this import component.
static Pict fromImageCompressionDialog(ImageCompressionDialog icd, Pict src)
          Compresses a Pict returning a new Pict.
static Pict fromMovie(Movie m)
          This method creates a picture that contains a movie's poster.
static Pict fromMovie(Movie m, int time)
          This method creates a picture from the specified movie at the specified time.
static Pict fromPresentation(Presentation p, Stream s)
          This method creates a picture that contains a representation of the presentation returns a PicHandle object for the image.
static Pict fromSequenceGrabber(SequenceGrabber sg, QDRect bounds, int offscreenDepth, int grabPictFlags)
          Provides a simple interface to obtain a QuickDraw picture from a sequence grabber component.
static Pict fromTrack(Track t, int time)
          This method creates a QuickDraw picture from the specified track at the specified time.
 QDRect getPictFrame()
          Returns the picture frame rectangle referenced of the Pict.
 boolean isOpen()
          Returns true if the pict is open for recording drawing operations.
 Pict makeThumbnail(int colorDepth)
          This allows your application to create an 80-by-80 pixel thumbnail picture from a specified picture.
static Pict open(QDGraphics port, OpenCPicParams params)
          Use OpenCPicture to begin defining a picture, collecting all of your subsequent drawing commands in this record.
static Pict thumbnailFromQDGraphics(QDGraphics qd, QDRect src, int colorDepth)
          Creates an 80-by-80 pixel thumbnail picture from the pixmap associated with this QDGraphics.
 RawEncodedImage toEncodedImage()
          Returns a version of the Pict as an EncodedImage object.
 java.lang.String toString()
          Print information about this object.
 void writeToFile(java.io.File file)
          Write out the Pict to the specified file.
 
Methods inherited from class quicktime.util.QTHandleRef
copyFromArray, copyFromArray, copyFromArray, copyFromArray, copyFromArray, copyFromArray, copyFromArray, copyToArray, copyToArray, copyToArray, copyToArray, copyToArray, copyToArray, copyToArray, fromCompressionDialogState, fromSCSequence, getBytes, getSize, inMemory, isLocked, lock, lockHigh, moveHigh, toQTPointer, toQTPointer, unlock
 
Methods inherited from class quicktime.QTObject
disposeQTObject, equals, ID
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pict

public Pict(byte[] pictBytes)
     throws QTException
Create a Pict object from an array of bytes. This is expected to be in the format of a Pict Handle - ie. if you are reading this in from a Pict file you must drop the first 512 bytes from the file.
Parameters:
pictBytes - the bytes of the pict handle
Method Detail

thumbnailFromQDGraphics

public static Pict thumbnailFromQDGraphics(QDGraphics qd,
                                           QDRect src,
                                           int colorDepth)
                                    throws QTException
Creates an 80-by-80 pixel thumbnail picture from the pixmap associated with this QDGraphics.

QuickTime::MakeThumbnailFromPixMap()

Parameters:
qd - the QDGraphics from which to make the thumbnail
src - a QDRect object defining the portion of the image to use for the thumbnail
colorDepth - specifies the depth at which the image is likely to be viewed
Returns:
a Pict object representing the thumbnail

fromTrack

public static Pict fromTrack(Track t,
                             int time)
                      throws QTException
This method creates a QuickDraw picture from the specified track at the specified time.

QuickTime::GetTrackPict()

Parameters:
t - the track object
time - Specifies the track image for the picture. The time parameter contains the time from which the image is taken.
Returns:
a Pict object for the specified time.
See Also:
Track.getPict(int)

fromMovie

public static Pict fromMovie(Movie m,
                             int time)
                      throws QTException
This method creates a picture from the specified movie at the specified time. This function uses only those movie tracks that are currently enabled and would therefore be used in playback. Your application may call this function even if the movie is inactive.

QuickTime::GetMoviePict()

Parameters:
time - contains the time from which the image is taken.
m - the Movie object
Returns:
a Pict object
See Also:
Movie.getPict(int)

fromMovie

public static Pict fromMovie(Movie m)
                      throws QTException
This method creates a picture that contains a movie's poster. returns a PicHandle object for the image.

QuickTime::GetMoviePosterPict()

Parameters:
m - the Movie object
Returns:
a Pict object
See Also:
Movie.getPosterPict()

fromPresentation

public static Pict fromPresentation(Presentation p,
                                    Stream s)
                             throws QTException
This method creates a picture that contains a representation of the presentation returns a PicHandle object for the image.
Parameters:
p - the Presentation object
s - the stream object
Returns:
a Pict object
See Also:
Presentation.getPicture(quicktime.streaming.Stream)

fromSequenceGrabber

public static Pict fromSequenceGrabber(SequenceGrabber sg,
                                       QDRect bounds,
                                       int offscreenDepth,
                                       int grabPictFlags)
                                throws QTException
Provides a simple interface to obtain a QuickDraw picture from a sequence grabber component. The sequence grabber can display the picture directly, or it can write the picture to an offscreen buffer. This function is limited in scope, however, and does not allow you to control all of the parameters that govern the operation. When you call this function, the sequence grabber component obtains and configures appropriate sequence grabber channel components (if necessary), grabs the data, and then releases any components it obtained.

QuickTime::SGGrabPict

Parameters:
bounds - The bounding rectangle.
offscreenDepth - The bit depth of the Pict.
grabPictFlags - The flags for the operation.
Returns:
The Pict.
See Also:
SequenceGrabber.grabPict(quicktime.qd.QDRect, int, int)

fromGraphicsImporter

public static Pict fromGraphicsImporter(GraphicsImporter gi)
                                 throws QTException
Creates a new Pict containing the image currently in use by this import component.

QuickTime::GraphicsImportGetAsPicture

Returns:
a pict
See Also:
GraphicsImporter.getAsPicture()

fromGraphicsExporter

public static Pict fromGraphicsExporter(GraphicsExporter ge)
                                 throws QTException
Creates a new Pict containing the image currently in use by this import component.

QuickTime::GraphicsExportGetInputPicture

Returns:
a pict
See Also:
GraphicsExporter.getInputPicture()

fromImageCompressionDialog

public static Pict fromImageCompressionDialog(ImageCompressionDialog icd,
                                              Pict src)
                                       throws QTException
Compresses a Pict returning a new Pict.

QuickTime::SCCompressPicture()

Parameters:
src - the source Pict.
Returns:
a Pict
See Also:
ImageCompressionDialog.compressPicture(quicktime.qd.Pict)

fromFile

public static Pict fromFile(java.io.File file)
                     throws QTException,
                            java.io.IOException
Opens a PICT that is stored in the file. This method does no checking to ensure that the file is valid PICT file.
Parameters:
file - the PICT file
Returns:
a Pict

open

public static Pict open(QDGraphics port,
                        OpenCPicParams params)
                 throws QTException
Use OpenCPicture to begin defining a picture, collecting all of your subsequent drawing commands in this record. The returned Pict must be closed before any other methods can be applied to it.

QuickDraw::OpenCPicture

Parameters:
port - the port which the open picture will record operations from
params - the parameters for the new Pict
Returns:
a Pict

getPictFrame

public QDRect getPictFrame()
Returns the picture frame rectangle referenced of the Pict.

isOpen

public boolean isOpen()
Returns true if the pict is open for recording drawing operations.
Returns:
a boolean indicating open status

close

public void close()
           throws QDException
Completes the collection of drawing commands and picture comments that define your picture.

QuickDraw::ClosePicture()


compress

public Pict compress(int quality,
                     int cType)
              throws QTException
This allows your application to compress a single-frame image stored as a picture. Returns the result in a new picture.

QuickTime::CompressPicture()

Parameters:
quality - Specifies the desired compressed image quality
cType - Specifies the compressor type
Returns:
dstPicture The destination compressed image

fCompress

public Pict fCompress(int colorDepth,
                      int quality,
                      int doDither,
                      int compressAgain,
                      int cType,
                      int codec)
               throws QTException
This allows your application to compress a single-frame image with more variance that stored as a picture. Returns the result in a new picture.

QuickTime::FCompressPicture()

Parameters:
colorDepth - Specifies the depth at which the image is to be compressed // * @param clut Specifies the custom color lookup table. Uses source color table only.
quality - Specifies the desired compressed image quality
doDither - Specifies whether to dither or not
compressAgain - Indicates whether to recompress compressed image data in the picture
cType - Specifies the compressor type
codec - Specifies the compression indentifier
Returns:
dstPicture The destination compressed image

draw

public void draw(QDGraphics cg,
                 QDRect frameRect)
          throws QTException
To draw a picture on any type of output device.

QuickTime::DrawPicture()

Parameters:
cg - Specified graph port on which it will be drawn. This may NOT be null.
frameRect - Specified rectangle with the coordinates in which to draw the picture.

drawTrimmed

public void drawTrimmed(QDGraphics cg,
                        QDRect frameRect,
                        Region trimMask,
                        int doDither)
                 throws QTException
Allows the drawing of an image that is stored as a picture. Also, trims that image to fit the region you specify.

QuickTime::DrawTrimmedPicture()

Parameters:
cg - Specified graph port on which it will be drawn. This may NOT be null.
frameRect - Specifies the rectangle into which the decompressed image is to be loaded
trimMask - Specifies the destination clipping region
doDither - Specifies whether to dither or not

makeThumbnail

public Pict makeThumbnail(int colorDepth)
                   throws QTException
This allows your application to create an 80-by-80 pixel thumbnail picture from a specified picture.

QuickTime::MakeThumbnailFromPicture()

Parameters:
colorDepth - Specifies the desired depth at which the image is likely to be viewed
Returns:
The desired thumbnail picture

toEncodedImage

public RawEncodedImage toEncodedImage()
                               throws QDException
Returns a version of the Pict as an EncodedImage object. This references the same data as is held within the Pict, which is locked and must be kept locked for the duration of the lifetime of the EncodedImage.

writeToFile

public void writeToFile(java.io.File file)
                 throws QDException,
                        java.io.IOException
Write out the Pict to the specified file.
Parameters:
file - the destination file that the Pict will be written to.

toString

public java.lang.String toString()
Print information about this object.
Overrides:
toString in class QTHandleRef
Returns:
a string representation of this object