quicktime.qd
Class QDGraphics

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

public final class QDGraphics
extends QTPointerRef
implements quicktime.jdirect.QuickTimeLib, quicktime.jdirect.QTStreamingLib

A color graphics port defines a complete drawing environment that determines where and how color graphics operations take place.

To create an offscreen QDGraphics (in traditional QuickDraw parlance a GWorld) any one of the various constructors can be used. The QDGraphics from... calls will return the existing destination graphics of the first supplied object. For the fromNativeGraphics this will always be an on screen graphics (in traditional QuickDraw parlance a CGrafPort). For the other calls the type of the QDGraphics returned is dependant on the destination graphics of the object that the application has established.


Field Summary
static int kDefaultPixelFormat
          This is the default pixel format that is used to create offscreen graphics contexts when no format is used.
static int kNativeSize
          This is the size (the number of bytes) that are required for this class
static QDGraphics scratch
          This holds a reference to the scratchGWorld that you can use manually in calls such as Movie.setGWorld.
static QDGraphics validScratch
          This holds a reference to the scratchGWorld that you can use as a temporary destination graphics and still be considered as a valid destination graphics by QTDrawable objects.
 
Fields inherited from interface quicktime.jdirect.QuickTimeLib
JDirect_MacOSX, libraryInstance, name
 
Fields inherited from interface quicktime.jdirect.QTStreamingLib
JDirect_MacOSX, libraryInstance
 
Constructor Summary
QDGraphics(ImageCompressionDialog d, QDRect rp, int flags)
          Creates an offscreen QDGraphics based on the current compression settings.
QDGraphics(ImageDescription id, int flags)
          Creates an offscreen QDGraphics object from the width, height, depth, and color table of a specified image description structure.
QDGraphics(int pixelFormat, QDRect bounds)
          An offscreen graphics world in Color QuickDraw contains a GWorld - and its handles to associated PixMap and ColorTables - that describe an offscreen graphics port.
QDGraphics(int pixelFormat, QDRect bounds, ColorTable cTable, GDevice aGDevice, int flags)
          An offscreen graphics world in Color QuickDraw contains a GWorld - and its handles to associated PixMap and ColorTables - that describe an offscreen graphics port.
QDGraphics(int pixelFormat, QDRect bounds, int flags)
          An offscreen graphics world in Color QuickDraw contains a GWorld - and its handles to associated PixMap and ColorTables - that describe an offscreen graphics port.
QDGraphics(QDRect bounds)
          An offscreen graphics world in Color QuickDraw contains a GWorld - and its handles to associated PixMap and ColorTables - that describe an offscreen graphics port.
 
Method Summary
 void beginDraw(QDDrawer d)
          This method should be used when a number of drawing methods need to be invoked on this QDGraphics object.
 int charWidth(int character)
          The CharWidth function returns the width in pixels of the specified character in this QDGraphics port.
 void clipRect()
          To change the clipping region of this QDGraphics, use the ClipRect procedure.
 void clipRect(QDRect r)
          To change the clipping region of this QDGraphics, use the ClipRect procedure.
 void drawChar(int character)
          The DrawChar procedure draws the glyph for the specified character at the current pen location in this QDGraphics port.
 void drawText(java.lang.String text, int firstByte, int byteCount)
          The DrawText procedure draws the specified text at the current pen location in this QDGraphics port.
 void drawTextScaled(int count, java.lang.String text, float xScale, float yScale)
          The StdText procedure is a QuickDraw bottleneck routine that can be called directly to obtain scaled (or unscaled) text..
 void eraseArc(QDRect area, int startAngle, int arcAngle)
          EraseArc draws a wedge of the oval bounded by the rectangle that you specify in the area parameter with the background pattern for the current graphics port.
 void eraseOval(QDRect area)
          Using the background pattern for the current graphics port and the patCopy pattern mode, the EraseOval procedure draws the interior of an oval just inside the bounding rectangle that you specify in the area parameter.
 void erasePoly(Polygon poly)
          Using the patCopy pattern mode, ErasePoly draws the interior of the polygon passed in the poly parameter with the background pattern for the current graphics port.
 void eraseRect(QDRect area)
          Erases the specified rect with the current back color.
 void eraseRgn(Region area)
          Erases the specified region with the current back color.
 void eraseRoundRect(QDRect area, int ovalWidth, int ovalHeight)
          EraseRoundRect draws the interior of the rounded rectangle bounded by the rectangle that you specify in the area parameter with the background settings of the current graphics port.
 void frameArc(QDRect area, int startAngle, int arcAngle)
          Using Pen size of the graphics pen for the current graphics port, FrameArc draws an arc of the oval bounded by the rectangle that you specify in the area parameter.
 void frameOval(QDRect area)
          Using the Pen mode, and size of the graphics pen for the current graphics port, the FrameOval procedure draws an outline just inside the oval with the bounding rectangle that you specify in the area parameter.
 void framePoly(Polygon poly)
          Using the current graphics portÕs pen size, FramePoly plays back the line-drawing commands that define the polygon passed in the poly parameter.
 void frameRect(QDRect area)
          Using the pen size of the graphics pen for the current graphics port, the FrameRect procedure draws an outline just inside the rectangle that you specify in the area parameter.
 void frameRgn(Region area)
          Draws an outline just inside the region you pass in the area parameter.
 void frameRoundRect(QDRect area, int ovalWidth, int ovalHeight)
          Using the Pen size of the graphics pen for the current graphics port, FrameRoundRect draws an outline just inside the rounded rectangle bounded by the rectangle that you specify in the area parameter.
