|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--quicktime.QTObject | +--quicktime.util.QTPointerRef | +--quicktime.qd.QDGraphics
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 |
public static final int kNativeSize
public static QDGraphics scratch
public static QDGraphics validScratch
public static final int kDefaultPixelFormat
Constructor Detail |
public QDGraphics(ImageCompressionDialog d, QDRect rp, int flags) throws QTException
rp
- the boundaries of the graphics world.flags
- flags as specified to NewGWorld.ImageCompressionDialog.newGWorld(quicktime.qd.QDRect, int)
public QDGraphics(ImageDescription id, int flags) throws QTException
flags
- holding graphics world flags.quicktime.std.image.ImageDescription#newGWorld()
public QDGraphics(QDRect bounds) throws QTException
bounds
- the boundary rectangle and port rectangle for the offscreen
pixel mappublic QDGraphics(int pixelFormat, QDRect bounds) throws QTException
pixelFormat
- the format of the pixels.bounds
- the boundary rectangle and port rectangle for the offscreen
pixel mappublic QDGraphics(int pixelFormat, QDRect bounds, int flags) throws QTException
pixelFormat
- the format of the pixels.bounds
- the boundary rectangle and port rectangle for the offscreen
pixel mapflags
- options available to your application. See GWorld flags abovepublic QDGraphics(int pixelFormat, QDRect bounds, ColorTable cTable, GDevice aGDevice, int flags) throws QTException
pixelFormat
- the format of the pixels.bounds
- the boundary rectangle and port rectangle for the offscreen
pixel mapcTable
- a ColorTableaGDevice
- 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 aboveMethod Detail |
public static QDGraphics fromGraphicsExporter(GraphicsExporter ge) throws StdQTException
ge
- the GraphicsExporterGraphicsExporter.getInputGWorld()
public static QDGraphics getPort()
public static int getPixelSize(int pixelFormat) throws StdQTException
public static QDGraphics fromGraphicsImporter(GraphicsImporter gi) throws StdQTException
gi
- the GraphicsImporterGraphicsImporter.getGWorld()
public static QDGraphics fromMovie(Movie m) throws StdQTException
m
- the MovieMovie.getGWorld()
public static QDGraphics fromPresentation(Presentation p, Stream s) throws StdQTException
p
- the Presentations
- StreamPresentation.getGWorld()
public static QDGraphics fromMovieController(MovieController mc) throws StdQTException
mc
- the MovieControllerMovieController.getPort()
public static QDGraphics fromSequenceGrabber(SequenceGrabber sg) throws StdQTException
sg
- the SequenceGrabberSequenceGrabber.getGWorld()
public static QDGraphics fromCSequence(CSequence c) throws StdQTException
c
- the CSequenceCSequence.prevBuffer()
public static QDGraphics fromDSequenceImage(DSequence d) throws StdQTException
d
- the DSequenceDSequence.getImageBuffer()
public static QDGraphics fromDSequenceScreen(DSequence d) throws StdQTException
d
- the DSequenceDSequence.getScreenBuffer()
public static QDGraphics fromNativeGraphics(quicktime.qd.WinNativeGraphics ng) throws NativeGraphicsException
public static QDGraphics fromNativeGraphics(quicktime.qd.MacNativeGraphics ng) throws NativeGraphicsException
public void beginDraw(QDDrawer d) throws QTException
d
- the QDDrawer object that will do the drawingpublic boolean isOffscreen()
public PixMap getPixMap()
quicktime.std.qd.PixMap
public QDRect getPortRect()
public Pict makeThumbnail(QDRect src, int colorDepth) throws QTException
src
- a QDRect object defining the portion of the image to use for the thumbnailcolorDepth
- specifies the depth at which the image is likely to be viewedpublic QDRect getBounds()
public Region getVisClipRgn() throws QTException
public Region getClip() throws QTException
public void setClip(Region rgn)
rgn
- Region object which defines the new clip regionpublic void clipRect()
r
- the rect that will become the new clip rgnpublic void clipRect(QDRect r)
r
- the rect that will become the new clip rgnpublic QDColor getBackColor()
public void setBackColor(QDColor bColor)
bColor
- QDColorpublic void frameArc(QDRect area, int startAngle, int arcAngle) throws QDException
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.public void paintArc(QDRect area, int startAngle, int arcAngle) throws QDException
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.public void eraseArc(QDRect area, int startAngle, int arcAngle) throws QDException
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.public void invertArc(QDRect area, int startAngle, int arcAngle) throws QDException
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.public void frameRoundRect(QDRect area, int ovalWidth, int ovalHeight) throws QDException
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.public void paintRoundRect(QDRect area, int ovalWidth, int ovalHeight) throws QDException
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.public void eraseRoundRect(QDRect area, int ovalWidth, int ovalHeight) throws QDException
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.public void invertRoundRect(QDRect area, int ovalWidth, int ovalHeight) throws QDException
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.public void frameOval(QDRect area) throws QDException
area
- The rectangle that defines the ovalÕs boundary.public void paintOval(QDRect area) throws QDException
area
- The rectangle that defines the ovalÕs boundary.public void eraseOval(QDRect area) throws QDException
area
- The rectangle that defines the ovalÕs boundary.public void invertOval(QDRect area) throws QDException
area
- The rectangle that defines the ovalÕs boundary.public void framePoly(Polygon poly) throws QDException
poly
- Polygon to frame.public void paintPoly(Polygon poly) throws QDException
poly
- Polygon to paint.public void erasePoly(Polygon poly) throws QDException
poly
- Polygon to erase.public void invertPoly(Polygon poly) throws QDException
poly
- Polygon to erase.public void frameRect(QDRect area) throws QDException
area
- the portion of the QDGraphic port to frame
or null for entire boundspublic void eraseRect(QDRect area) throws QDException
area
- the portion of the QDGraphic port to erase
or null for entire boundspublic void eraseRgn(Region area) throws QDException
area
- the portion of the QDGraphic to erasepublic QDColor getCPixel(int h, int v) throws QDException
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.public void setCPixel(int h, int v, QDColor cPix) throws QDException
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.public void penSize(int width, int height) throws QDException
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.public void penNormal() throws QDException
public QDColor getForeColor()
public void setForeColor(QDColor fColor)
fColor
- QDColorpublic void paintRect(QDRect area) throws QDException
area
- the portion of the QDGraphic port to paint
or null for entire boundspublic void lineTo(int h, int v) throws QDException
h
- The horizontal coordinate of the graphics penÕs new location.v
- The vertical coordinate of the graphics penÕs new location.public void line(int h, int v) throws QDException
h
- The horizontal distance of the graphics penÕs movement.v
- The vertical distance of the graphics penÕs movement.public void moveTo(int h, int v) throws QDException
h
- The horizontal distance of the graphics penÕs movement.v
- The vertical distance of the graphics penÕs movement.public void move(int h, int v) throws QDException
h
- The horizontal distance of the graphics penÕs movement.v
- The vertical distance of the graphics penÕs movement.public void paintRgn(Region area) throws QDException
area
- the portion of the QDGraphic port to paintpublic void frameRgn(Region area) throws QDException
area
- the portion of the QDGraphic port to paintpublic final void textFont(int fontNumber)
fontNumber
- The font family ID (obtained from an getFNum call).getFNum
public int getTextFont()
getFNum
public void textFace(int face)
face
- The style for text to be drawnpublic int getTextFace()
public void textMode(int mode)
mode
- The transfer mode to be used in drawing text. Possible values are: srcCopy, srcOr, srcXOr, srcBic, etc.quicktime.QTConstants#srcCopy
public int getTextMode()
public void textSize(int size)
size
- The font size in points. If you specify 0, the system font size is used.public int getTextSize()
public void drawChar(int character)
character
- The character code whose glyph is to be drawn.public void drawText(java.lang.String text, int firstByte, int byteCount)
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.public int charWidth(int character)
character
- The character code whose width is to be measured.public int textWidth(java.lang.String text, int firstByte, int byteCount)
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.public void drawTextScaled(int count, java.lang.String text, float xScale, float yScale)
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.public int measureScaledText(int byteCount, java.lang.String text, float xScale, float yScale)
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.public java.lang.String toString()
toString
in class QTPointerRef
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |