|
PulpCore | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpulpcore.image.CoreGraphics
public class CoreGraphics
Graphics rendering routines onto a CoreImage surface.
The default blend mode is BlendMode.SrcOver().
The clip is in view-space - not affected by the Transform.
| Field Summary | |
|---|---|
static int |
INTERPOLATION_BILINEAR
Bilinear interpolation method (used for image scaling). |
static int |
INTERPOLATION_NEAREST_NEIGHBOR
Nearest neighbor interpolation method (used for image scaling). |
| Method Summary | |
|---|---|
void |
clear()
Fills the area defined by the clip with the background color of the current drawing surface. |
void |
clearTransform()
Sets the current transform to the identiy matrix. |
void |
clipRect(int x,
int y,
int w,
int h)
The clip is not affected by the transform. |
void |
clipRect(Rect r)
The clip is not affected by the transform. |
void |
drawChar(char ch,
int maxWidth)
Internal method used to clip the TextField. |
void |
drawImage(CoreImage image)
|
void |
drawImage(CoreImage image,
int x,
int y)
Draws an image at a specific location. |
void |
drawImage(CoreImage image,
int srcX,
int srcY,
int srcWidth,
int srcHeight)
|
void |
drawImage(CoreImage image,
int x,
int y,
int srcX,
int srcY,
int srcWidth,
int srcHeight)
|
void |
drawLine(double x1,
double y1,
double x2,
double y2)
Draws a line using the current color. |
void |
drawLine(int x1,
int y1,
int x2,
int y2)
Draws a line using the current color. |
void |
drawLineFixedPoint(int x1,
int y1,
int x2,
int y2)
Draws a line (at fixed-point coordinates) using the current color. |
void |
drawRect(int x,
int y,
int w,
int h)
Draws a rectangle using the current color. |
void |
drawRotatedImage(CoreImage image,
int x,
int y,
int w,
int h,
int angle)
Draws a rotated and scaled image. |
void |
drawRotatedImage(CoreImage image,
int x,
int y,
int w,
int h,
int cosAngle,
int sinAngle)
Draws a rotated and scaled image using pre-computed cosine and sine of the angle. |
void |
drawRotatedImage(CoreImage image,
int x,
int y,
int w,
int h,
int angle,
int srcX,
int srcY,
int srcWidth,
int srcHeight)
Draws a rotated and scaled image. |
void |
drawRotatedImage(CoreImage image,
int x,
int y,
int w,
int h,
int cosAngle,
int sinAngle,
int srcX,
int srcY,
int srcWidth,
int srcHeight)
Draws a rotated and scaled image using pre-computed cosine and sine of the angle. |
void |
drawRotatedString(String str,
int x,
int y,
int w,
int h,
int angle)
|
void |
drawRotatedString(String str,
int x,
int y,
int w,
int h,
int cosAngle,
int sinAngle)
|
void |
drawScaledImage(CoreImage image,
int x,
int y,
int w,
int h)
|
void |
drawScaledImage(CoreImage image,
int x,
int y,
int w,
int h,
int srcX,
int srcY,
int srcWidth,
int srcHeight)
|
void |
drawScaledString(String str,
int x,
int y,
int w,
int h)
|
void |
drawString(String str)
|
void |
drawString(String str,
int x,
int y)
|
void |
fill()
Fills the entire surface with the current color. |
void |
fillRect(double x,
double y,
double w,
double h)
Fills a rectangle with the current color. |
void |
fillRect(int x,
int y,
int w,
int h)
Fills a rectangle with the current color. |
void |
fillRectFixedPoint(int fx,
int fy,
int fw,
int fh)
Fills a rectangle (at fixed-point coordinates) with the current color. |
int |
getAlpha()
|
BlendMode |
getBlendMode()
|
Rect |
getClip()
Gets the current clip as a newly allocated Rect. |
void |
getClip(Rect rect)
Copies the current clip into the specified Rect. |
int |
getClipHeight()
|
int |
getClipWidth()
|
int |
getClipX()
|
int |
getClipY()
|
int |
getColor()
Returns the current color in ARGB format. |
CoreFont |
getFont()
|
boolean |
getFractionalMetrics()
|
int |
getInterpolation()
|
int |
getSurfaceHeight()
|
int |
getSurfaceWidth()
|
Transform |
getTransform()
Returns the current transform. |
void |
popTransform()
Removes (pops) the transform at the top of the transform stack and sets the current transform to that popped transform. |
void |
pushTransform()
Adds (pushes) a copy of the current transform to the top of the transform stack. |
void |
removeClip()
|
void |
reset()
Resets the rendering attributes for this CoreGraphics object to the default values: No clip Identity transform (and the transform stack is cleared) color = BLACK alpha = 255 blendMode = BlendMode.SrcOver() interpolation = INTERPOLATION_BILINEAR font = null |
void |
setAlpha(int alpha)
|
void |
setBlendMode(BlendMode blendMode)
|
void |
setClip(int x,
int y,
int w,
int h)
The clip is not affected by the transform. |
void |
setClip(Rect r)
The clip is not affected by the transform. |
void |
setColor(int argbColor)
Sets the current color. |
void |
setFont(CoreFont font)
|
void |
setFractionalMetrics(boolean useFractionalMetrics)
|
void |
setInterpolation(int interpolation)
|
void |
setTransform(Transform newTransform)
Sets the current transform to a copy of the specified transform. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int INTERPOLATION_NEAREST_NEIGHBOR
public static final int INTERPOLATION_BILINEAR
| Method Detail |
|---|
public int getSurfaceWidth()
public int getSurfaceHeight()
public void reset()
public void setBlendMode(BlendMode blendMode)
public BlendMode getBlendMode()
public void setInterpolation(int interpolation)
public int getInterpolation()
public void setFractionalMetrics(boolean useFractionalMetrics)
public boolean getFractionalMetrics()
public void setFont(CoreFont font)
public CoreFont getFont()
public void pushTransform()
public void popTransform()
throws EmptyStackException
EmptyStackException - if the stack is emptypublic Transform getTransform()
public void setTransform(Transform newTransform)
public void clearTransform()
public void removeClip()
public void setClip(Rect r)
public void setClip(int x,
int y,
int w,
int h)
public void clipRect(Rect r)
public void clipRect(int x,
int y,
int w,
int h)
public int getClipX()
public int getClipY()
public int getClipWidth()
public int getClipHeight()
public Rect getClip()
public void getClip(Rect rect)
public void setAlpha(int alpha)
public int getAlpha()
public void setColor(int argbColor)
Colorspublic int getColor()
Colors
public void drawLine(int x1,
int y1,
int x2,
int y2)
public void drawLine(double x1,
double y1,
double x2,
double y2)
public void drawLineFixedPoint(int x1,
int y1,
int x2,
int y2)
public void drawRect(int x,
int y,
int w,
int h)
Note, this method is different from java.awt.Graphics.drawRect() which draws a rectangle with a width of (w+1) and a height of (h+1).
public void fill()
fillRect(0, 0, surfaceWidth, surfaceHeight) with
the identity transform.
public void clear()
public void fillRect(int x,
int y,
int w,
int h)
public void fillRect(double x,
double y,
double w,
double h)
public void fillRectFixedPoint(int fx,
int fy,
int fw,
int fh)
public void drawString(String str)
public void drawChar(char ch,
int maxWidth)
public void drawString(String str,
int x,
int y)
public void drawScaledString(String str,
int x,
int y,
int w,
int h)
public void drawRotatedString(String str,
int x,
int y,
int w,
int h,
int angle)
public void drawRotatedString(String str,
int x,
int y,
int w,
int h,
int cosAngle,
int sinAngle)
public void drawImage(CoreImage image)
public void drawImage(CoreImage image,
int srcX,
int srcY,
int srcWidth,
int srcHeight)
public void drawImage(CoreImage image,
int x,
int y)
image - the image to draw.x - the x coordinate.y - the y coordinate.
public void drawImage(CoreImage image,
int x,
int y,
int srcX,
int srcY,
int srcWidth,
int srcHeight)
public void drawScaledImage(CoreImage image,
int x,
int y,
int w,
int h)
public void drawScaledImage(CoreImage image,
int x,
int y,
int w,
int h,
int srcX,
int srcY,
int srcWidth,
int srcHeight)
public void drawRotatedImage(CoreImage image,
int x,
int y,
int w,
int h,
int angle)
angle - a fixed-point angle, typically in the range from 0 to
2 * CoreMath.PI.
public void drawRotatedImage(CoreImage image,
int x,
int y,
int w,
int h,
int angle,
int srcX,
int srcY,
int srcWidth,
int srcHeight)
angle - a fixed-point angle, typically in the range from 0 to
2 * CoreMath.PI.
public void drawRotatedImage(CoreImage image,
int x,
int y,
int w,
int h,
int cosAngle,
int sinAngle)
cosAngle - The fixed-point cosine of the angle.sinAngle - The fixed-point sine of the angle.
public void drawRotatedImage(CoreImage image,
int x,
int y,
int w,
int h,
int cosAngle,
int sinAngle,
int srcX,
int srcY,
int srcWidth,
int srcHeight)
cosAngle - The fixed-point cosine of the angle.sinAngle - The fixed-point sine of the angle.
|
PulpCore | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||