static QDGraphics fromCSequence(CSequence c)
          This method determines the location of the previous image buffer allocated by the compressor.
static QDGraphics fromDSequenceImage(DSequence d)
          This method helps you determine the location of the offscreen image buffer allocated by the decompressor.
static QDGraphics fromDSequenceScreen(DSequence d)
          This method enables you to determine the location of the offscreen buffer allocated by the decompressor.
static QDGraphics fromGraphicsExporter(GraphicsExporter ge)
          Call this method to obtain the QDGraphics of the object.
static QDGraphics fromGraphicsImporter(GraphicsImporter gi)
          Call this method to obtain the QDGraphics of the object.
static QDGraphics fromMovie(Movie m)
          Your application can determine a movie's graphics world by calling the getGWorld method.
static QDGraphics fromMovieController(MovieController mc)
          This method returns a movie controller's color graphics port.
static QDGraphics fromNativeGraphics(quicktime.qd.MacNativeGraphics ng)
          This will return a QDGraphics object from a native graphics object
static QDGraphics fromNativeGraphics(quicktime.qd.WinNativeGraphics ng)
          This will return a QDGraphics object from a native graphics object

QuickTime::GetNativeWindowPort
static QDGraphics fromPresentation(Presentation p, Stream s)
          Your application can retrieve a Presentation's graphics world by calling the getGWorld method.
static QDGraphics fromSequenceGrabber(SequenceGrabber sg)
          Returns the QDGraphic context of the sequence grabber.
 QDColor getBackColor()
          Returns the current background color of the QDGraphic.
 QDRect getBounds()
          The port rectangle that defines a subset of the pixel map to be used for drawing.
 Region getClip()
          This method returns the clip Region of the port.
 QDColor getCPixel(int h, int v)
          Returns the RGB color for the pixel at the location you specify in the h and v parameters.
 QDColor getForeColor()
          Returns the current foreground color of the QDGraphic.
static int getPixelSize(int pixelFormat)
          Returns the pixel size for a given pixel format.
 PixMap getPixMap()
          A PixMap object which describes the pixels in this QDGraphics.
static QDGraphics getPort()
          Returns the current QDGraphics.
 QDRect getPortRect()
          The port rectangle that defines a subset of the pixel map to be used for drawing.
 int getTextFace()
          The getTextFace method returns the style of the current font in this QDGraphics port.
 int getTextFont()
          The getTextFont method returns the font family ID of the current font in this QDGraphics port.
 int getTextMode()
          The getTextMode method returns the current transfer mode for drawing text in this QDGraphics port.
 int getTextSize()
          The getTextSize method returns the current font size for text drawn in this QDGraphics port.
 Region getVisClipRgn()
          This method returns intersection of visRgn and clipRgn of the port.
 void invertArc(QDRect area, int startAngle, int arcAngle)
          InvertArc inverts the pixels enclosed by a wedge of the oval bounded by the rectangle that you specify in the area parameter.
 void invertOval(QDRect area)
          The InvertOval procedure inverts the pixels enclosed by an oval just inside the bounding rectangle that you specify in the area parameter.
 void invertPoly(Polygon poly)
          invertPoly inverts the pixels enclosed by the polygon passed in the poly parameter.
 void invertRoundRect(QDRect area, int ovalWidth, int ovalHeight)
          The InvertRoundRect procedure inverts the pixels enclosed by the rounded rectangle bounded by the rectangle that you specify in the area parameter.
 boolean isOffscreen()
          This returns true if the QDGraphics is an offscreen GWorld or an onscreen CGrafPort.
 void line(int h, int v)
          Starting at the current location of the graphics pen, the Line procedure draws a line the horizontal distance that you specify in the h parameter and the vertical distance that you specify in the v parameter.
 void lineTo(int h, int v)
          The LineTo procedure draws a line from the graphics penÕs current location in the current graphics port to the new location (h,v), which you specify in the local coordinates of the current graphics port.
 Pict makeThumbnail(QDRect src, int colorDepth)
          Creates an 80-by-80 pixel thumbnail picture from the pixmap associated with this QDGraphics.
 int measureScaledText(int byteCount, java.lang.String text, float xScale, float yScale)
          The measureScaledText method (based on the QuickDraw function StdTxMeas) measures the width of scaled or unscaled text.
 void move(int h, int v)
          The Move procedure moves the graphics pen from its current location in the current graphics port a horizontal distance that you specify in the h parameter and a vertical distance that you specify in the v parameter.
 void moveTo(int h, int v)
          The MoveTo procedure changes the graphics penÕs current location to the new horizontal coordinate you specify in the h parameter and the new vertical coordinate you specify in the v parameter.
 void paintArc(QDRect area, int startAngle, int arcAngle)
          Using the pen mode of the current graphics port, PaintArc draws a wedge of the oval bounded by the rectangle that you specify in the area parameter.
 void paintOval(QDRect area)
          Using the pen mode for the current graphics port, the PaintOval procedure draws the interior of an oval just inside the bounding rectangle that you specify in the area parameter.
 void paintPoly(Polygon poly)
          Using the pen pattern and pattern mode for the current graphics port, PaintPoly draws the interior of a polygon passed in the poly parameter.
 void paintRect(QDRect area)
          Paints the specified rect with the current foreground color.
 void paintRgn(Region area)
          Paints the specified region with the current foreground color.
 void paintRoundRect(QDRect area, int ovalWidth, int ovalHeight)
          Using Pen mode of the graphics pen for the current graphics port, the PaintRoundRect procedure draws the interior of the rounded rectangle bounded by the rectangle that you specify in the area parameter.
 void penNormal()
          The PenNormal procedure restores the size, of the graphics pen in the current graphics port to their initial values: a size of 1 pixel by 1 pixel.
 void penSize(int width, int height)
          The PenSize procedure sets the width that you specify in the width parameter and the height that you specify in the height parameter for the graphics pen in the current graphics port.
 void setBackColor(QDColor bColor)
          Sets the current background color of the QDGraphic.
 void setClip(Region rgn)
          This method sets the clip Region of the port.
 void setCPixel(int h, int v, QDColor cPix)
          For the pixel at the location you specify in the h and v parameters, the setCPixel procedure sets a pixel value that most closely matches the RGB color that you specify in the cPix parameter.
 void setForeColor(QDColor fColor)
          Sets the current foreground color of the QDGraphics.
 void textFace(int face)
          The TextFace procedure sets the style of the font in which the text is to be drawn in this QDGraphics port.
 void textFont(int fontNumber)
          The TextFont procedure sets the font of the QDGraphics port in which the text is to be rendered.
 void textMode(int mode)
          The TextMode procedure sets the transfer mode for drawing text in this QDGraphics port.
 void textSize(int size)
          The TextSize procedure sets the font size for text drawn in this QDGraphics port.
 int textWidth(java.lang.String text, int firstByte, int byteCount)
          The TextWidth function returns the length in pixels of the specified text in this QDGraphics port.
 java.lang.String toString()
          Print information about this object.
 
