public class PGraphics extends PImage implements PConstants
PApplet.createGraphics(int, int, String)
Modifier and Type | Field and Description |
---|---|
static int |
A |
static int |
AB |
static int |
AG |
float |
ambientB |
int |
ambientColor |
float |
ambientG |
float |
ambientR |
static int |
AR |
static int |
B |
int |
backgroundColor
Last background color that was set, zero if an image
|
static int |
BEEN_LIT |
int |
bezierDetail |
int |
colorMode
The current colorMode
|
float |
colorModeA
Max value for alpha set by colorMode
|
float |
colorModeX
Max value for red (or hue) set by colorMode
|
float |
colorModeY
Max value for green (or saturation) set by colorMode
|
float |
colorModeZ
Max value for blue (or value) set by colorMode
|
int |
curveDetail |
float |
curveTightness |
static int |
DA |
static int |
DB |
static int |
DEFAULT_VERTICES |
static int |
DG |
static int |
DR |
static int |
EB |
boolean |
edge |
static int |
EDGE |
static int |
EG |
int |
ellipseMode
The current ellipse mode (read-only)
|
float |
emissiveB |
int |
emissiveColor |
float |
emissiveG |
float |
emissiveR |
static int |
ER |
boolean |
fill
true if fill() is enabled, (read-only)
|
int |
fillColor
fill that was last set (read-only)
|
static int |
G |
static int |
HAS_NORMAL |
Image |
image
Java AWT Image object associated with this renderer.
|
int |
imageMode
The current image alignment (read-only)
|
float |
normalX
Current normal vector.
|
float |
normalY
Current normal vector.
|
float |
normalZ
Current normal vector.
|
static int |
NX |
static int |
NY |
static int |
NZ |
int |
pixelCount |
static int |
R |
int |
rectMode
The current rect mode (read-only)
|
static int |
SA |
static int |
SB |
boolean |
setAmbient |
static int |
SG |
int |
shapeMode
The current shape alignment mode (read-only)
|
static int |
SHINE |
float |
shininess |
int |
smooth |
static int |
SPB |
float |
specularB |
int |
specularColor |
float |
specularG |
float |
specularR |
static int |
SPG |
int |
sphereDetailU |
int |
sphereDetailV |
static int |
SPR |
static int |
SR
stroke argb values
|
boolean |
stroke
true if stroke() is enabled, (read-only)
|
int |
strokeCap
Set by strokeCap() (read-only).
|
int |
strokeColor
stroke that was last set (read-only)
|
int |
strokeJoin
Set by strokeJoin() (read-only).
|
float |
strokeWeight
Last value set by strokeWeight() (read-only).
|
static int |
SW
stroke weight
|
int |
textAlign
The current text align (read-only)
|
int |
textAlignY
The current vertical text alignment (read-only)
|
PFont |
textFont
The current text font (read-only)
|
float |
textLeading
The current text leading (read-only)
|
int |
textMode
The current text mode (read-only)
|
float |
textSize
The current text size (read-only)
|
PImage |
textureImage
Current image being used as a texture
|
int |
textureMode
Sets whether texture coordinates passed to
vertex() calls will be based on coordinates that are
based on the IMAGE or NORMALIZED.
|
float |
textureU
Current horizontal coordinate for texture, will always
be between 0 and 1, even if using textureMode(IMAGE).
|
float |
textureV
Current vertical coordinate for texture, see above.
|
boolean |
tint
True if tint() is enabled (read-only).
|
int |
tintColor
tint that was last set (read-only)
|
static int |
TX |
static int |
TY |
static int |
TZ |
static int |
U |
static int |
V |
static int |
VERTEX_FIELD_COUNT |
static int |
VW |
static int |
VX |
static int |
VY |
static int |
VZ |
ALPHA_MASK, BLUE_MASK, format, GREEN_MASK, height, loaded, parent, pixelDensity, pixelHeight, pixels, pixelWidth, RED_MASK, width
ADD, ALPHA, ALT, AMBIENT, ARC, ARGB, ARROW, BACKSPACE, BASELINE, BEVEL, BEZIER_VERTEX, BLEND, BLUR, BOTTOM, BOX, BREAK, BURN, CENTER, CHATTER, CHORD, CLAMP, CLOSE, CODED, COMPLAINT, CONTROL, CORNER, CORNERS, CROSS, CURVE_VERTEX, CUSTOM, DARKEST, DEG_TO_RAD, DELETE, DIAMETER, DIFFERENCE, DILATE, DIRECTIONAL, DISABLE_ASYNC_SAVEFRAME, DISABLE_BUFFER_READING, DISABLE_DEPTH_MASK, DISABLE_DEPTH_SORT, DISABLE_DEPTH_TEST, DISABLE_KEY_REPEAT, DISABLE_NATIVE_FONTS, DISABLE_OPENGL_ERRORS, DISABLE_OPTIMIZED_STROKE, DISABLE_STROKE_PERSPECTIVE, DISABLE_STROKE_PURE, DISABLE_TEXTURE_MIPMAPS, DODGE, DOWN, DXF, ELLIPSE, ENABLE_ASYNC_SAVEFRAME, ENABLE_BUFFER_READING, ENABLE_DEPTH_MASK, ENABLE_DEPTH_SORT, ENABLE_DEPTH_TEST, ENABLE_KEY_REPEAT, ENABLE_NATIVE_FONTS, ENABLE_OPENGL_ERRORS, ENABLE_OPTIMIZED_STROKE, ENABLE_STROKE_PERSPECTIVE, ENABLE_STROKE_PURE, ENABLE_TEXTURE_MIPMAPS, ENTER, EPSILON, ERODE, ESC, EXCLUSION, FX2D, GIF, GRAY, GROUP, HALF_PI, HAND, HARD_LIGHT, HINT_COUNT, HSB, IMAGE, INVERT, JAVA2D, JPEG, LANDSCAPE, LEFT, LIGHTEST, LINE, LINE_LOOP, LINE_STRIP, LINES, LINUX, MACOSX, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MITER, MODEL, MODELVIEW, MOVE, MULTIPLY, NORMAL, OPAQUE, OPEN, OPENGL, ORTHOGRAPHIC, OTHER, OVERLAY, P2D, P3D, PATH, PDF, PERSPECTIVE, PI, PIE, platformNames, POINT, POINTS, POLYGON, PORTRAIT, POSTERIZE, PROBLEM, PROJECT, PROJECTION, QUAD, QUAD_BEZIER_VERTEX, QUAD_STRIP, QUADRATIC_VERTEX, QUADS, QUARTER_PI, RAD_TO_DEG, RADIUS, RECT, REPEAT, REPLACE, RETURN, RGB, RIGHT, ROUND, SCREEN, SHAPE, SHIFT, SOFT_LIGHT, SPAN, SPHERE, SPOT, SQUARE, SUBTRACT, SVG, TAB, TARGA, TAU, TEXT, THIRD_PI, THRESHOLD, TIFF, TOP, TRIANGLE, TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP, VERTEX, WAIT, WHITESPACE, WINDOWS, X, Y, Z
Constructor and Description |
---|
PGraphics() |
Modifier and Type | Method and Description |
---|---|
float |
alpha(int rgb)
( begin auto-generated from alpha.xml )
Extracts the alpha value from a color.
|
void |
ambient(float gray) |
void |
ambient(float v1,
float v2,
float v3) |
void |
ambient(int rgb)
( begin auto-generated from ambient.xml )
Sets the ambient reflectance for shapes drawn to the screen.
|
void |
ambientLight(float v1,
float v2,
float v3)
( begin auto-generated from ambientLight.xml )
Adds an ambient light.
|
void |
ambientLight(float v1,
float v2,
float v3,
float x,
float y,
float z) |
void |
applyMatrix(float n00,
float n01,
float n02,
float n10,
float n11,
float n12) |
void |
applyMatrix(float n00,
float n01,
float n02,
float n03,
float n10,
float n11,
float n12,
float n13,
float n20,
float n21,
float n22,
float n23,
float n30,
float n31,
float n32,
float n33) |
void |
applyMatrix(PMatrix source)
( begin auto-generated from applyMatrix.xml )
Multiplies the current matrix by the one specified through the
parameters.
|
void |
applyMatrix(PMatrix2D source) |
void |
applyMatrix(PMatrix3D source) |
void |
arc(float a,
float b,
float c,
float d,
float start,
float stop)
( begin auto-generated from arc.xml )
Draws an arc in the display window.
|
void |
arc(float a,
float b,
float c,
float d,
float start,
float stop,
int mode) |
void |
attrib(String name,
boolean... values) |
void |
attrib(String name,
float... values) |
void |
attrib(String name,
int... values) |
void |
attribColor(String name,
int color) |
void |
attribNormal(String name,
float nx,
float ny,
float nz) |
void |
attribPosition(String name,
float x,
float y,
float z) |
void |
background(float gray) |
void |
background(float gray,
float alpha) |
void |
background(float v1,
float v2,
float v3) |
void |
background(float v1,
float v2,
float v3,
float alpha) |
void |
background(int rgb)
( begin auto-generated from background.xml )
The background() function sets the color used for the background
of the Processing window.
|
void |
background(int rgb,
float alpha) |
void |
background(PImage image)
Takes an RGB or ARGB image and sets it as the background.
|
void |
beginCamera()
( begin auto-generated from beginCamera.xml )
The beginCamera() and endCamera() functions enable
advanced customization of the camera space.
|
void |
beginContour() |
void |
beginDraw()
( begin auto-generated from PGraphics_beginDraw.xml )
Sets the default properties for a PGraphics object.
|
PGL |
beginPGL() |
void |
beginRaw(PGraphics rawGraphics)
Record individual lines and triangles by echoing them to another renderer.
|
void |
beginShape()
Start a new shape of type POLYGON
|
void |
beginShape(int kind)
( begin auto-generated from beginShape.xml )
Using the beginShape() and endShape() functions allow
creating more complex forms.
|
void |
bezier(float x1,
float y1,
float x2,
float y2,
float x3,
float y3,
float x4,
float y4) |
void |
bezier(float x1,
float y1,
float z1,
float x2,
float y2,
float z2,
float x3,
float y3,
float z3,
float x4,
float y4,
float z4)
( begin auto-generated from bezier.xml )
Draws a Bezier curve on the screen.
|
void |
bezierDetail(int detail)
( begin auto-generated from bezierDetail.xml )
Sets the resolution at which Beziers display.
|
float |
bezierPoint(float a,
float b,
float c,
float d,
float t)
( begin auto-generated from bezierPoint.xml )
Evaluates the Bezier at point t for points a, b, c, d.
|
float |
bezierTangent(float a,
float b,
float c,
float d,
float t)
( begin auto-generated from bezierTangent.xml )
Calculates the tangent of a point on a Bezier curve.
|
void |
bezierVertex(float x2,
float y2,
float x3,
float y3,
float x4,
float y4) |
void |
bezierVertex(float x2,
float y2,
float z2,
float x3,
float y3,
float z3,
float x4,
float y4,
float z4)
( begin auto-generated from bezierVertex.xml )
Specifies vertex coordinates for Bezier curves.
|
void |
blendMode(int mode)
( begin auto-generated from blendMode.xml )
This is a new reference entry for Processing 2.0.
|
float |
blue(int rgb)
( begin auto-generated from blue.xml )
Extracts the blue value from a color, scaled to match current
colorMode().
|
void |
box(float size)
( begin auto-generated from box.xml )
A box is an extruded rectangle.
|
void |
box(float w,
float h,
float d) |
float |
brightness(int rgb)
( begin auto-generated from brightness.xml )
Extracts the brightness value from a color.
|
void |
camera()
( begin auto-generated from camera.xml )
Sets the position of the camera through setting the eye position, the
center of the scene, and which axis is facing upward.
|
void |
camera(float eyeX,
float eyeY,
float eyeZ,
float centerX,
float centerY,
float centerZ,
float upX,
float upY,
float upZ) |
void |
circle(float x,
float y,
float extent)
( begin auto-generated from circle.xml )
Draws a circle to the screen.
|
void |
clear() |
void |
clip(float a,
float b,
float c,
float d)
( begin auto-generated from clip.xml )
Limits the rendering to the boundaries of a rectangle defined
by the parameters.
|
int |
color(float gray) |
int |
color(float gray,
float alpha) |
int |
color(float v1,
float v2,
float v3) |
int |
color(float v1,
float v2,
float v3,
float a) |
int |
color(int c) |
int |
color(int c,
float alpha) |
int |
color(int c,
int alpha) |
int |
color(int v1,
int v2,
int v3) |
int |
color(int v1,
int v2,
int v3,
int a) |
void |
colorMode(int mode)
( begin auto-generated from colorMode.xml )
Changes the way Processing interprets color data.
|
void |
colorMode(int mode,
float max) |
void |
colorMode(int mode,
float max1,
float max2,
float max3) |
void |
colorMode(int mode,
float max1,
float max2,
float max3,
float maxA) |
PShape |
createShape() |
PShape |
createShape(int type) |
PShape |
createShape(int kind,
float... p) |
PSurface |
createSurface() |
void |
curve(float x1,
float y1,
float x2,
float y2,
float x3,
float y3,
float x4,
float y4)
( begin auto-generated from curve.xml )
Draws a curved line on the screen.
|
void |
curve(float x1,
float y1,
float z1,
float x2,
float y2,
float z2,
float x3,
float y3,
float z3,
float x4,
float y4,
float z4) |
void |
curveDetail(int detail)
( begin auto-generated from curveDetail.xml )
Sets the resolution at which curves display.
|
float |
curvePoint(float a,
float b,
float c,
float d,
float t)
( begin auto-generated from curvePoint.xml )
Evalutes the curve at point t for points a, b, c, d.
|
float |
curveTangent(float a,
float b,
float c,
float d,
float t)
( begin auto-generated from curveTangent.xml )
Calculates the tangent of a point on a curve.
|
void |
curveTightness(float tightness)
( begin auto-generated from curveTightness.xml )
Modifies the quality of forms created with curve() and
curveVertex().
|
void |
curveVertex(float x,
float y)
( begin auto-generated from curveVertex.xml )
Specifies vertex coordinates for curves.
|
void |
curveVertex(float x,
float y,
float z) |
void |
directionalLight(float v1,
float v2,
float v3,
float nx,
float ny,
float nz)
( begin auto-generated from directionalLight.xml )
Adds a directional light.
|
boolean |
displayable()
Return true if this renderer should be drawn to the screen.
|
void |
dispose()
Handle any takedown for this graphics context.
|
void |
edge(boolean edge)
Sets whether the upcoming vertex is part of an edge.
|
void |
ellipse(float a,
float b,
float c,
float d)
( begin auto-generated from ellipse.xml )
Draws an ellipse (oval) in the display window.
|
void |
ellipseMode(int mode)
( begin auto-generated from ellipseMode.xml )
The origin of the ellipse is modified by the ellipseMode()
function.
|
void |
emissive(float gray)
gray number specifying value between white and black
|
void |
emissive(float v1,
float v2,
float v3) |
void |
emissive(int rgb)
( begin auto-generated from emissive.xml )
Sets the emissive color of the material used for drawing shapes drawn to
the screen.
|
void |
endCamera()
( begin auto-generated from endCamera.xml )
The beginCamera() and endCamera() functions enable
advanced customization of the camera space.
|
void |
endContour() |
void |
endDraw()
( begin auto-generated from PGraphics_endDraw.xml )
Finalizes the rendering of a PGraphics object so that it can be shown on screen.
|
void |
endPGL() |
void |
endRaw() |
void |
endShape() |
void |
endShape(int mode)
( begin auto-generated from endShape.xml )
The endShape() function is the companion to beginShape()
and may only be called after beginShape().
|
void |
fill(float gray) |
void |
fill(float gray,
float alpha) |
void |
fill(float v1,
float v2,
float v3) |
void |
fill(float v1,
float v2,
float v3,
float alpha) |
void |
fill(int rgb)
( begin auto-generated from fill.xml )
Sets the color used to fill shapes.
|
void |
fill(int rgb,
float alpha) |
void |
filter(PShader shader) |
void |
flush() |
void |
frustum(float left,
float right,
float bottom,
float top,
float near,
float far)
( begin auto-generated from frustum.xml )
Sets a perspective matrix defined through the parameters.
|
Object |
getCache(PImage image)
Get cache storage data for the specified renderer.
|
PMatrix |
getMatrix() |
PMatrix2D |
getMatrix(PMatrix2D target)
Copy the current transformation matrix into the specified target.
|
PMatrix3D |
getMatrix(PMatrix3D target)
Copy the current transformation matrix into the specified target.
|
PGraphics |
getRaw() |
PStyle |
getStyle() |
PStyle |
getStyle(PStyle s) |
float |
green(int rgb)
( begin auto-generated from green.xml )
Extracts the green value from a color, scaled to match current
colorMode().
|
boolean |
haveRaw() |
void |
hint(int which)
( begin auto-generated from hint.xml )
Set various hints and hacks for the renderer.
|
float |
hue(int rgb)
( begin auto-generated from hue.xml )
Extracts the hue value from a color.
|
void |
image(PImage img,
float a,
float b)
( begin auto-generated from image.xml )
Displays images to the screen.
|
void |
image(PImage img,
float a,
float b,
float c,
float d) |
void |
image(PImage img,
float a,
float b,
float c,
float d,
int u1,
int v1,
int u2,
int v2)
Draw an image(), also specifying u/v coordinates.
|
void |
imageMode(int mode)
( begin auto-generated from imageMode.xml )
Modifies the location from which images draw.
|
boolean |
is2D()
Return true if this renderer supports 2D drawing.
|
boolean |
is2X() |
boolean |
is3D()
Return true if this renderer supports 3D drawing.
|
boolean |
isGL()
Return true if this renderer does rendering through OpenGL.
|
int |
lerpColor(int c1,
int c2,
float amt)
( begin auto-generated from lerpColor.xml )
Calculates a color or colors between two color at a specific increment.
|
static int |
lerpColor(int c1,
int c2,
float amt,
int mode) |
void |
lightFalloff(float constant,
float linear,
float quadratic)
( begin auto-generated from lightFalloff.xml )
Sets the falloff rates for point lights, spot lights, and ambient
lights.
|
void |
lights()
( begin auto-generated from lights.xml )
Sets the default ambient light, directional light, falloff, and specular
values.
|
void |
lightSpecular(float v1,
float v2,
float v3)
( begin auto-generated from lightSpecular.xml )
Sets the specular color for lights.
|
void |
line(float x1,
float y1,
float x2,
float y2)
( begin auto-generated from line.xml )
Draws a line (a direct path between two points) to the screen.
|
void |
line(float x1,
float y1,
float z1,
float x2,
float y2,
float z2) |
PShader |
loadShader(String fragFilename)
( begin auto-generated from loadShader.xml )
This is a new reference entry for Processing 2.0.
|
PShader |
loadShader(String fragFilename,
String vertFilename) |
PShape |
loadShape(String filename) |
PShape |
loadShape(String filename,
String options) |
float |
modelX(float x,
float y,
float z)
( begin auto-generated from modelX.xml )
Returns the three-dimensional X, Y, Z position in model space.
|
float |
modelY(float x,
float y,
float z)
( begin auto-generated from modelY.xml )
Returns the three-dimensional X, Y, Z position in model space.
|
float |
modelZ(float x,
float y,
float z)
( begin auto-generated from modelZ.xml )
Returns the three-dimensional X, Y, Z position in model space.
|
void |
noClip()
( begin auto-generated from noClip.xml )
Disables the clipping previously started by the clip() function.
|
void |
noFill()
( begin auto-generated from noFill.xml )
Disables filling geometry.
|
void |
noLights()
( begin auto-generated from noLights.xml )
Disable all lighting.
|
void |
normal(float nx,
float ny,
float nz)
( begin auto-generated from normal.xml )
Sets the current normal vector.
|
void |
noSmooth() |
void |
noStroke()
( begin auto-generated from noStroke.xml )
Disables drawing the stroke (outline).
|
void |
noTexture()
Removes texture image for current shape.
|
void |
noTint()
( begin auto-generated from noTint.xml )
Removes the current fill value for displaying images and reverts to
displaying images with their original hues.
|
void |
ortho()
( begin auto-generated from ortho.xml )
Sets an orthographic projection and defines a parallel clipping volume.
|
void |
ortho(float left,
float right,
float bottom,
float top) |
void |
ortho(float left,
float right,
float bottom,
float top,
float near,
float far) |
void |
perspective()
( begin auto-generated from perspective.xml )
Sets a perspective projection applying foreshortening, making distant
objects appear smaller than closer ones.
|
void |
perspective(float fovy,
float aspect,
float zNear,
float zFar) |
void |
point(float x,
float y)
( begin auto-generated from point.xml )
Draws a point, a coordinate in space at the dimension of one pixel.
|
void |
point(float x,
float y,
float z) |
void |
pointLight(float v1,
float v2,
float v3,
float x,
float y,
float z)
( begin auto-generated from pointLight.xml )
Adds a point light.
|
void |
pop()
( begin auto-generated from pop.xml )
The pop() function restores the previous drawing style
settings and transformations after push() has changed them.
|
void |
popMatrix()
( begin auto-generated from popMatrix.xml )
Pops the current transformation matrix off the matrix stack.
|
void |
popStyle()
( begin auto-generated from popStyle.xml )
The pushStyle() function saves the current style settings and
popStyle() restores the prior settings; these functions are
always used together.
|
void |
printCamera()
( begin auto-generated from printCamera.xml )
Prints the current camera matrix to the Console (the text window at the
bottom of Processing).
|
void |
printMatrix()
( begin auto-generated from printMatrix.xml )
Prints the current matrix to the Console (the text window at the bottom
of Processing).
|
void |
printProjection()
( begin auto-generated from printProjection.xml )
Prints the current projection matrix to the Console (the text window at
the bottom of Processing).
|
void |
push()
( begin auto-generated from push.xml )
The push() function saves the current drawing style
settings and transformations, while pop() restores these
settings.
|
void |
pushMatrix()
( begin auto-generated from pushMatrix.xml )
Pushes the current transformation matrix onto the matrix stack.
|
void |
pushStyle()
( begin auto-generated from pushStyle.xml )
The pushStyle() function saves the current style settings and
popStyle() restores the prior settings.
|
void |
quad(float x1,
float y1,
float x2,
float y2,
float x3,
float y3,
float x4,
float y4)
( begin auto-generated from quad.xml )
A quad is a quadrilateral, a four sided polygon.
|
void |
quadraticVertex(float cx,
float cy,
float x3,
float y3) |
void |
quadraticVertex(float cx,
float cy,
float cz,
float x3,
float y3,
float z3) |
void |
rect(float a,
float b,
float c,
float d)
( begin auto-generated from rect.xml )
Draws a rectangle to the screen.
|
void |
rect(float a,
float b,
float c,
float d,
float r) |
void |
rect(float a,
float b,
float c,
float d,
float tl,
float tr,
float br,
float bl) |
void |
rectMode(int mode)
( begin auto-generated from rectMode.xml )
Modifies the location from which rectangles draw.
|
float |
red(int rgb)
( begin auto-generated from red.xml )
Extracts the red value from a color, scaled to match current
colorMode().
|
void |
removeCache(PImage image)
Remove information associated with this renderer from the cache, if any.
|
void |
resetMatrix()
( begin auto-generated from resetMatrix.xml )
Replaces the current matrix with the identity matrix.
|
void |
resetShader()
( begin auto-generated from resetShader.xml )
This is a new reference entry for Processing 2.0.
|
void |
resetShader(int kind) |
void |
rotate(float angle)
( begin auto-generated from rotate.xml )
Rotates a shape the amount specified by the angle parameter.
|
void |
rotate(float angle,
float x,
float y,
float z)
Advanced
|
void |
rotateX(float angle)
( begin auto-generated from rotateX.xml )
Rotates a shape around the x-axis the amount specified by the
angle parameter.
|
void |
rotateY(float angle)
( begin auto-generated from rotateY.xml )
Rotates a shape around the y-axis the amount specified by the
angle parameter.
|
void |
rotateZ(float angle)
( begin auto-generated from rotateZ.xml )
Rotates a shape around the z-axis the amount specified by the
angle parameter.
|
float |
saturation(int rgb)
( begin auto-generated from saturation.xml )
Extracts the saturation value from a color.
|
boolean |
save(String filename)
( begin auto-generated from PImage_save.xml )
Saves the image into a file.
|
void |
scale(float s)
( begin auto-generated from scale.xml )
Increases or decreases the size of a shape by expanding and contracting
vertices.
|
void |
scale(float x,
float y)
Advanced
|
void |
scale(float x,
float y,
float z) |
float |
screenX(float x,
float y)
( begin auto-generated from screenX.xml )
Takes a three-dimensional X, Y, Z position and returns the X value for
where it will appear on a (two-dimensional) screen.
|
float |
screenX(float x,
float y,
float z) |
float |
screenY(float x,
float y)
( begin auto-generated from screenY.xml )
Takes a three-dimensional X, Y, Z position and returns the Y value for
where it will appear on a (two-dimensional) screen.
|
float |
screenY(float x,
float y,
float z) |
float |
screenZ(float x,
float y,
float z)
( begin auto-generated from screenZ.xml )
Takes a three-dimensional X, Y, Z position and returns the Z value for
where it will appear on a (two-dimensional) screen.
|
void |
setCache(PImage image,
Object storage)
Store data of some kind for the renderer that requires extra metadata of
some kind.
|
void |
setMatrix(PMatrix source)
Set the current transformation matrix to the contents of another.
|
void |
setMatrix(PMatrix2D source)
Set the current transformation to the contents of the specified source.
|
void |
setMatrix(PMatrix3D source)
Set the current transformation to the contents of the specified source.
|
void |
setParent(PApplet parent) |
void |
setPath(String path) |
void |
setPrimary(boolean primary)
Set (or unset) this as the main drawing surface.
|
void |
setSize(int w,
int h)
The final step in setting up a renderer, set its size of this renderer.
|
void |
shader(PShader shader)
( begin auto-generated from shader.xml )
This is a new reference entry for Processing 2.0.
|
void |
shader(PShader shader,
int kind) |
void |
shape(PShape shape) |
void |
shape(PShape shape,
float x,
float y)
( begin auto-generated from shape.xml )
Displays shapes to the screen.
|
void |
shape(PShape shape,
float a,
float b,
float c,
float d) |
void |
shapeMode(int mode)
( begin auto-generated from shapeMode.xml )
Modifies the location from which shapes draw.
|
void |
shearX(float angle)
( begin auto-generated from shearX.xml )
Shears a shape around the x-axis the amount specified by the
angle parameter.
|
void |
shearY(float angle)
( begin auto-generated from shearY.xml )
Shears a shape around the y-axis the amount specified by the
angle parameter.
|
void |
shininess(float shine)
( begin auto-generated from shininess.xml )
Sets the amount of gloss in the surface of shapes.
|
static void |
showDepthWarning(String method)
Display a warning that the specified method is only available with 3D.
|
static void |
showDepthWarningXYZ(String method)
Display a warning that the specified method that takes x, y, z parameters
can only be used with x and y parameters in this renderer.
|
static void |
showException(String msg)
Show an renderer-related exception that halts the program.
|
static void |
showMethodWarning(String method)
Display a warning that the specified method is simply unavailable.
|
static void |
showMissingWarning(String method)
Display a warning that the specified method is not implemented, meaning
that it could be either a completely missing function, although other
variations of it may still work properly.
|
static void |
showVariationWarning(String str)
Error that a particular variation of a method is unavailable (even though
other variations are).
|
static void |
showWarning(String msg)
Show a renderer error, and keep track of it so that it's only shown once.
|
static void |
showWarning(String msg,
Object... args)
Version of showWarning() that takes a parsed String.
|
void |
smooth() |
void |
smooth(int quality) |
void |
specular(float gray)
gray number specifying value between white and black
|
void |
specular(float v1,
float v2,
float v3) |
void |
specular(int rgb)
( begin auto-generated from specular.xml )
Sets the specular color of the materials used for shapes drawn to the
screen, which sets the color of hightlights.
|
void |
sphere(float r)
( begin auto-generated from sphere.xml )
A sphere is a hollow ball made from tessellated triangles.
|
void |
sphereDetail(int res)
( begin auto-generated from sphereDetail.xml )
Controls the detail used to render a sphere by adjusting the number of
vertices of the sphere mesh.
|
void |
sphereDetail(int ures,
int vres) |
void |
spotLight(float v1,
float v2,
float v3,
float x,
float y,
float z,
float nx,
float ny,
float nz,
float angle,
float concentration)
( begin auto-generated from spotLight.xml )
Adds a spot light.
|
void |
square(float x,
float y,
float extent)
( begin auto-generated from square.xml )
Draws a square to the screen.
|
void |
stroke(float gray) |
void |
stroke(float gray,
float alpha) |
void |
stroke(float v1,
float v2,
float v3) |
void |
stroke(float v1,
float v2,
float v3,
float alpha) |
void |
stroke(int rgb)
( begin auto-generated from stroke.xml )
Sets the color used to draw lines and borders around shapes.
|
void |
stroke(int rgb,
float alpha) |
void |
strokeCap(int cap)
( begin auto-generated from strokeCap.xml )
Sets the style for rendering line endings.
|
void |
strokeJoin(int join)
( begin auto-generated from strokeJoin.xml )
Sets the style of the joints which connect line segments.
|
void |
strokeWeight(float weight)
( begin auto-generated from strokeWeight.xml )
Sets the width of the stroke used for lines, points, and the border
around shapes.
|
void |
style(PStyle s) |
void |
text(char[] chars,
int start,
int stop,
float x,
float y)
Advanced
|
void |
text(char[] chars,
int start,
int stop,
float x,
float y,
float z) |
void |
text(char c,
float x,
float y)
( begin auto-generated from text.xml )
Draws text to the screen.
|
void |
text(char c,
float x,
float y,
float z) |
void |
text(float num,
float x,
float y)
This does a basic number formatting, to avoid the
generally ugly appearance of printing floats.
|
void |
text(float num,
float x,
float y,
float z) |
void |
text(int num,
float x,
float y) |
void |
text(int num,
float x,
float y,
float z) |
void |
text(String str,
float x,
float y)
Advanced
|
void |
text(String str,
float x,
float y,
float z)
Same as above but with a z coordinate.
|
void |
text(String str,
float x1,
float y1,
float x2,
float y2)
Advanced
|
void |
textAlign(int alignX) |
void |
textAlign(int alignX,
int alignY)
( begin auto-generated from textAlign.xml )
Sets the current alignment for drawing text.
|
float |
textAscent()
( begin auto-generated from textAscent.xml )
Returns ascent of the current font at its current size.
|
float |
textDescent()
( begin auto-generated from textDescent.xml )
Returns descent of the current font at its current size.
|
void |
textFont(PFont which)
( begin auto-generated from textFont.xml )
Sets the current font that will be drawn with the text()
function.
|
void |
textFont(PFont which,
float size) |
void |
textLeading(float leading)
( begin auto-generated from textLeading.xml )
Sets the spacing between lines of text in units of pixels.
|
void |
textMode(int mode)
( begin auto-generated from textMode.xml )
Sets the way text draws to the screen.
|
void |
textSize(float size)
( begin auto-generated from textSize.xml )
Sets the current font size.
|
void |
texture(PImage image)
( begin auto-generated from texture.xml )
Sets a texture to be applied to vertex points.
|
void |
textureMode(int mode)
( begin auto-generated from textureMode.xml )
Sets the coordinate space for texture mapping.
|
void |
textureWrap(int wrap)
( begin auto-generated from textureWrap.xml )
Description to come...
|
float |
textWidth(char c) |
float |
textWidth(char[] chars,
int start,
int length) |
float |
textWidth(String str)
( begin auto-generated from textWidth.xml )
Calculates and returns the width of any character or text string.
|
void |
tint(float gray) |
void |
tint(float gray,
float alpha) |
void |
tint(float v1,
float v2,
float v3) |
void |
tint(float v1,
float v2,
float v3,
float alpha) |
void |
tint(int rgb)
( begin auto-generated from tint.xml )
Sets the fill value for displaying images.
|
void |
tint(int rgb,
float alpha) |
void |
translate(float x,
float y)
( begin auto-generated from translate.xml )
Specifies an amount to displace objects within the display window.
|
void |
translate(float x,
float y,
float z) |
void |
triangle(float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
( begin auto-generated from triangle.xml )
A triangle is a plane created by connecting three points.
|
void |
vertex(float[] v)
Used by renderer subclasses or PShape to efficiently pass in already
formatted vertex information.
|
void |
vertex(float x,
float y) |
void |
vertex(float x,
float y,
float z) |
void |
vertex(float x,
float y,
float u,
float v) |
void |
vertex(float x,
float y,
float z,
float u,
float v)
( begin auto-generated from vertex.xml )
All shapes are constructed by connecting a series of vertices.
|
blend, blend, blendColor, clone, copy, copy, copy, filter, filter, get, get, get, getImage, getModifiedX1, getModifiedX2, getModifiedY1, getModifiedY2, getNative, init, init, isLoaded, isModified, loadPixels, mask, mask, resize, set, set, setLoaded, setLoaded, setModified, setModified, updatePixels, updatePixels
public int pixelCount
public int smooth
public static final int R
public static final int G
public static final int B
public static final int A
public static final int U
public static final int V
public static final int NX
public static final int NY
public static final int NZ
public static final int EDGE
public static final int SR
public static final int SG
public static final int SB
public static final int SA
public static final int SW
public static final int TX
public static final int TY
public static final int TZ
public static final int VX
public static final int VY
public static final int VZ
public static final int VW
public static final int AR
public static final int AG
public static final int AB
public static final int DR
public static final int DG
public static final int DB
public static final int DA
public static final int SPR
public static final int SPG
public static final int SPB
public static final int SHINE
public static final int ER
public static final int EG
public static final int EB
public static final int BEEN_LIT
public static final int HAS_NORMAL
public static final int VERTEX_FIELD_COUNT
public int colorMode
public float colorModeX
public float colorModeY
public float colorModeZ
public float colorModeA
public boolean tint
public int tintColor
public boolean fill
public int fillColor
public boolean stroke
public int strokeColor
public float strokeWeight
public int strokeJoin
public int strokeCap
public int rectMode
public int ellipseMode
public int shapeMode
public int imageMode
public PFont textFont
public int textAlign
public int textAlignY
public int textMode
public float textSize
public float textLeading
public int ambientColor
public float ambientR
public float ambientG
public float ambientB
public boolean setAmbient
public int specularColor
public float specularR
public float specularG
public float specularB
public int emissiveColor
public float emissiveR
public float emissiveG
public float emissiveB
public float shininess
public int backgroundColor
public Image image
public static final int DEFAULT_VERTICES
public int bezierDetail
public int curveDetail
public float curveTightness
public boolean edge
public float normalX
public float normalY
public float normalZ
public int textureMode
public float textureU
public float textureV
public PImage textureImage
public int sphereDetailU
public int sphereDetailV
public void setParent(PApplet parent)
public void setPrimary(boolean primary)
public void setPath(String path)
public void setSize(int w, int h)
public void dispose()
This is called when a sketch is shut down and this renderer was specified using the size() command, or inside endRecord() and endRaw(), in order to shut things off.
public PSurface createSurface()
public void setCache(PImage image, Object storage)
image
- The image to be storedstorage
- The metadata required by the rendererpublic Object getCache(PImage image)
public void removeCache(PImage image)
image
- The image whose cache data should be removedpublic void beginDraw()
public void endDraw()
public PGL beginPGL()
public void endPGL()
public void flush()
public void hint(int which)
which
- name of the hint to be enabled or disabledPGraphics
,
PApplet.createGraphics(int, int, String, String)
,
PApplet.size(int, int)
public void beginShape()
public void beginShape(int kind)
kind
- Either POINTS, LINES, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, QUADS, or QUAD_STRIPPShape
,
endShape()
,
vertex(float, float, float, float, float)
,
curveVertex(float, float, float)
,
bezierVertex(float, float, float, float, float, float, float, float, float)
public void edge(boolean edge)
public void normal(float nx, float ny, float nz)
nx
- x directionny
- y directionnz
- z directionbeginShape(int)
,
endShape(int)
,
lights()
public void attribPosition(String name, float x, float y, float z)
public void attribNormal(String name, float nx, float ny, float nz)
public void attribColor(String name, int color)
public void attrib(String name, float... values)
public void attrib(String name, int... values)
public void attrib(String name, boolean... values)
public void textureMode(int mode)
mode
- either IMAGE or NORMALtexture(PImage)
,
textureWrap(int)
public void textureWrap(int wrap)
wrap
- Either CLAMP (default) or REPEATtexture(PImage)
,
textureMode(int)
public void texture(PImage image)
image
- reference to a PImage objecttextureMode(int)
,
textureWrap(int)
,
beginShape(int)
,
endShape(int)
,
vertex(float, float, float, float, float)
public void noTexture()
public void vertex(float x, float y)
public void vertex(float x, float y, float z)
public void vertex(float[] v)
v
- vertex parameters, as a float array of length VERTEX_FIELD_COUNTpublic void vertex(float x, float y, float u, float v)
public void vertex(float x, float y, float z, float u, float v)
x
- x-coordinate of the vertexy
- y-coordinate of the vertexz
- z-coordinate of the vertexu
- horizontal coordinate for the texture mappingv
- vertical coordinate for the texture mappingbeginShape(int)
,
endShape(int)
,
bezierVertex(float, float, float, float, float, float, float, float, float)
,
quadraticVertex(float, float, float, float, float, float)
,
curveVertex(float, float, float)
,
texture(PImage)
public void beginContour()
public void endContour()
public void endShape()
public void endShape(int mode)
mode
- use CLOSE to close the shapePShape
,
beginShape(int)
public PShape loadShape(String filename)
filename
- name of file to load, can be .svg or .objPShape
,
PApplet.createShape()
public PShape loadShape(String filename, String options)
public PShape createShape()
PShape
,
PShape.endShape()
,
PApplet.loadShape(String)
public PShape createShape(int type)
public PShape createShape(int kind, float... p)
kind
- either POINT, LINE, TRIANGLE, QUAD, RECT, ELLIPSE, ARC, BOX, SPHEREp
- parameters that match the kind of shapepublic PShader loadShader(String fragFilename)
fragFilename
- name of fragment shader filepublic PShader loadShader(String fragFilename, String vertFilename)
vertFilename
- name of vertex shader filepublic void shader(PShader shader)
shader
- name of shader filepublic void shader(PShader shader, int kind)
kind
- type of shader, either POINTS, LINES, or TRIANGLESpublic void resetShader()
public void resetShader(int kind)
kind
- type of shader, either POINTS, LINES, or TRIANGLESpublic void filter(PShader shader)
shader
- the fragment shader to applypublic void clip(float a, float b, float c, float d)
a
- x-coordinate of the rectangle, by defaultb
- y-coordinate of the rectangle, by defaultc
- width of the rectangle, by defaultd
- height of the rectangle, by defaultpublic void noClip()
public void blendMode(int mode)
mode
- the blending mode to usepublic void bezierVertex(float x2, float y2, float x3, float y3, float x4, float y4)
public void bezierVertex(float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4)
x2
- the x-coordinate of the 1st control pointy2
- the y-coordinate of the 1st control pointz2
- the z-coordinate of the 1st control pointx3
- the x-coordinate of the 2nd control pointy3
- the y-coordinate of the 2nd control pointz3
- the z-coordinate of the 2nd control pointx4
- the x-coordinate of the anchor pointy4
- the y-coordinate of the anchor pointz4
- the z-coordinate of the anchor pointcurveVertex(float, float, float)
,
vertex(float, float, float, float, float)
,
quadraticVertex(float, float, float, float, float, float)
,
bezier(float, float, float, float, float, float, float, float, float, float, float, float)
public void quadraticVertex(float cx, float cy, float x3, float y3)
cx
- the x-coordinate of the control pointcy
- the y-coordinate of the control pointx3
- the x-coordinate of the anchor pointy3
- the y-coordinate of the anchor pointcurveVertex(float, float, float)
,
vertex(float, float, float, float, float)
,
bezierVertex(float, float, float, float, float, float)
,
bezier(float, float, float, float, float, float, float, float, float, float, float, float)
public void quadraticVertex(float cx, float cy, float cz, float x3, float y3, float z3)
cz
- the z-coordinate of the control pointz3
- the z-coordinate of the anchor pointpublic void curveVertex(float x, float y)
x
- the x-coordinate of the vertexy
- the y-coordinate of the vertexcurve(float, float, float, float, float, float, float, float, float, float, float, float)
,
beginShape(int)
,
endShape(int)
,
vertex(float, float, float, float, float)
,
bezier(float, float, float, float, float, float, float, float, float, float, float, float)
,
quadraticVertex(float, float, float, float, float, float)
public void curveVertex(float x, float y, float z)
z
- the z-coordinate of the vertexpublic void point(float x, float y)
x
- x-coordinate of the pointy
- y-coordinate of the pointstroke(int)
public void point(float x, float y, float z)
z
- z-coordinate of the pointpublic void line(float x1, float y1, float x2, float y2)
x1
- x-coordinate of the first pointy1
- y-coordinate of the first pointx2
- x-coordinate of the second pointy2
- y-coordinate of the second pointstrokeWeight(float)
,
strokeJoin(int)
,
strokeCap(int)
,
beginShape()
public void line(float x1, float y1, float z1, float x2, float y2, float z2)
z1
- z-coordinate of the first pointz2
- z-coordinate of the second pointpublic void triangle(float x1, float y1, float x2, float y2, float x3, float y3)
x1
- x-coordinate of the first pointy1
- y-coordinate of the first pointx2
- x-coordinate of the second pointy2
- y-coordinate of the second pointx3
- x-coordinate of the third pointy3
- y-coordinate of the third pointPApplet.beginShape()
public void quad(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
x1
- x-coordinate of the first cornery1
- y-coordinate of the first cornerx2
- x-coordinate of the second cornery2
- y-coordinate of the second cornerx3
- x-coordinate of the third cornery3
- y-coordinate of the third cornerx4
- x-coordinate of the fourth cornery4
- y-coordinate of the fourth cornerpublic void rectMode(int mode)
mode
- either CORNER, CORNERS, CENTER, or RADIUSrect(float, float, float, float)
public void rect(float a, float b, float c, float d)
a
- x-coordinate of the rectangle by defaultb
- y-coordinate of the rectangle by defaultc
- width of the rectangle by defaultd
- height of the rectangle by defaultrectMode(int)
,
quad(float, float, float, float, float, float, float, float)
public void rect(float a, float b, float c, float d, float r)
r
- radii for all four cornerspublic void rect(float a, float b, float c, float d, float tl, float tr, float br, float bl)
tl
- radius for top-left cornertr
- radius for top-right cornerbr
- radius for bottom-right cornerbl
- radius for bottom-left cornerpublic void square(float x, float y, float extent)
x
- x-coordinate of the rectangle by defaulty
- y-coordinate of the rectangle by defaultextent
- width and height of the rectangle by defaultrect(float, float, float, float)
,
rectMode(int)
public void ellipseMode(int mode)
mode
- either CENTER, RADIUS, CORNER, or CORNERSPApplet.ellipse(float, float, float, float)
,
PApplet.arc(float, float, float, float, float, float)
public void ellipse(float a, float b, float c, float d)
a
- x-coordinate of the ellipseb
- y-coordinate of the ellipsec
- width of the ellipse by defaultd
- height of the ellipse by defaultPApplet.ellipseMode(int)
,
PApplet.arc(float, float, float, float, float, float)
public void arc(float a, float b, float c, float d, float start, float stop)
a
- x-coordinate of the arc's ellipseb
- y-coordinate of the arc's ellipsec
- width of the arc's ellipse by defaultd
- height of the arc's ellipse by defaultstart
- angle to start the arc, specified in radiansstop
- angle to stop the arc, specified in radiansPApplet.ellipse(float, float, float, float)
,
PApplet.ellipseMode(int)
,
PApplet.radians(float)
,
PApplet.degrees(float)
public void arc(float a, float b, float c, float d, float start, float stop, int mode)
public void circle(float x, float y, float extent)
x
- x-coordinate of the ellipsey
- y-coordinate of the ellipseextent
- width and height of the ellipse by defaultPApplet.ellipse(float, float, float, float)
,
PApplet.ellipseMode(int)
public void box(float size)
size
- dimension of the box in all dimensions (creates a cube)sphere(float)
public void box(float w, float h, float d)
w
- dimension of the box in the x-dimensionh
- dimension of the box in the y-dimensiond
- dimension of the box in the z-dimensionpublic void sphereDetail(int res)
res
- number of segments (minimum 3) used per full circle revolutionsphere(float)
public void sphereDetail(int ures, int vres)
ures
- number of segments used longitudinally per full circle revolutoinvres
- number of segments used latitudinally from top to bottompublic void sphere(float r)
Implementation notes:
cache all the points of the sphere in a static array top and bottom are just a bunch of triangles that land in the center point
sphere is a series of concentric circles who radii vary along the shape, based on, er.. cos or something
[toxi 031031] new sphere code. removed all multiplies with radius, as scale() will take care of that anyway [toxi 031223] updated sphere code (removed modulos) and introduced sphereAt(x,y,z,r) to avoid additional translate()'s on the user/sketch side [davbol 080801] now using separate sphereDetailU/V
r
- the radius of the spheresphereDetail(int)
public float bezierPoint(float a, float b, float c, float d, float t)
stroke(255, 102, 0); line(85, 20, 10, 10); line(90, 90, 15, 80); stroke(0, 0, 0); bezier(85, 20, 10, 10, 90, 90, 15, 80); // draw it in gray, using 10 steps instead of the default 20 // this is a slower way to do it, but useful if you need // to do things with the coordinates at each step stroke(128); beginShape(LINE_STRIP); for (int i = 0; i <= 10; i++) { float t = i / 10.0f; float x = bezierPoint(85, 10, 90, 15, t); float y = bezierPoint(20, 10, 90, 80, t); vertex(x, y); } endShape();
a
- coordinate of first point on the curveb
- coordinate of first control pointc
- coordinate of second control pointd
- coordinate of second point on the curvet
- value between 0 and 1bezier(float, float, float, float, float, float, float, float, float, float, float, float)
,
bezierVertex(float, float, float, float, float, float)
,
curvePoint(float, float, float, float, float)
public float bezierTangent(float a, float b, float c, float d, float t)
a
- coordinate of first point on the curveb
- coordinate of first control pointc
- coordinate of second control pointd
- coordinate of second point on the curvet
- value between 0 and 1bezier(float, float, float, float, float, float, float, float, float, float, float, float)
,
bezierVertex(float, float, float, float, float, float)
,
curvePoint(float, float, float, float, float)
public void bezierDetail(int detail)
detail
- resolution of the curvescurve(float, float, float, float, float, float, float, float, float, float, float, float)
,
curveVertex(float, float, float)
,
curveTightness(float)
public void bezier(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
public void bezier(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4)
Identical to typing:
beginShape(); vertex(x1, y1); bezierVertex(x2, y2, x3, y3, x4, y4); endShape();In Postscript-speak, this would be:
moveto(x1, y1); curveto(x2, y2, x3, y3, x4, y4);If you were to try and continue that curve like so:
curveto(x5, y5, x6, y6, x7, y7);This would be done in processing by adding these statements:
bezierVertex(x5, y5, x6, y6, x7, y7)To draw a quadratic (instead of cubic) curve, use the control point twice by doubling it:
bezier(x1, y1, cx, cy, cx, cy, x2, y2);
x1
- coordinates for the first anchor pointy1
- coordinates for the first anchor pointz1
- coordinates for the first anchor pointx2
- coordinates for the first control pointy2
- coordinates for the first control pointz2
- coordinates for the first control pointx3
- coordinates for the second control pointy3
- coordinates for the second control pointz3
- coordinates for the second control pointx4
- coordinates for the second anchor pointy4
- coordinates for the second anchor pointz4
- coordinates for the second anchor pointbezierVertex(float, float, float, float, float, float)
,
curve(float, float, float, float, float, float, float, float, float, float, float, float)
public float curvePoint(float a, float b, float c, float d, float t)
a
- coordinate of first control pointb
- coordinate of first point on the curvec
- coordinate of second point on the curved
- coordinate of second control pointt
- value between 0 and 1curve(float, float, float, float, float, float, float, float, float, float, float, float)
,
curveVertex(float, float)
,
bezierPoint(float, float, float, float, float)
public float curveTangent(float a, float b, float c, float d, float t)
a
- coordinate of first point on the curveb
- coordinate of first control pointc
- coordinate of second control pointd
- coordinate of second point on the curvet
- value between 0 and 1curve(float, float, float, float, float, float, float, float, float, float, float, float)
,
curveVertex(float, float)
,
curvePoint(float, float, float, float, float)
,
bezierTangent(float, float, float, float, float)
public void curveDetail(int detail)
detail
- resolution of the curvescurve(float, float, float, float, float, float, float, float, float, float, float, float)
,
curveVertex(float, float)
,
curveTightness(float)
public void curveTightness(float tightness)
tightness
- amount of deformation from the original verticescurve(float, float, float, float, float, float, float, float, float, float, float, float)
,
curveVertex(float, float)
public void curve(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
Identical to typing out:
beginShape(); curveVertex(x1, y1); curveVertex(x2, y2); curveVertex(x3, y3); curveVertex(x4, y4); endShape();
x1
- coordinates for the beginning control pointy1
- coordinates for the beginning control pointx2
- coordinates for the first pointy2
- coordinates for the first pointx3
- coordinates for the second pointy3
- coordinates for the second pointx4
- coordinates for the ending control pointy4
- coordinates for the ending control pointcurveVertex(float, float)
,
curveTightness(float)
,
bezier(float, float, float, float, float, float, float, float, float, float, float, float)
public void curve(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4)
z1
- coordinates for the beginning control pointz2
- coordinates for the first pointz3
- coordinates for the second pointz4
- coordinates for the ending control pointpublic void smooth()
public void smooth(int quality)
public void noSmooth()
public void imageMode(int mode)
mode
- either CORNER, CORNERS, or CENTERPApplet.loadImage(String, String)
,
PImage
,
image(PImage, float, float, float, float)
,
background(float, float, float, float)
public void image(PImage img, float a, float b)
img
- the image to displaya
- x-coordinate of the image by defaultb
- y-coordinate of the image by defaultPApplet.loadImage(String, String)
,
PImage
,
imageMode(int)
,
tint(float)
,
background(float, float, float, float)
,
alpha(int)
public void image(PImage img, float a, float b, float c, float d)
c
- width to display the image by defaultd
- height to display the image by defaultpublic void image(PImage img, float a, float b, float c, float d, int u1, int v1, int u2, int v2)
public void shapeMode(int mode)
mode
- either CORNER, CORNERS, CENTERPShape
,
shape(PShape)
,
rectMode(int)
public void shape(PShape shape)
public void shape(PShape shape, float x, float y)
shape
- the shape to displayx
- x-coordinate of the shapey
- y-coordinate of the shapePShape
,
PApplet.loadShape(String)
,
Convenience method to draw at a particular location.
public void shape(PShape shape, float a, float b, float c, float d)
a
- x-coordinate of the shapeb
- y-coordinate of the shapec
- width to display the shaped
- height to display the shapepublic void textAlign(int alignX)
public void textAlign(int alignX, int alignY)
alignX
- horizontal alignment, either LEFT, CENTER, or RIGHTalignY
- vertical alignment, either TOP, BOTTOM, CENTER, or BASELINEPApplet.loadFont(String)
,
PFont
,
text(String, float, float)
,
textSize(float)
,
textAscent()
,
textDescent()
public float textAscent()
textDescent()
public float textDescent()
textAscent()
public void textFont(PFont which)
which
- any variable of the type PFontPApplet.createFont(String, float, boolean)
,
PApplet.loadFont(String)
,
PFont
,
text(String, float, float)
,
textSize(float)
public void textFont(PFont which, float size)
size
- the size of the letters in units of pixelspublic void textLeading(float leading)
leading
- the size in pixels for spacing between linesPApplet.loadFont(String)
,
PFont.PFont(java.io.InputStream)
,
text(String, float, float)
,
textFont(PFont)
,
textSize(float)
public void textMode(int mode)
mode
- either MODEL or SHAPEPApplet.loadFont(String)
,
PFont.PFont(java.io.InputStream)
,
text(String, float, float)
,
textFont(PFont)
,
beginRaw(PGraphics)
,
PApplet.createFont(String, float, boolean)
public void textSize(float size)
size
- the size of the letters in units of pixelsPApplet.loadFont(String)
,
PFont.PFont(java.io.InputStream)
,
text(String, float, float)
,
textFont(PFont)
public float textWidth(char c)
c
- the character to measurepublic float textWidth(String str)
str
- the String of characters to measurePApplet.loadFont(String)
,
PFont.PFont(java.io.InputStream)
,
text(String, float, float)
,
textFont(PFont)
,
textSize(float)
public float textWidth(char[] chars, int start, int length)
public void text(char c, float x, float y)
c
- the alphanumeric character to be displayedx
- x-coordinate of texty
- y-coordinate of texttextAlign(int, int)
,
textFont(PFont)
,
textMode(int)
,
textSize(float)
,
textLeading(float)
,
textWidth(String)
,
textAscent()
,
textDescent()
,
rectMode(int)
,
fill(int, float)
public void text(char c, float x, float y, float z)
z
- z-coordinate of textpublic void text(String str, float x, float y)
public void text(char[] chars, int start, int stop, float x, float y)
chars
- the alphanumberic symbols to be displayedstart
- array index at which to start writing charactersstop
- array index at which to stop writing characterspublic void text(String str, float x, float y, float z)
public void text(char[] chars, int start, int stop, float x, float y, float z)
public void text(String str, float x1, float y1, float x2, float y2)
x1
- by default, the x-coordinate of text, see rectMode() for more infoy1
- by default, the y-coordinate of text, see rectMode() for more infox2
- by default, the width of the text box, see rectMode() for more infoy2
- by default, the height of the text box, see rectMode() for more infopublic void text(int num, float x, float y)
public void text(int num, float x, float y, float z)
public void text(float num, float x, float y)
num
- the numeric value to be displayedpublic void text(float num, float x, float y, float z)
public void push()
pop()
public void pop()
push()
public void pushMatrix()
public void popMatrix()
pushMatrix()
public void translate(float x, float y)
x
- left/right translationy
- up/down translationpopMatrix()
,
pushMatrix()
,
rotate(float)
,
rotateX(float)
,
rotateY(float)
,
rotateZ(float)
,
scale(float, float, float)
public void translate(float x, float y, float z)
z
- forward/backward translationpublic void rotate(float angle)
angle
- angle of rotation specified in radianspopMatrix()
,
pushMatrix()
,
rotateX(float)
,
rotateY(float)
,
rotateZ(float)
,
scale(float, float, float)
,
PApplet.radians(float)
public void rotateX(float angle)
angle
- angle of rotation specified in radianspopMatrix()
,
pushMatrix()
,
rotate(float)
,
rotateY(float)
,
rotateZ(float)
,
scale(float, float, float)
,
translate(float, float, float)
public void rotateY(float angle)
angle
- angle of rotation specified in radianspopMatrix()
,
pushMatrix()
,
rotate(float)
,
rotateX(float)
,
rotateZ(float)
,
scale(float, float, float)
,
translate(float, float, float)
public void rotateZ(float angle)
angle
- angle of rotation specified in radianspopMatrix()
,
pushMatrix()
,
rotate(float)
,
rotateX(float)
,
rotateY(float)
,
scale(float, float, float)
,
translate(float, float, float)
public void rotate(float angle, float x, float y, float z)
x
- y
- z
- public void scale(float s)
s
- percentage to scale the objectpushMatrix()
,
popMatrix()
,
translate(float, float, float)
,
rotate(float)
,
rotateX(float)
,
rotateY(float)
,
rotateZ(float)
public void scale(float x, float y)
x
- percentage to scale the object in the x-axisy
- percentage to scale the object in the y-axispublic void scale(float x, float y, float z)
z
- percentage to scale the object in the z-axispublic void shearX(float angle)
angle
- angle of shear specified in radianspopMatrix()
,
pushMatrix()
,
shearY(float)
,
scale(float, float, float)
,
translate(float, float, float)
,
PApplet.radians(float)
public void shearY(float angle)
angle
- angle of shear specified in radianspopMatrix()
,
pushMatrix()
,
shearX(float)
,
scale(float, float, float)
,
translate(float, float, float)
,
PApplet.radians(float)
public void resetMatrix()
pushMatrix()
,
popMatrix()
,
applyMatrix(PMatrix)
,
printMatrix()
public void applyMatrix(PMatrix source)
pushMatrix()
,
popMatrix()
,
resetMatrix()
,
printMatrix()
public void applyMatrix(PMatrix2D source)
public void applyMatrix(float n00, float n01, float n02, float n10, float n11, float n12)
n00
- numbers which define the 4x4 matrix to be multipliedn01
- numbers which define the 4x4 matrix to be multipliedn02
- numbers which define the 4x4 matrix to be multipliedn10
- numbers which define the 4x4 matrix to be multipliedn11
- numbers which define the 4x4 matrix to be multipliedn12
- numbers which define the 4x4 matrix to be multipliedpublic void applyMatrix(PMatrix3D source)
public void applyMatrix(float n00, float n01, float n02, float n03, float n10, float n11, float n12, float n13, float n20, float n21, float n22, float n23, float n30, float n31, float n32, float n33)
n03
- numbers which define the 4x4 matrix to be multipliedn13
- numbers which define the 4x4 matrix to be multipliedn20
- numbers which define the 4x4 matrix to be multipliedn21
- numbers which define the 4x4 matrix to be multipliedn22
- numbers which define the 4x4 matrix to be multipliedn23
- numbers which define the 4x4 matrix to be multipliedn30
- numbers which define the 4x4 matrix to be multipliedn31
- numbers which define the 4x4 matrix to be multipliedn32
- numbers which define the 4x4 matrix to be multipliedn33
- numbers which define the 4x4 matrix to be multipliedpublic PMatrix getMatrix()
public PMatrix2D getMatrix(PMatrix2D target)
public PMatrix3D getMatrix(PMatrix3D target)
public void setMatrix(PMatrix source)
public void setMatrix(PMatrix2D source)
public void setMatrix(PMatrix3D source)
public void printMatrix()
pushMatrix()
,
popMatrix()
,
resetMatrix()
,
applyMatrix(PMatrix)
public void beginCamera()
public void endCamera()
public void camera()
public void camera(float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ)
eyeX
- x-coordinate for the eyeeyeY
- y-coordinate for the eyeeyeZ
- z-coordinate for the eyecenterX
- x-coordinate for the center of the scenecenterY
- y-coordinate for the center of the scenecenterZ
- z-coordinate for the center of the sceneupX
- usually 0.0, 1.0, or -1.0upY
- usually 0.0, 1.0, or -1.0upZ
- usually 0.0, 1.0, or -1.0public void printCamera()
public void ortho()
public void ortho(float left, float right, float bottom, float top)
left
- left plane of the clipping volumeright
- right plane of the clipping volumebottom
- bottom plane of the clipping volumetop
- top plane of the clipping volumepublic void ortho(float left, float right, float bottom, float top, float near, float far)
near
- maximum distance from the origin to the viewerfar
- maximum distance from the origin away from the viewerpublic void perspective()
public void perspective(float fovy, float aspect, float zNear, float zFar)
fovy
- field-of-view angle (in radians) for vertical directionaspect
- ratio of width to heightzNear
- z-position of nearest clipping planezFar
- z-position of farthest clipping planepublic void frustum(float left, float right, float bottom, float top, float near, float far)
left
- left coordinate of the clipping planeright
- right coordinate of the clipping planebottom
- bottom coordinate of the clipping planetop
- top coordinate of the clipping planenear
- near component of the clipping plane; must be greater than zerofar
- far component of the clipping plane; must be greater than the near valuecamera(float, float, float, float, float, float, float, float, float)
,
beginCamera()
,
endCamera()
,
perspective(float, float, float, float)
public void printProjection()
public float screenX(float x, float y)
x
- 3D x-coordinate to be mappedy
- 3D y-coordinate to be mappedscreenY(float, float, float)
,
screenZ(float, float, float)
public float screenY(float x, float y)
x
- 3D x-coordinate to be mappedy
- 3D y-coordinate to be mappedscreenX(float, float, float)
,
screenZ(float, float, float)
public float screenX(float x, float y, float z)
z
- 3D z-coordinate to be mappedpublic float screenY(float x, float y, float z)
z
- 3D z-coordinate to be mappedpublic float screenZ(float x, float y, float z)
x
- 3D x-coordinate to be mappedy
- 3D y-coordinate to be mappedz
- 3D z-coordinate to be mappedscreenX(float, float, float)
,
screenY(float, float, float)
public float modelX(float x, float y, float z)
x
- 3D x-coordinate to be mappedy
- 3D y-coordinate to be mappedz
- 3D z-coordinate to be mappedmodelY(float, float, float)
,
modelZ(float, float, float)
public float modelY(float x, float y, float z)
x
- 3D x-coordinate to be mappedy
- 3D y-coordinate to be mappedz
- 3D z-coordinate to be mappedmodelX(float, float, float)
,
modelZ(float, float, float)
public float modelZ(float x, float y, float z)
x
- 3D x-coordinate to be mappedy
- 3D y-coordinate to be mappedz
- 3D z-coordinate to be mappedmodelX(float, float, float)
,
modelY(float, float, float)
public void pushStyle()
popStyle()
public void popStyle()
pushStyle()
public void style(PStyle s)
public PStyle getStyle()
public void strokeWeight(float weight)
weight
- the weight (in pixels) of the strokestroke(int, float)
,
strokeJoin(int)
,
strokeCap(int)
public void strokeJoin(int join)
join
- either MITER, BEVEL, ROUNDstroke(int, float)
,
strokeWeight(float)
,
strokeCap(int)
public void strokeCap(int cap)
cap
- either SQUARE, PROJECT, or ROUNDstroke(int, float)
,
strokeWeight(float)
,
strokeJoin(int)
,
PApplet.size(int, int, String, String)
public void noStroke()
public void stroke(int rgb)
rgb
- color value in hexadecimal notationnoStroke()
,
strokeWeight(float)
,
strokeJoin(int)
,
strokeCap(int)
,
fill(int, float)
,
noFill()
,
tint(int, float)
,
background(float, float, float, float)
,
colorMode(int, float, float, float, float)
public void stroke(int rgb, float alpha)
alpha
- opacity of the strokepublic void stroke(float gray)
gray
- specifies a value between white and blackpublic void stroke(float gray, float alpha)
public void stroke(float v1, float v2, float v3)
v1
- red or hue value (depending on current color mode)v2
- green or saturation value (depending on current color mode)v3
- blue or brightness value (depending on current color mode)public void stroke(float v1, float v2, float v3, float alpha)
public void noTint()
tint(float, float, float, float)
,
image(PImage, float, float, float, float)
public void tint(int rgb)
rgb
- color value in hexadecimal notationnoTint()
,
image(PImage, float, float, float, float)
public void tint(int rgb, float alpha)
alpha
- opacity of the imagepublic void tint(float gray)
gray
- specifies a value between white and blackpublic void tint(float gray, float alpha)
public void tint(float v1, float v2, float v3)
v1
- red or hue value (depending on current color mode)v2
- green or saturation value (depending on current color mode)v3
- blue or brightness value (depending on current color mode)public void tint(float v1, float v2, float v3, float alpha)
public void noFill()
fill(float, float, float, float)
,
stroke(int, float)
,
noStroke()
public void fill(int rgb)
rgb
- color variable or hex valuenoFill()
,
stroke(int, float)
,
noStroke()
,
tint(int, float)
,
background(float, float, float, float)
,
colorMode(int, float, float, float, float)
public void fill(int rgb, float alpha)
alpha
- opacity of the fillpublic void fill(float gray)
gray
- number specifying value between white and blackpublic void fill(float gray, float alpha)
public void fill(float v1, float v2, float v3)
v1
- red or hue value (depending on current color mode)v2
- green or saturation value (depending on current color mode)v3
- blue or brightness value (depending on current color mode)public void fill(float v1, float v2, float v3, float alpha)
public void ambient(int rgb)
rgb
- any value of the color datatypeemissive(float, float, float)
,
specular(float, float, float)
,
shininess(float)
public void ambient(float gray)
gray
- number specifying value between white and blackpublic void ambient(float v1, float v2, float v3)
v1
- red or hue value (depending on current color mode)v2
- green or saturation value (depending on current color mode)v3
- blue or brightness value (depending on current color mode)public void specular(int rgb)
rgb
- color to setlightSpecular(float, float, float)
,
ambient(float, float, float)
,
emissive(float, float, float)
,
shininess(float)
public void specular(float gray)
gray
- value between black and white, by default 0 to 255public void specular(float v1, float v2, float v3)
v1
- red or hue value (depending on current color mode)v2
- green or saturation value (depending on current color mode)v3
- blue or brightness value (depending on current color mode)public void shininess(float shine)
shine
- degree of shininessemissive(float, float, float)
,
ambient(float, float, float)
,
specular(float, float, float)
public void emissive(int rgb)
rgb
- color to setambient(float, float, float)
,
specular(float, float, float)
,
shininess(float)
public void emissive(float gray)
gray
- value between black and white, by default 0 to 255public void emissive(float v1, float v2, float v3)
v1
- red or hue value (depending on current color mode)v2
- green or saturation value (depending on current color mode)v3
- blue or brightness value (depending on current color mode)public void lights()
ambientLight(float, float, float, float, float, float)
,
directionalLight(float, float, float, float, float, float)
,
pointLight(float, float, float, float, float, float)
,
spotLight(float, float, float, float, float, float, float, float, float, float, float)
,
noLights()
public void noLights()
lights()
public void ambientLight(float v1, float v2, float v3)
v1
- red or hue value (depending on current color mode)v2
- green or saturation value (depending on current color mode)v3
- blue or brightness value (depending on current color mode)lights()
,
directionalLight(float, float, float, float, float, float)
,
pointLight(float, float, float, float, float, float)
,
spotLight(float, float, float, float, float, float, float, float, float, float, float)
public void ambientLight(float v1, float v2, float v3, float x, float y, float z)
x
- x-coordinate of the lighty
- y-coordinate of the lightz
- z-coordinate of the lightpublic void directionalLight(float v1, float v2, float v3, float nx, float ny, float nz)
v1
- red or hue value (depending on current color mode)v2
- green or saturation value (depending on current color mode)v3
- blue or brightness value (depending on current color mode)nx
- direction along the x-axisny
- direction along the y-axisnz
- direction along the z-axislights()
,
ambientLight(float, float, float, float, float, float)
,
pointLight(float, float, float, float, float, float)
,
spotLight(float, float, float, float, float, float, float, float, float, float, float)
public void pointLight(float v1, float v2, float v3, float x, float y, float z)
v1
- red or hue value (depending on current color mode)v2
- green or saturation value (depending on current color mode)v3
- blue or brightness value (depending on current color mode)x
- x-coordinate of the lighty
- y-coordinate of the lightz
- z-coordinate of the lightlights()
,
directionalLight(float, float, float, float, float, float)
,
ambientLight(float, float, float, float, float, float)
,
spotLight(float, float, float, float, float, float, float, float, float, float, float)
public void spotLight(float v1, float v2, float v3, float x, float y, float z, float nx, float ny, float nz, float angle, float concentration)
v1
- red or hue value (depending on current color mode)v2
- green or saturation value (depending on current color mode)v3
- blue or brightness value (depending on current color mode)x
- x-coordinate of the lighty
- y-coordinate of the lightz
- z-coordinate of the lightnx
- direction along the x axisny
- direction along the y axisnz
- direction along the z axisangle
- angle of the spotlight coneconcentration
- exponent determining the center bias of the conelights()
,
directionalLight(float, float, float, float, float, float)
,
pointLight(float, float, float, float, float, float)
,
ambientLight(float, float, float, float, float, float)
public void lightFalloff(float constant, float linear, float quadratic)
constant
- constant value or determining fallofflinear
- linear value for determining falloffquadratic
- quadratic value for determining fallofflights()
,
ambientLight(float, float, float, float, float, float)
,
pointLight(float, float, float, float, float, float)
,
spotLight(float, float, float, float, float, float, float, float, float, float, float)
,
lightSpecular(float, float, float)
public void lightSpecular(float v1, float v2, float v3)
v1
- red or hue value (depending on current color mode)v2
- green or saturation value (depending on current color mode)v3
- blue or brightness value (depending on current color mode)specular(float, float, float)
,
lights()
,
ambientLight(float, float, float, float, float, float)
,
pointLight(float, float, float, float, float, float)
,
spotLight(float, float, float, float, float, float, float, float, float, float, float)
public void background(int rgb)
Clear the background with a color that includes an alpha value. This can only be used with objects created by createGraphics(), because the main drawing surface cannot be set transparent.
It might be tempting to use this function to partially clear the screen on each frame, however that's not how this function works. When calling background(), the pixels will be replaced with pixels that have that level of transparency. To do a semi-transparent overlay, use fill() with alpha and draw a rectangle.
rgb
- any value of the color datatypestroke(float)
,
fill(float)
,
tint(float)
,
colorMode(int)
public void background(int rgb, float alpha)
alpha
- opacity of the backgroundpublic void background(float gray)
gray
- specifies a value between white and blackpublic void background(float gray, float alpha)
public void background(float v1, float v2, float v3)
v1
- red or hue value (depending on the current color mode)v2
- green or saturation value (depending on the current color mode)v3
- blue or brightness value (depending on the current color mode)public void background(float v1, float v2, float v3, float alpha)
public void clear()
public void background(PImage image)
image
- PImage to set as background (must be same size as the sketch window)public void colorMode(int mode)
mode
- Either RGB or HSB, corresponding to Red/Green/Blue and Hue/Saturation/Brightnessbackground(float)
,
fill(float)
,
stroke(float)
public void colorMode(int mode, float max)
max
- range for all color elementspublic void colorMode(int mode, float max1, float max2, float max3)
max1
- range for the red or hue depending on the current color modemax2
- range for the green or saturation depending on the current color modemax3
- range for the blue or brightness depending on the current color modepublic void colorMode(int mode, float max1, float max2, float max3, float maxA)
maxA
- range for the alphapublic final int color(int c)
public final int color(float gray)
public final int color(int c, int alpha)
c
- can be packed ARGB or a gray in this casepublic final int color(int c, float alpha)
c
- can be packed ARGB or a gray in this casepublic final int color(float gray, float alpha)
public final int color(int v1, int v2, int v3)
public final int color(float v1, float v2, float v3)
public final int color(int v1, int v2, int v3, int a)
public final int color(float v1, float v2, float v3, float a)
public final float alpha(int rgb)
rgb
- any value of the color datatypered(int)
,
green(int)
,
blue(int)
,
hue(int)
,
saturation(int)
,
brightness(int)
public final float red(int rgb)
float r1 = red(myColor);( end auto-generated )
float r2 = myColor >> 16 & 0xFF;
rgb
- any value of the color datatypegreen(int)
,
blue(int)
,
alpha(int)
,
hue(int)
,
saturation(int)
,
brightness(int)
public final float green(int rgb)
float r1 = green(myColor);( end auto-generated )
float r2 = myColor >> 8 & 0xFF;
rgb
- any value of the color datatypered(int)
,
blue(int)
,
alpha(int)
,
hue(int)
,
saturation(int)
,
brightness(int)
public final float blue(int rgb)
float r1 = blue(myColor);( end auto-generated )
float r2 = myColor & 0xFF;
rgb
- any value of the color datatypered(int)
,
green(int)
,
alpha(int)
,
hue(int)
,
saturation(int)
,
brightness(int)
public final float hue(int rgb)
rgb
- any value of the color datatypered(int)
,
green(int)
,
blue(int)
,
alpha(int)
,
saturation(int)
,
brightness(int)
public final float saturation(int rgb)
rgb
- any value of the color datatypered(int)
,
green(int)
,
blue(int)
,
alpha(int)
,
hue(int)
,
brightness(int)
public final float brightness(int rgb)
rgb
- any value of the color datatypered(int)
,
green(int)
,
blue(int)
,
alpha(int)
,
hue(int)
,
saturation(int)
public int lerpColor(int c1, int c2, float amt)
c1
- interpolate from this colorc2
- interpolate to this coloramt
- between 0.0 and 1.0PImage.blendColor(int, int, int)
,
color(float, float, float, float)
,
PApplet.lerp(float, float, float)
public static int lerpColor(int c1, int c2, float amt, int mode)
public void beginRaw(PGraphics rawGraphics)
public void endRaw()
public boolean haveRaw()
public PGraphics getRaw()
public static void showWarning(String msg)
msg
- the error message (which will be stored for later comparison)public static void showWarning(String msg, Object... args)
public static void showDepthWarning(String method)
method
- The method name (no parentheses)public static void showDepthWarningXYZ(String method)
method
- The method name (no parentheses)public static void showMethodWarning(String method)
public static void showVariationWarning(String str)
public static void showMissingWarning(String method)
public static void showException(String msg)
public boolean displayable()
public boolean is2D()
public boolean is3D()
public boolean isGL()
public boolean is2X()
public boolean save(String filename)
PImage
As of revision 0100, this function requires an absolute path, in order to avoid confusion. To save inside the sketch folder, use the function savePath() from PApplet, or use saveFrame() instead. As of revision 0116, savePath() is not needed if this object has been created (as recommended) via createImage() or createGraphics() or one of its neighbors.
As of revision 0115, when using Java 1.4 and later, you can write
to several formats besides tga and tiff. If Java 1.4 is installed
and the extension used is supported (usually png, jpg, jpeg, bmp,
and tiff), then those methods will be used to write the image.
To get a list of the supported formats for writing, use:
println(javax.imageio.ImageIO.getReaderFormatNames())
To use the original built-in image writers, use .tga or .tif as the extension, or don't include an extension. When no extension is used, the extension .tif will be added to the file name.
The ImageIO API claims to support wbmp files, however they probably require a black and white image. Basic testing produced a zero-length file with no error.