Methods inherited from class quicktime.util.QTPointerRef
copyFromArray, copyFromArray, copyFromArray, copyFromArray, copyFromArray, copyFromArray, copyFromArray, copyToArray, copyToArray, copyToArray, copyToArray, copyToArray, copyToArray, copyToArray, getBytes, getSize
 
Methods inherited from class quicktime.QTObject
disposeQTObject, equals, ID
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

kNativeSize

public static final int kNativeSize
This is the size (the number of bytes) that are required for this class

scratch

public static QDGraphics scratch
This holds a reference to the scratchGWorld that you can use manually in calls such as Movie.setGWorld. It is used in the QTDrawable interfaces to signify that the QTDrawable is invisible (for instance when the QTCanvas that hosts the QTDrawable is hidden). It should not be reset by an application.

validScratch

public static QDGraphics validScratch
This holds a reference to the scratchGWorld that you can use as a temporary destination graphics and still be considered as a valid destination graphics by QTDrawable objects.

kDefaultPixelFormat

public static final int kDefaultPixelFormat
This is the default pixel format that is used to create offscreen graphics contexts when no format is used. It is the same format as Java image classes use internally ie. ARGB at 32bits per pixel.
Constructor Detail

QDGraphics

public QDGraphics(ImageCompressionDialog d,
                  QDRect rp,
                  int flags)
           throws QTException
Creates an offscreen QDGraphics based on the current compression settings.

QuickTime::SCNewGWorld()

Parameters:
rp - the boundaries of the graphics world.
flags - flags as specified to NewGWorld.
See Also:
ImageCompressionDialog.newGWorld(quicktime.qd.QDRect, int)

QDGraphics

public QDGraphics(ImageDescription id,
                  int flags)
           throws QTException
Creates an offscreen QDGraphics object from the width, height, depth, and color table of a specified image description structure.

QuickTime::NewImageGWorld

Parameters:
flags - holding graphics world flags.
See Also:
quicktime.std.image.ImageDescription#newGWorld()

QDGraphics

public QDGraphics(QDRect bounds)
           throws QTException
An offscreen graphics world in Color QuickDraw contains a GWorld - and its handles to associated PixMap and ColorTables - that describe an offscreen graphics port. Uses a pixel depth of 32 bits in ARGB format and no special flags settings. By default the pixels are locked.

QuickTime::QTNewGWorld

Parameters:
bounds - the boundary rectangle and port rectangle for the offscreen pixel map

QDGraphics

public QDGraphics(int pixelFormat,
                  QDRect bounds)
           throws QTException
An offscreen graphics world in Color QuickDraw contains a GWorld - and its handles to associated PixMap and ColorTables - that describe an offscreen graphics port. By default the pixels are locked.

QuickTime::QTNewGWorld

Parameters:
pixelFormat - the format of the pixels.
bounds - the boundary rectangle and port rectangle for the offscreen pixel map

QDGraphics

public QDGraphics(int pixelFormat,
                  QDRect bounds,
                  int flags)
           throws QTException
An offscreen graphics world in Color QuickDraw contains a GWorld - and its handles to associated PixMap and ColorTables - that describe an offscreen graphics port. By default the pixels are locked.

QuickTime::QTNewGWorld

Parameters:
pixelFormat - the format of the pixels.
bounds - the boundary rectangle and port rectangle for the offscreen pixel map
flags - options available to your application. See GWorld flags above

QDGraphics

public QDGraphics(int pixelFormat,
                  QDRect bounds,
                  ColorTable cTable,
                  GDevice aGDevice,
                  int flags)
           throws QTException
An offscreen graphics world in Color QuickDraw contains a GWorld - and its handles to associated PixMap and ColorTables - that describe an offscreen graphics port. By default the pixels are locked.

QuickTime::QTNewGWorld

Parameters:
pixelFormat - the format of the pixels.
bounds - the boundary rectangle and port rectangle for the offscreen pixel map
cTable - a ColorTable
aGDevice - a GDevice that should only be supplied if you set the noNewDevice flag, otherwise it is just ignored and can be passed null.
flags - options available to your application. See GWorld flags above
Method Detail

fromGraphicsExporter

public static QDGraphics fromGraphicsExporter(GraphicsExporter ge)
                                       throws StdQTException
Call this method to obtain the QDGraphics of the object.

QuickTime::GraphicsExportGetInputGWorld

Parameters:
ge - the GraphicsExporter
Returns:
The current destination graphics port
See Also:
GraphicsExporter.getInputGWorld()

getPort

public static QDGraphics getPort()
Returns the current QDGraphics.

QuickTime::GetPort

Returns:
a QDGraphics

getPixelSize

public static int getPixelSize(int pixelFormat)
                        throws StdQTException
Returns the pixel size for a given pixel format.

QuickTime::QTGetPixelSize

Returns:
pixel size

fromGraphicsImporter

public static QDGraphics fromGraphicsImporter(GraphicsImporter gi)
                                       throws StdQTException
Call this method to obtain the QDGraphics of the object.

QuickTime::GraphicsImportGetGWorld

Parameters:
gi - the GraphicsImporter
Returns:
The current destination graphics port
See Also:
GraphicsImporter.getGWorld()

fromMovie

public static QDGraphics fromMovie(Movie m)
                            throws StdQTException
Your application can determine a movie's graphics world by calling the getGWorld method.

QuickTime::GetMovieGWorld()

Parameters:
m - the Movie
Returns:
The current destination graphics port
See Also:
Movie.getGWorld()

fromPresentation

public static QDGraphics fromPresentation(Presentation p,
                                          Stream s)
                                   throws StdQTException
Your application can retrieve a Presentation's graphics world by calling the getGWorld method.
Parameters:
p - the Presentation
s - Stream
Returns:
The current destination graphics port
See Also:
Presentation.getGWorld()

fromMovieController

public static QDGraphics fromMovieController(MovieController mc)
                                      throws StdQTException
This method returns a movie controller's color graphics port.

QuickTime::MCGetControllerPort()

Parameters:
mc - the MovieController
Returns:
A QDGraphics object representing the controller's graf port.
See Also:
MovieController.getPort()

fromSequenceGrabber

public static QDGraphics fromSequenceGrabber(SequenceGrabber sg)
                                      throws StdQTException
Returns the QDGraphic context of the sequence grabber.

QuickTime::SGGetGWorld

Parameters:
sg - the SequenceGrabber
Returns:
The current graf port of the sequence grabber.
See Also:
SequenceGrabber.getGWorld()

fromCSequence

public static QDGraphics fromCSequence(CSequence c)
                                throws StdQTException
This method determines the location of the previous image buffer allocated by the compressor.

QuickTime::GetCSequencePrevBuffer

Parameters:
c - the CSequence
Returns:
a QDGraphics object which is the graphics world for the image buffer
See Also:
CSequence.prevBuffer()

fromDSequenceImage

public static QDGraphics fromDSequenceImage(DSequence d)
                                     throws StdQTException
This method helps you determine the location of the offscreen image buffer allocated by the decompressor.

QuickTime::GetDSequenceImageBuffer

Parameters:
d - the DSequence
Returns:
a QDGraphics object which is the graphics world for the image buffer
See Also:
DSequence.getImageBuffer()

fromDSequenceScreen

public static QDGraphics fromDSequenceScreen(DSequence d)
                                      throws StdQTException
This method enables you to determine the location of the offscreen buffer allocated by the decompressor.

QuickTime::GetDSequenceScreenBuffer

Parameters:
d - the DSequence
Returns:
a QDGraphics object which is the graphics world for the screen buffer
See Also:
DSequence.getScreenBuffer()

fromNativeGraphics

public static QDGraphics fromNativeGraphics(quicktime.qd.WinNativeGraphics ng)
                                     throws NativeGraphicsException
This will return a QDGraphics object from a native graphics object

QuickTime::GetNativeWindowPort

fromNativeGraphics

public static QDGraphics fromNativeGraphics(quicktime.qd.MacNativeGraphics ng)
                                     throws NativeGraphicsException
This will return a QDGraphics object from a native graphics object

beginDraw

public void beginDraw(QDDrawer d)
               throws QTException
This method should be used when a number of drawing methods need to be invoked on this QDGraphics object. It will establish the required global state for these methods to be called efficiently.
Parameters:
d - the QDDrawer object that will do the drawing

isOffscreen

public boolean isOffscreen()
This returns true if the QDGraphics is an offscreen GWorld or an onscreen CGrafPort.
Returns:
true if offscreen, else false

getPixMap

public PixMap getPixMap()
A PixMap object which describes the pixels in this QDGraphics.
Returns:
a PixMap object
See Also:
quicktime.std.qd.PixMap

getPortRect

public QDRect getPortRect()
The port rectangle that defines a subset of the pixel map to be used for drawing.
Returns:
aRect object which defines the boundaries of the port rectangle

makeThumbnail

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

QuickTime::MakeThumbnailFromPixMap()

Parameters:
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

getBounds

public QDRect getBounds()
The port rectangle that defines a subset of the pixel map to be used for drawing.
Returns:
aRect object which defines the boundaries of the port rectangle

getVisClipRgn

public Region getVisClipRgn()
                     throws QTException
This method returns intersection of visRgn and clipRgn of the port. It is implemented on the low level of native calls to avoid extra load on garbage collector
Returns:
Region object which defines the intersection of visible and clipping regions

getClip

public Region getClip()
               throws QTException
This method returns the clip Region of the port.

QuickDraw::GetClip()
Returns:
Region object which defines the clip region

setClip

public void setClip(Region rgn)
This method sets the clip Region of the port.

QuickDraw::SetClip()
Parameters:
rgn - Region object which defines the new clip region

clipRect

public void clipRect()
To change the clipping region of this QDGraphics, use the ClipRect procedure. This method will set the clip to the current port rect of the QDGraphics

QuickDraw::ClipRect()
Parameters:
r - the rect that will become the new clip rgn

clipRect

public void clipRect(QDRect r)
To change the clipping region of this QDGraphics, use the ClipRect procedure.
Parameters:
r - the rect that will become the new clip rgn

getBackColor

public QDColor getBackColor()
Returns the current background color of the QDGraphic.

QuickDraw::GetBackColor()

Returns:
QDColor

setBackColor

public void setBackColor(QDColor bColor)
Sets the current background color of the QDGraphic.

QuickDraw::RGBBackColor()

Parameters:
bColor - QDColor

frameArc

public void frameArc(QDRect area,
                     int startAngle,
                     int arcAngle)
              throws QDException
Using Pen size of the graphics pen for the current graphics port, FrameArc draws an arc of the oval bounded by the rectangle that you specify in the area parameter. Use the startAngle parameter to specify where the arc begins as modulo 360. Use the arcAngle parameter to specify how many degrees the arc covers. Specify whether the angles are in positive or negative degrees; a positive angle goes clockwise, while a negative angle goes counterclockwise. Zero degrees is at 12 oÕclock high, 90” (or Š270”) is at 3 oÕclock, 180” (or Š180”) is at 6 oÕclock, and 270” (or Š90”) is at 9 oÕclock. Measure other angles relative to the bounding rectangle. A line from the center of the rectangle through its upper-right corner is at 45”, even if the rectangle isnÕt square; a line through the lower-right corner is at 135”, and so on. The arc is as wide as the pen width and as tall as the pen height. The pen location does not change.

QuickDraw::FrameArc()

Parameters:
area - The rectangle that defines an ovalÕs boundaries.
startAngle - The angle indicating the start of the arc.
arcAngle - The angle indicating the arcÕs extent.

paintArc

public void paintArc(QDRect area,
                     int startAngle,
                     int arcAngle)
              throws QDException
Using the pen mode of the current graphics port, PaintArc draws a wedge of the oval bounded by the rectangle that you specify in the area parameter. As in the FrameArc procedure described on page 3-72 of Inside Macintosh: Imaging With QuickDraw and illustrated in Figure 3-21(Im), use the startAngle and arcAngle parameters to define the arc of the wedge. The pen location does not change.

QuickDraw::PaintArc()

Parameters:
area - The rectangle that defines an ovalÕs boundaries.
startAngle - The angle indicating the start of the arc.
arcAngle - The angle indicating the arcÕs extent.

eraseArc

public void eraseArc(QDRect area,
                     int startAngle,
                     int arcAngle)
              throws QDException
EraseArc draws a wedge of the oval bounded by the rectangle that you specify in the area parameter with the background pattern for the current graphics port. As in the FrameArc method on page 3-72 of Inside Macintosh: Imaging With QuickDraw and as illustrated in Figure 3-21(Im), use the startAngle and arcAngle parameters to define the arc of the wedge. This method leaves the location of the graphics pen unchanged.

QuickDraw::EraseArc()

Parameters:
area - The rectangle that defines an ovalÕs boundaries.
startAngle - The angle indicating the start of the arc.
arcAngle - The angle indicating the arcÕs extent.

invertArc

public void invertArc(QDRect area,
                      int startAngle,
                      int arcAngle)
               throws QDException
InvertArc inverts the pixels enclosed by a wedge of the oval bounded by the rectangle that you specify in the area parameter. Every white pixel becomes black and every black pixel becomes white. As in the FrameArc procedure described on page 3-72 of Inside Macintosh: Imaging With QuickDraw and as illustrated in Figure 3-21(Im), use the startAngle and arcAngle parameters to define the arc of the wedge. This procedure leaves the location of the graphics pen unchanged.

QuickDraw::InvertArc()

Parameters:
area - The rectangle that defines an ovalÕs boundaries.
startAngle - The angle indicating the start of the arc.
arcAngle - The angle indicating the arcÕs extent.

frameRoundRect

public void frameRoundRect(QDRect area,
                           int ovalWidth,
                           int ovalHeight)
                    throws QDException
Using the Pen size of the graphics pen for the current graphics port, FrameRoundRect draws an outline just inside the rounded rectangle bounded by the rectangle that you specify in the area parameter. The outline is as wide as the pen width and as tall as the pen height. The pen location does not change. Use the ovalWidth and ovalHeight parameters to specify the diameters of curvature for the corners of the rounded rectangle. If a region is open and being formed, the outside outline of the new rounded rectangle is mathematically added to the regionÕs boundary.

QuickDraw::FrameRoundRect()

Parameters:
area - The rectangle that defines the rounded rectangleÕs boundaries.
ovalWidth - The width of the oval defining the rounded corner.
ovalHeight - The height of the oval defining the rounded corner.

paintRoundRect

public void paintRoundRect(QDRect area,
                           int ovalWidth,
                           int ovalHeight)
                    throws QDException
Using Pen mode of the graphics pen for the current graphics port, the PaintRoundRect procedure draws the interior of the rounded rectangle bounded by the rectangle that you specify in the area parameter. Use the ovalWidth and ovalHeight parameters to specify the diameters of curvature for the corners of the rounded rectangle. The pen location does not change..

QuickDraw::PaintRoundRect()

Parameters:
area - The rectangle that defines the rounded rectangleÕs boundaries.
ovalWidth - The width of the oval defining the rounded corner.
ovalHeight - The height of the oval defining the rounded corner.

eraseRoundRect

public void eraseRoundRect(QDRect area,
                           int ovalWidth,
                           int ovalHeight)
                    throws QDException
EraseRoundRect draws the interior of the rounded rectangle bounded by the rectangle that you specify in the area parameter with the background settings of the current graphics port. This effectively erases the rounded rectangle. Use the ovalWidth and ovalHeight parameters to specify the diameters of curvature for the corners of the rounded rectangle. This procedure leaves the location of the graphics pen unchanged.

QuickDraw::EraseRoundRect()

Parameters:
area - The rectangle that defines the rounded rectangleÕs boundaries.
ovalWidth - The width of the oval defining the rounded corner.
ovalHeight - The height of the oval defining the rounded corner.

invertRoundRect

public void invertRoundRect(QDRect area,
                            int ovalWidth,
                            int ovalHeight)
                     throws QDException
The InvertRoundRect procedure inverts the pixels enclosed by the rounded rectangle bounded by the rectangle that you specify in the area parameter. Every white pixel becomes black and every black pixel becomes white. The ovalWidth and ovalHeight parameters specify the diameters of curvature for the corners. The pen location does not change.

QuickDraw::InvertRoundRect()

Parameters:
area - The rectangle that defines the rounded rectangleÕs boundaries.
ovalWidth - The width of the oval defining the rounded corner.
ovalHeight - The height of the oval defining the rounded corner.

frameOval

public void frameOval(QDRect area)
               throws QDException
Using the Pen mode, and size of the graphics pen for the current graphics port, the FrameOval procedure draws an outline just inside the oval with the bounding rectangle that you specify in the area parameter. The outline is as wide as the pen width and as tall as the pen height. The pen location does not change. If a region is open and being formed, the outside outline of the new oval is mathematically added to the regionÕs boundary.

QuickDraw::FrameOval()

Parameters:
area - The rectangle that defines the ovalÕs boundary.

paintOval

public void paintOval(QDRect area)
               throws QDException
Using the pen mode for the current graphics port, the PaintOval procedure draws the interior of an oval just inside the bounding rectangle that you specify in the area parameter. The pen location does not change.

QuickDraw::PaintOval()

Parameters:
area - The rectangle that defines the ovalÕs boundary.

eraseOval

public void eraseOval(QDRect area)
               throws QDException
Using the background pattern for the current graphics port and the patCopy pattern mode, the EraseOval procedure draws the interior of an oval just inside the bounding rectangle that you specify in the area parameter. This effectively erases the oval bounded by the specified rectangle. This procedure leaves the location of the graphics pen unchanged.

QuickDraw::EraseOval()

Parameters:
area - The rectangle that defines the ovalÕs boundary.

invertOval

public void invertOval(QDRect area)
                throws QDException
The InvertOval procedure inverts the pixels enclosed by an oval just inside the bounding rectangle that you specify in the area parameter. Every white pixel becomes black and every black pixel becomes white. The pen location does not change.

QuickDraw::InvertOval()

Parameters:
area - The rectangle that defines the ovalÕs boundary.

framePoly

public void framePoly(Polygon poly)
               throws QDException
Using the current graphics portÕs pen size, FramePoly plays back the line-drawing commands that define the polygon passed in the poly parameter. The graphics pen hangs below and to the right of each point on the boundary of the polygon. Thus, the drawn polygon extends beyond the right and bottom edges of the polygonÕs bounding rectangle (which is stored in the polyBBox field of the Polygon record) by the pen width and pen height, respectively. All other graphics operations, such as painting a polygon with the PaintPoly procedure, occur strictly within the boundary of the polygon, as illustrated in Figure 3-22(Im).

QuickDraw::FramePoly()

Parameters:
poly - Polygon to frame.

paintPoly

public void paintPoly(Polygon poly)
               throws QDException
Using the pen pattern and pattern mode for the current graphics port, PaintPoly draws the interior of a polygon passed in the poly parameter. The pen location does not change.

QuickDraw::PaintPoly()

Parameters:
poly - Polygon to paint.

erasePoly

public void erasePoly(Polygon poly)
               throws QDException
Using the patCopy pattern mode, ErasePoly draws the interior of the polygon passed in the poly parameter with the background pattern for the current graphics port.

QuickDraw::ErasePoly()

Parameters:
poly - Polygon to erase.

invertPoly

public void invertPoly(Polygon poly)
                throws QDException
invertPoly inverts the pixels enclosed by the polygon passed in the poly parameter. Every white pixel becomes black and every black pixel becomes white. This procedure leaves the location of the graphics pen unchanged.

QuickDraw::InvertPoly()

Parameters:
poly - Polygon to erase.

frameRect

public void frameRect(QDRect area)
               throws QDException
Using the pen size of the graphics pen for the current graphics port, the FrameRect procedure draws an outline just inside the rectangle that you specify in the area parameter. The outline is as wide as the pen width and as tall as the pen height. The pen location does not change.

QuickDraw::FrameRect()

Parameters:
area - the portion of the QDGraphic port to frame or null for entire bounds

eraseRect

public void eraseRect(QDRect area)
               throws QDException
Erases the specified rect with the current back color.

QuickDraw::EraseRect()

Parameters:
area - the portion of the QDGraphic port to erase or null for entire bounds

eraseRgn

public void eraseRgn(Region area)
              throws QDException
Erases the specified region with the current back color.

QuickDraw::EraseRgn()

Parameters:
area - the portion of the QDGraphic to erase

getCPixel

public QDColor getCPixel(int h,
                         int v)
                  throws QDException
Returns the RGB color for the pixel at the location you specify in the h and v parameters.

QuickDraw::GetCPixel()

Parameters:
h - The horizontal coordinate of the point at the upper-left corner of the pixel.
v - The vertical coordinate of the point at the upper-left corner of the pixel.
Returns:
The QDColor for the pixel.

setCPixel

public void setCPixel(int h,
                      int v,
                      QDColor cPix)
               throws QDException
For the pixel at the location you specify in the h and v parameters, the setCPixel procedure sets a pixel value that most closely matches the RGB color that you specify in the cPix parameter. On an indexed color system, the SetCPixel procedure sets the pixel value to the index of the best-matching color in the current deviceÕs CLUT. In a direct environment, the SetCPixel procedure sets the pixel value to a 16-bit or 32-bit direct pixel value.

QuickDraw::SetCPixel()

Parameters:
h - The horizontal coordinate of the point at the upper-left corner of the pixel.
v - The vertical coordinate of the point at the upper-left corner of the pixel.

penSize

public void penSize(int width,
                    int height)
             throws QDException
The PenSize procedure sets the width that you specify in the width parameter and the height that you specify in the height parameter for the graphics pen in the current graphics port. All subsequent calls to the Line and LineTo procedures and to the procedures that draw framed shapes in the current graphics port use the new pen dimensions.

QuickDraw::PenSize()

Parameters:
width - The pen width, as an integer from 0 to 32,767. If you set the value to 0, the pen does not draw. Values less than 0 are undefined.
height - The pen height, as an integer from 0 to 32,767. If you set the value to 0, the pen does not draw. Values less than 0 are undefined.

penNormal

public void penNormal()
               throws QDException
The PenNormal procedure restores the size, of the graphics pen in the current graphics port to their initial values: a size of 1 pixel by 1 pixel. The pen location does not change.

QuickDraw::PenNormal()


getForeColor

public QDColor getForeColor()
Returns the current foreground color of the QDGraphic.

QuickDraw::GetForeColor()

Returns:
QDColor

setForeColor

public void setForeColor(QDColor fColor)
Sets the current foreground color of the QDGraphics.

QuickDraw::RGBForeColor()

Parameters:
fColor - QDColor

paintRect

public void paintRect(QDRect area)
               throws QDException
Paints the specified rect with the current foreground color.

QuickDraw::PaintRect()

Parameters:
area - the portion of the QDGraphic port to paint or null for entire bounds

lineTo

public void lineTo(int h,
                   int v)
            throws QDException
The LineTo procedure draws a line from the graphics penÕs current location in the current graphics port to the new location (h,v), which you specify in the local coordinates of the current graphics port. If you are using LineTo to draw a region or polygon, its outline is infinitely thin and is not affected by the values of the pnSize, pnMode, or pnPat field of the graphics port.

QuickDraw::LineTo()



QuickDraw::MacLineTo()

Parameters:
h - The horizontal coordinate of the graphics penÕs new location.
v - The vertical coordinate of the graphics penÕs new location.

line

public void line(int h,
                 int v)
          throws QDException
Starting at the current location of the graphics pen, the Line procedure draws a line the horizontal distance that you specify in the h parameter and the vertical distance that you specify in the v parameter.

QuickDraw::Line()

Parameters:
h - The horizontal distance of the graphics penÕs movement.
v - The vertical distance of the graphics penÕs movement.

moveTo

public void moveTo(int h,
                   int v)
            throws QDException
The MoveTo procedure changes the graphics penÕs current location to the new horizontal coordinate you specify in the h parameter and the new vertical coordinate you specify in the v parameter. Specify the new location in the local coordinates of the current graphics port. The MoveTo procedure performs no drawing.

QuickDraw::MoveTo()

Parameters:
h - The horizontal distance of the graphics penÕs movement.
v - The vertical distance of the graphics penÕs movement.

move

public void move(int h,
                 int v)
          throws QDException
The Move procedure moves the graphics pen from its current location in the current graphics port a horizontal distance that you specify in the h parameter and a vertical distance that you specify in the v parameter.

QuickDraw::Move()

Parameters:
h - The horizontal distance of the graphics penÕs movement.
v - The vertical distance of the graphics penÕs movement.

paintRgn

public void paintRgn(Region area)
              throws QDException
Paints the specified region with the current foreground color.

QuickDraw::PaintRgn()



QuickDraw::MacPaintRgn()

Parameters:
area - the portion of the QDGraphic port to paint

frameRgn

public void frameRgn(Region area)
              throws QDException
Draws an outline just inside the region you pass in the area parameter. The outline never goes outside the region boundary. The pen location does not change.

QuickDraw::FrameRgn()



QuickDraw::MacFrameRgn()

Parameters:
area - the portion of the QDGraphic port to paint

textFont

public final void textFont(int fontNumber)
The TextFont procedure sets the font of the QDGraphics port in which the text is to be rendered.
Parameters:
fontNumber - The font family ID (obtained from an getFNum call).
See Also:
getFNum

getTextFont

public int getTextFont()
The getTextFont method returns the font family ID of the current font in this QDGraphics port.
Returns:
The font family ID of the current font.
See Also:
getFNum

textFace

public void textFace(int face)
The TextFace procedure sets the style of the font in which the text is to be drawn in this QDGraphics port.
Parameters:
face - The style for text to be drawn

getTextFace

public int getTextFace()
The getTextFace method returns the style of the current font in this QDGraphics port.
Returns:
The style of the current font.

textMode

public void textMode(int mode)
The TextMode procedure sets the transfer mode for drawing text in this QDGraphics port.
Parameters:
mode - The transfer mode to be used in drawing text. Possible values are: srcCopy, srcOr, srcXOr, srcBic, etc.
See Also:
quicktime.QTConstants#srcCopy

getTextMode

public int getTextMode()
The getTextMode method returns the current transfer mode for drawing text in this QDGraphics port.
Returns:
The transfer mode used in drawing text.

textSize

public void textSize(int size)
The TextSize procedure sets the font size for text drawn in this QDGraphics port.
Parameters:
size - The font size in points. If you specify 0, the system font size is used.

getTextSize

public int getTextSize()
The getTextSize method returns the current font size for text drawn in this QDGraphics port.
Returns:
The font size in points.

drawChar

public void drawChar(int character)
The DrawChar procedure draws the glyph for the specified character at the current pen location in this QDGraphics port.
Parameters:
character - The character code whose glyph is to be drawn.

drawText

public void drawText(java.lang.String text,
                     int firstByte,
                     int byteCount)
The DrawText procedure draws the specified text at the current pen location in this QDGraphics port.
Parameters:
text - String containing the text to be drawn.
firstByte - An offset from the start of the String (text) to the first byte of the text to be drawn.
byteCount - The number of bytes of text to be drawn.

charWidth

public int charWidth(int character)
The CharWidth function returns the width in pixels of the specified character in this QDGraphics port.
Parameters:
character - The character code whose width is to be measured.
Returns:
The width of the specified character in pixels.

textWidth

public int textWidth(java.lang.String text,
                     int firstByte,
                     int byteCount)
The TextWidth function returns the length in pixels of the specified text in this QDGraphics port.
Parameters:
text - String containing the text to be measured.
firstByte - An offset from the start of the String (text) to the first byte of the text to be measured.
byteCount - The number of bytes of text to be measured.
Returns:
The width of the specified text in pixels.

drawTextScaled

public void drawTextScaled(int count,
                           java.lang.String text,
                           float xScale,
                           float yScale)
The StdText procedure is a QuickDraw bottleneck routine that can be called directly to obtain scaled (or unscaled) text..
Parameters:
count - The number of bytes of text to be drawn.
text - String containing the text to be drawn.
xScale - Represents the scaling factor in the X dimension.
yScale - Represents the scaling factor in the Y dimension.

measureScaledText

public int measureScaledText(int byteCount,
                             java.lang.String text,
                             float xScale,
                             float yScale)
The measureScaledText method (based on the QuickDraw function StdTxMeas) measures the width of scaled or unscaled text.
Parameters:
byteCount - The number of bytes of text to be measured.
text - String containing the text to be measured.
xScale - Represents the scaling factor in the X dimension.
yScale - Represents the scaling factor in the Y dimension.
Returns:
The width of the specified text in pixels.

toString

public java.lang.String toString()
Print information about this object.
Overrides:
toString in class QTPointerRef
Returns:
a string representing this QDGraphics object