diff --git a/app/src/processing/mode/javascript/DirectivesEditor.java b/app/src/processing/mode/javascript/DirectivesEditor.java
index eb135757d..44ca2c28c 100644
--- a/app/src/processing/mode/javascript/DirectivesEditor.java
+++ b/app/src/processing/mode/javascript/DirectivesEditor.java
@@ -25,7 +25,7 @@ public class DirectivesEditor
JCheckBox globalKeyEventsBox;
JCheckBox pauseOnBlurBox;
JTextField preloadField;
- JCheckBox transparentBox;
+ //JCheckBox transparentBox;
private final static ArrayList
- * Differences between beginShape() and line() and point() methods.
- *
- * beginShape() is intended to be more flexible at the expense of being
- * a little more complicated to use. it handles more complicated shapes
- * that can consist of many connected lines (so you get joins) or lines
- * mixed with curves.
- *
- * The line() and point() command are for the far more common cases
- * (particularly for our audience) that simply need to draw a line
- * or a point on the screen.
- *
- * From the code side of things, line() may or may not call beginShape()
- * to do the drawing. In the beta code, they do, but in the alpha code,
- * they did not. they might be implemented one way or the other depending
- * on tradeoffs of runtime efficiency vs. implementation efficiency &mdash
- * meaning the speed that things run at vs. the speed it takes me to write
- * the code and maintain it. for beta, the latter is most important so
- * that's how things are implemented.
+ * ( begin auto-generated from beginShape.xml )
+ *
+ * Using the beginShape() and endShape() functions allow creating more complex forms. beginShape() begins recording vertices for a shape and endShape() stops recording. The value of the MODE parameter tells it which types of shapes to create from the provided vertices. With no mode specified, the shape can be any irregular polygon. The parameters available for beginShape() are POINTS, LINES, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, QUADS, and QUAD_STRIP. After calling the beginShape() function, a series of vertex() commands must follow. To stop drawing the shape, call endShape(). The vertex() function with two parameters specifies a position in 2D and the vertex() function with three parameters specifies a position in 3D. Each shape will be outlined with the current stroke color and filled with the fill color.
+ *
* Implementation notes:
@@ -9875,12 +9934,11 @@ public class PApplet extends Applet
/**
- * Evalutes quadratic bezier at point t for points a, b, c, d.
- * The parameter t varies between 0 and 1. The a and d parameters are the
- * on-curve points, b and c are the control points. To make a two-dimensional
- * curve, call this function once with the x coordinates and a second time
- * with the y coordinates to get the location of a bezier curve at t.
- *
+ * ( begin auto-generated from bezierPoint.xml )
+ *
+ * Evaluates the Bezier at point t for points a, b, c, d. The parameter t varies between 0 and 1, a and d are points on the curve, and b and c are the control points. This can be done once with the x coordinates and a second time with the y coordinates to get the location of a bezier curve at t.
+ *
+ * ( end auto-generated )
*
- * Given an (x, y, z) coordinate, returns the x position of where
- * that point would be placed on screen, once affected by translate(),
- * scale(), or any other transformations.
+ * @param z 3D z-coordinate to be mapped
*/
public float screenX(float x, float y, float z) {
return g.screenX(x, y, z);
@@ -10961,11 +11389,7 @@ public class PApplet extends Applet
/**
- * Maps a three dimensional point to its placement on-screen.
- *
- * Given an (x, y, z) coordinate, returns the y position of where
- * that point would be placed on screen, once affected by translate(),
- * scale(), or any other transformations.
+ * @param z 3D z-coordinate to be mapped
*/
public float screenY(float x, float y, float z) {
return g.screenY(x, y, z);
@@ -10973,15 +11397,17 @@ public class PApplet extends Applet
/**
- * Maps a three dimensional point to its placement on-screen.
- *
- * Given an (x, y, z) coordinate, returns its z value.
- * This value can be used to determine if an (x, y, z) coordinate
- * is in front or in back of another (x, y, z) coordinate.
- * The units are based on how the zbuffer is set up, and don't
- * relate to anything "real". They're only useful for in
- * comparison to another value obtained from screenZ(),
- * or directly out of the zbuffer[].
+ * ( 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.
+ *
+ * ( end auto-generated )
+ * @webref lights_camera:coordinates
+ * @param x 3D x-coordinate to be mapped
+ * @param y 3D y-coordinate to be mapped
+ * @param z 3D z-coordinate to be mapped
+ * @see PGraphics#screenX(float, float, float)
+ * @see PGraphics#screenY(float, float, float)
*/
public float screenZ(float x, float y, float z) {
return g.screenZ(x, y, z);
@@ -10989,13 +11415,19 @@ public class PApplet extends Applet
/**
- * Returns the model space x value for an x, y, z coordinate.
- *
- * This will give you a coordinate after it has been transformed
- * by translate(), rotate(), and camera(), but not yet transformed
- * by the projection matrix. For instance, his can be useful for
- * figuring out how points in 3D space relate to the edge
- * coordinates of a shape.
+ * ( begin auto-generated from modelX.xml )
+ *
+ * Returns the three-dimensional X, Y, Z position in model space. This returns the X value for a given coordinate based on the current set of transformations (scale, rotate, translate, etc.) The X value can be used to place an object in space relative to the location of the original point once the transformations are no longer in use.
+ *
- * For the main drawing surface, the alpha value will be ignored. However,
- * alpha can be used on PGraphics objects from createGraphics(). This is
- * the only way to set all the pixels partially transparent, for instance.
- *
- * Note that background() should be called before any transformations occur,
- * because some implementations may require the current transformation matrix
- * to be identity before drawing.
- *
- * @param rgb color value in hexadecimal notation (i.e. #FFCC00 or 0xFFFFCC00) Clear the background with a color that includes an alpha value. This can
* only be used with objects created by createGraphics(), because the main
@@ -11497,15 +12114,57 @@ public class PApplet extends Applet
* and draw a rectangle.
- * Note that this doesn't set the maximum for the alpha value,
- * which might be confusing if for instance you switched to
- *
@@ -12069,8 +12746,9 @@ public class PApplet extends Applet
* Gaussian blur code contributed by
* Mario Klingemann
*
- * @webref
+ * @webref pimage:pixels
* @brief Converts the image to grayscale or black and white
+ * @usage web_application
* @param kind Either THRESHOLD, GRAY, INVERT, POSTERIZE, BLUR, OPAQUE, ERODE, or DILATE
* @param param in the range from 0 to 1
*/
@@ -12081,22 +12759,10 @@ public class PApplet extends Applet
/**
- * Copy things from one area of this image
- * to another area in the same image.
- */
- public void copy(int sx, int sy, int sw, int sh,
- int dx, int dy, int dw, int dh) {
- if (recorder != null) recorder.copy(sx, sy, sw, sh, dx, dy, dw, dh);
- g.copy(sx, sy, sw, sh, dx, dy, dw, dh);
- }
-
-
- /**
- * Copies a region of pixels from one image into another. If the source and destination regions aren't the same size, it will automatically resize source pixels to fit the specified target region. No alpha information is used in the process, however if the source image has an alpha channel set, it will be copied as well.
- *
hint(ENABLE_OPENGL_4X_SMOOTH) - Enable 4x anti-aliasing for OpenGL. This can help force anti-aliasing if it has not been enabled by the user. On some graphics cards, this can also be set by the graphics driver's control panel, however not all cards make this available. This hint must be called immediately after the size() command because it resets the renderer, obliterating any settings and anything drawn (and like size(), re-running the code that came before it again).
- *
hint(DISABLE_OPENGL_2X_SMOOTH) - In Processing 1.0, Processing always enables 2x smoothing when the OpenGL renderer is used. This hint disables the default 2x smoothing and returns the smoothing behavior found in earlier releases, where smooth() and noSmooth() could be used to enable and disable smoothing, though the quality was inferior.
- *
hint(ENABLE_NATIVE_FONTS) - Use the native version fonts when they are installed, rather than the bitmapped version from a .vlw file. This is useful with the JAVA2D renderer setting, as it will improve font rendering speed. This is not enabled by default, because it can be misleading while testing because the type will look great on your machine (because you have the font installed) but lousy on others' machines if the identical font is unavailable. This option can only be set per-sketch, and must be called before any use of textFont().
- *
hint(DISABLE_DEPTH_TEST) - Disable the zbuffer, allowing you to draw on top of everything at will. When depth testing is disabled, items will be drawn to the screen sequentially, like a painting. This hint is most often used to draw in 3D, then draw in 2D on top of it (for instance, to draw GUI controls in 2D on top of a 3D interface). Starting in release 0149, this will also clear the depth buffer. Restore the default with hint(ENABLE_DEPTH_TEST), but note that with the depth buffer cleared, any 3D drawing that happens later in draw() will ignore existing shapes on the screen.
- *
hint(ENABLE_DEPTH_SORT) - Enable primitive z-sorting of triangles and lines in P3D and OPENGL. This can slow performance considerably, and the algorithm is not yet perfect. Restore the default with hint(DISABLE_DEPTH_SORT).
- *
hint(DISABLE_OPENGL_ERROR_REPORT) - Speeds up the OPENGL renderer setting by not checking for errors while running. Undo with hint(ENABLE_OPENGL_ERROR_REPORT).
- *
As of release 0149, unhint() has been removed in favor of adding additional ENABLE/DISABLE constants to reset the default behavior. This prevents the double negatives, and also reinforces which hints can be enabled or disabled.
- *
+ *
+ * hint(ENABLE_OPENGL_4X_SMOOTH) - Enable 4x anti-aliasing for OpenGL. This can help force anti-aliasing if it has not been enabled by the user. On some graphics cards, this can also be set by the graphics driver's control panel, however not all cards make this available. This hint must be called immediately after the size() command because it resets the renderer, obliterating any settings and anything drawn (and like size(), re-running the code that came before it again).
+ *
+ * hint(DISABLE_OPENGL_2X_SMOOTH) - In Processing 1.0, Processing always enables 2x smoothing when the OpenGL renderer is used. This hint disables the default 2x smoothing and returns the smoothing behavior found in earlier releases, where smooth() and noSmooth() could be used to enable and disable smoothing, though the quality was inferior.
+ *
+ * hint(ENABLE_NATIVE_FONTS) - Use the native version fonts when they are installed, rather than the bitmapped version from a .vlw file. This is useful with the default (or JAVA2D) renderer setting, as it will improve font rendering speed. This is not enabled by default, because it can be misleading while testing because the type will look great on your machine (because you have the font installed) but lousy on others' machines if the identical font is unavailable. This option can only be set per-sketch, and must be called before any use of textFont().
+ *
+ * hint(DISABLE_DEPTH_TEST) - Disable the zbuffer, allowing you to draw on top of everything at will. When depth testing is disabled, items will be drawn to the screen sequentially, like a painting. This hint is most often used to draw in 3D, then draw in 2D on top of it (for instance, to draw GUI controls in 2D on top of a 3D interface). Starting in release 0149, this will also clear the depth buffer. Restore the default with hint(ENABLE_DEPTH_TEST), but note that with the depth buffer cleared, any 3D drawing that happens later in draw() will ignore existing shapes on the screen.
+ *
+ * hint(ENABLE_DEPTH_SORT) - Enable primitive z-sorting of triangles and lines in P3D and OPENGL. This can slow performance considerably, and the algorithm is not yet perfect. Restore the default with hint(DISABLE_DEPTH_SORT).
+ *
+ * hint(DISABLE_OPENGL_ERROR_REPORT) - Speeds up the OPENGL renderer setting by not checking for errors while running. Undo with hint(ENABLE_OPENGL_ERROR_REPORT).
+ *
+ *
+ * As of release 0149, unhint() has been removed in favor of adding additional ENABLE/DISABLE constants to reset the default behavior. This prevents the double negatives, and also reinforces which hints can be enabled or disabled.
+ *
+ * ( end auto-generated )
* @webref rendering
* @param which name of the hint to be enabled or disabled
- *
- * @see processing.core.PGraphics
- * @see processing.core.PApplet#createGraphics(int, int, String, String)
- * @see processing.core.PApplet#size(int, int)
+ * @see PGraphics
+ * @see PApplet#createGraphics(int, int, String, String)
+ * @see PApplet#size(int, int)
*/
public void hint(int which) {
if (recorder != null) recorder.hint(which);
@@ -9352,26 +9362,21 @@ public class PApplet extends Applet
/**
- * Start a new shape.
- *
+ * Transformations such as translate(), rotate(), and scale() do not work within beginShape(). It is also not possible to use other shapes, such as ellipse() or rect() within beginShape().
+ *
+ * The P2D, P3D, and OPENGL renderer settings allow stroke() and fill() settings to be altered per-vertex, however the default JAVA2D renderer does not. Settings such as strokeWeight(), strokeCap(), and strokeJoin() cannot be changed while inside a beginShape()/endShape() block with any renderer.
+ *
+ * ( end auto-generated )
+ * @webref shape:vertex
+ * @param kind either POINTS, LINES, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, QUADS, QUAD_STRIP
+ * @see PGraphics#endShape()
+ * @see PGraphics#vertex(float, float, float, float, float)
+ * @see PGraphics#curveVertex(float, float, float)
+ * @see PGraphics#bezierVertex(float, float, float, float, float, float, float, float, float)
*/
public void beginShape(int kind) {
if (recorder != null) recorder.beginShape(kind);
@@ -9390,19 +9395,18 @@ public class PApplet extends Applet
/**
- * Sets the current normal vector. Only applies with 3D rendering
- * and inside a beginShape/endShape block.
- *
+ * When textures are in use, the fill color is ignored. Instead, use tint() to specify the color of the texture as it is applied to the shape.
+ *
+ * ( end auto-generated )
+ * @webref shape:vertex
+ * @param image the texture to apply
+ * @see PGraphics#textureMode(int)
+ * @see PGraphics#beginShape(int)
+ * @see PGraphics#endShape(int)
+ * @see PGraphics#vertex(float, float, float, float, float)
*
* @param image reference to a PImage object
*/
@@ -9434,7 +9455,7 @@ public class PApplet extends Applet
/**
* Removes texture image for current shape.
- * Needs to be called between @see beginShape and @see endShape
+ * Needs to be called between beginShape and endShape
*
*/
public void noTexture() {
@@ -9472,6 +9493,24 @@ public class PApplet extends Applet
}
+/**
+ * ( begin auto-generated from vertex.xml )
+ *
+ * All shapes are constructed by connecting a series of vertices. vertex() is used to specify the vertex coordinates for points, lines, triangles, quads, and polygons and is used exclusively within the beginShape() and endShape() function.
Drawing a vertex in 3D using the z parameter requires the P3D or OPENGL parameter in combination with size as shown in the above example.
This function is also used to map a texture onto the geometry. The texture() function declares the texture to apply to the geometry and the u and v coordinates set define the mapping of this texture to the form. By default, the coordinates used for u and v are specified in relation to the image's size in pixels, but this relation can be changed with textureMode().
+ *
+ * ( end auto-generated )
+ * @webref shape:vertex
+ * @param x x-coordinate of the vertex
+ * @param y y-coordinate of the vertex
+ * @param z z-coordinate of the vertex
+ * @param u horizontal coordinate for the texture mapping
+ * @param v vertical coordinate for the texture mapping
+ * @see PGraphics#beginShape(int)
+ * @see PGraphics#endShape(int)
+ * @see PGraphics#bezierVertex(float, float, float, float, float, float, float, float, float)
+ * @see PGraphics#curveVertex(float, float, float)
+ * @see PGraphics#texture(PImage)
+ */
public void vertex(float x, float y, float z, float u, float v) {
if (recorder != null) recorder.vertex(x, y, z, u, v);
g.vertex(x, y, z, u, v);
@@ -9491,6 +9530,16 @@ public class PApplet extends Applet
}
+/**
+ * ( begin auto-generated from endShape.xml )
+ *
+ * The endShape() function is the companion to beginShape() and may only be called after beginShape(). When endshape() is called, all of image data defined since the previous call to beginShape() is written into the image buffer. The constant CLOSE as the value for the MODE parameter to close the shape (to connect the beginning and the end).
+ *
+ * ( end auto-generated )
+ * @webref shape:vertex
+ * @param mode use CLOSE to close the shape
+ * @see PGraphics#beginShape(int)
+ */
public void endShape(int mode) {
if (recorder != null) recorder.endShape(mode);
g.endShape(mode);
@@ -9505,6 +9554,26 @@ public class PApplet extends Applet
}
+/**
+ * ( begin auto-generated from bezierVertex.xml )
+ *
+ * Specifies vertex coordinates for Bezier curves. Each call to bezierVertex() defines the position of two control points and one anchor point of a Bezier curve, adding a new segment to a line or shape. The first time bezierVertex() is used within a beginShape() call, it must be prefaced with a call to vertex() to set the first anchor point. This function must be used between beginShape() and endShape() and only when there is no MODE parameter specified to beginShape(). Using the 3D version of requires rendering with P3D or OPENGL (see the Environment reference for more information).
+ *
+ * ( end auto-generated )
+ * @webref shape:vertex
+ * @param x2 the x-coordinate of the 1st control point
+ * @param y2 the y-coordinate of the 1st control point
+ * @param z2 the z-coordinate of the 1st control point
+ * @param x3 the x-coordinate of the 2nd control point
+ * @param y3 the y-coordinate of the 2nd control point
+ * @param z3 the z-coordinate of the 2nd control point
+ * @param x4 the x-coordinate of the anchor point
+ * @param y4 the y-coordinate of the anchor point
+ * @param z4 the z-coordinate of the anchor point
+ * @see PGraphics#curveVertex(float, float, float)
+ * @see PGraphics#vertex(float, float, float, float, float)
+ * @see PGraphics#bezier(float, float, float, float, float, float, float, float, float, float, float, float)
+ */
public void bezierVertex(float x2, float y2, float z2,
float x3, float y3, float z3,
float x4, float y4, float z4) {
@@ -9533,6 +9602,22 @@ public class PApplet extends Applet
}
+/**
+ * ( begin auto-generated from curveVertex.xml )
+ *
+ * Specifies vertex coordinates for curves. This function may only be used between beginShape() and endShape() and only when there is no MODE parameter specified to beginShape(). The first and last points in a series of curveVertex() lines will be used to guide the beginning and end of a the curve. A minimum of four points is required to draw a tiny curve between the second and third points. Adding a fifth point with curveVertex() will draw the curve between the second, third, and fourth points. The curveVertex() function is an implementation of Catmull-Rom splines. Using the 3D version of requires rendering with P3D or OPENGL (see the Environment reference for more information).
+ *
+ * ( end auto-generated )
+ * @webref shape:vertex
+ * @param x the x-coordinate of the vertex
+ * @param y the y-coordinate of the vertex
+ * @param z the z-coordinate of the vertex
+ * @see PGraphics#curve(float, float, float, float, float, float, float, float, float, float, float, float)
+ * @see PGraphics#beginShape(int)
+ * @see PGraphics#endShape(int)
+ * @see PGraphics#vertex(float, float, float, float, float)
+ * @see PGraphics#bezier(float, float, float, float, float, float, float, float, float, float, float, float)
+ */
public void curveVertex(float x, float y, float z) {
if (recorder != null) recorder.curveVertex(x, y, z);
g.curveVertex(x, y, z);
@@ -9546,23 +9631,18 @@ public class PApplet extends Applet
/**
- * Draws a point, a coordinate in space at the dimension of one pixel.
- * The first parameter is the horizontal value for the point, the second
- * value is the vertical value for the point, and the optional third value
- * is the depth value. Drawing this shape in 3D using the z
- * parameter requires the P3D or OPENGL parameter in combination with
- * size as shown in the above example.
- *
Due to what appears to be a bug in Apple's Java implementation,
- * the point() and set() methods are extremely slow in some circumstances
- * when used with the default renderer. Using P2D or P3D will fix the
- * problem. Grouping many calls to point() or set() together can also
- * help. (Bug 1094)
+ * ( begin auto-generated from point.xml )
+ *
+ * Draws a point, a coordinate in space at the dimension of one pixel. The first parameter is the horizontal value for the point, the second value is the vertical value for the point, and the optional third value is the depth value. Drawing this shape in 3D using the z parameter requires the P3D or OPENGL parameter in combination with size as shown in the above example.
+ *
+ * Due to what appears to be a bug in Apple's Java implementation, the point() and set() methods are extremely slow in some circumstances when used with the default renderer. Using P2D or P3D will fix the problem. Grouping many calls to point() or set() together can also help. (Bug 1094)
+ *
+ * ( end auto-generated )
*
* @webref shape:2d_primitives
* @param x x-coordinate of the point
* @param y y-coordinate of the point
* @param z z-coordinate of the point
- *
* @see PGraphics#beginShape()
*/
public void point(float x, float y, float z) {
@@ -9578,17 +9658,11 @@ public class PApplet extends Applet
/**
- * Draws a line (a direct path between two points) to the screen.
- * The version of line() with four parameters draws the line in 2D.
- * To color a line, use the stroke() function. A line cannot be
- * filled, therefore the fill() method will not affect the color
- * of a line. 2D lines are drawn with a width of one pixel by default,
- * but this can be changed with the strokeWeight() function.
- * The version with six parameters allows the line to be placed anywhere
- * within XYZ space. Drawing this shape in 3D using the z parameter
- * requires the P3D or OPENGL parameter in combination with size as shown
- * in the above example.
- *
+ * ( begin auto-generated from line.xml )
+ *
+ * Draws a line (a direct path between two points) to the screen. The version of line() with four parameters draws the line in 2D. To color a line, use the stroke() function. A line cannot be filled, therefore the fill() method will not affect the color of a line. 2D lines are drawn with a width of one pixel by default, but this can be changed with the strokeWeight() function. The version with six parameters allows the line to be placed anywhere within XYZ space. Drawing this shape in 3D using the z parameter requires the P3D or OPENGL parameter in combination with size as shown in the above example.
+ *
+ * ( end auto-generated )
* @webref shape:2d_primitives
* @param x1 x-coordinate of the first point
* @param y1 y-coordinate of the first point
@@ -9596,7 +9670,6 @@ public class PApplet extends Applet
* @param x2 x-coordinate of the second point
* @param y2 y-coordinate of the second point
* @param z2 z-coordinate of the second point
- *
* @see PGraphics#strokeWeight(float)
* @see PGraphics#strokeJoin(int)
* @see PGraphics#strokeCap(int)
@@ -9610,10 +9683,11 @@ public class PApplet extends Applet
/**
- * A triangle is a plane created by connecting three points. The first two
- * arguments specify the first point, the middle two arguments specify
- * the second point, and the last two arguments specify the third point.
- *
+ * ( begin auto-generated from triangle.xml )
+ *
+ * A triangle is a plane created by connecting three points. The first two arguments specify the first point, the middle two arguments specify the second point, and the last two arguments specify the third point.
+ *
+ * ( end auto-generated )
* @webref shape:2d_primitives
* @param x1 x-coordinate of the first point
* @param y1 y-coordinate of the first point
@@ -9621,7 +9695,6 @@ public class PApplet extends Applet
* @param y2 y-coordinate of the second point
* @param x3 x-coordinate of the third point
* @param y3 y-coordinate of the third point
- *
* @see PApplet#beginShape()
*/
public void triangle(float x1, float y1, float x2, float y2,
@@ -9632,12 +9705,11 @@ public class PApplet extends Applet
/**
- * A quad is a quadrilateral, a four sided polygon. It is similar to
- * a rectangle, but the angles between its edges are not constrained
- * ninety degrees. The first pair of parameters (x1,y1) sets the
- * first vertex and the subsequent pairs should proceed clockwise or
- * counter-clockwise around the defined shape.
- *
+ * ( begin auto-generated from quad.xml )
+ *
+ * A quad is a quadrilateral, a four sided polygon. It is similar to a rectangle, but the angles between its edges are not constrained to ninety degrees. The first pair of parameters (x1,y1) sets the first vertex and the subsequent pairs should proceed clockwise or counter-clockwise around the defined shape.
+ *
+ * ( end auto-generated )
* @webref shape:2d_primitives
* @param x1 x-coordinate of the first corner
* @param y1 y-coordinate of the first corner
@@ -9647,7 +9719,6 @@ public class PApplet extends Applet
* @param y3 y-coordinate of the third corner
* @param x4 x-coordinate of the fourth corner
* @param y4 y-coordinate of the fourth corner
- *
*/
public void quad(float x1, float y1, float x2, float y2,
float x3, float y3, float x4, float y4) {
@@ -9656,6 +9727,16 @@ public class PApplet extends Applet
}
+ /**
+ * ( begin auto-generated from rectMode.xml )
+ *
+ * Modifies the location from which rectangles draw. The default mode is rectMode(CORNER), which specifies the location to be the upper left corner of the shape and uses the third and fourth parameters of rect() to specify the width and height. The syntax rectMode(CORNERS) uses the first and second parameters of rect() to set the location of one corner and uses the third and fourth parameters to set the opposite corner. The syntax rectMode(CENTER) draws the image from its center point and uses the third and forth parameters of rect() to specify the image's width and height. The syntax rectMode(RADIUS) draws the image from its center point and uses the third and forth parameters of rect() to specify half of the image's width and height. The parameter must be written in ALL CAPS because Processing is a case sensitive language. Note: In version 125, the mode named CENTER_RADIUS was shortened to RADIUS.
+ *
+ * ( end auto-generated )
+ * @webref shape:attributes
+ * @param mode either CORNER, CORNERS, CENTER, or RADIUS
+ * @see PGraphics#rect(float, float, float, float)
+ */
public void rectMode(int mode) {
if (recorder != null) recorder.rectMode(mode);
g.rectMode(mode);
@@ -9663,20 +9744,16 @@ public class PApplet extends Applet
/**
- * Draws a rectangle to the screen. A rectangle is a four-sided shape with
- * every angle at ninety degrees. The first two parameters set the location,
- * the third sets the width, and the fourth sets the height. The origin is
- * changed with the rectMode() function.
- *
+ * ( begin auto-generated from rect.xml )
+ *
+ * Draws a rectangle to the screen. A rectangle is a four-sided shape with every angle at ninety degrees. By default, the first two parameters set the location of the upper-left corner, the third sets the width, and the fourth sets the height. These parameters may be changed with the rectMode() function.
+ *
+ * ( end auto-generated )
* @webref shape:2d_primitives
* @param a x-coordinate of the rectangle
* @param b y-coordinate of the rectangle
* @param c width of the rectangle
* @param d height of the rectangle
- * @param tl radius of the top left corner
- * @param tr radius of the top right corner
- * @param br radius of the bottom right corner
- * @param bl radius of the bottom left corner
* @see PGraphics#rectMode(int)
* @see PGraphics#quad(float, float, float, float, float, float, float, float)
*/
@@ -9686,6 +9763,7 @@ public class PApplet extends Applet
}
+/** ??? */
public void rect(float a, float b, float c, float d, float r) {
if (recorder != null) recorder.rect(a, b, c, d, r);
g.rect(a, b, c, d, r);
@@ -9700,20 +9778,13 @@ public class PApplet extends Applet
/**
- * The origin of the ellipse is modified by the ellipseMode()
- * function. The default configuration is ellipseMode(CENTER),
- * which specifies the location of the ellipse as the center of the shape.
- * The RADIUS mode is the same, but the width and height parameters to
- * ellipse() specify the radius of the ellipse, rather than the
- * diameter. The CORNER mode draws the shape from the upper-left corner
- * of its bounding box. The CORNERS mode uses the four parameters to
- * ellipse() to set two opposing corners of the ellipse's bounding
- * box. The parameter must be written in "ALL CAPS" because Processing
- * syntax is case sensitive.
- *
+ * ( begin auto-generated from ellipseMode.xml )
+ *
+ * The origin of the ellipse is modified by the ellipseMode() function. The default configuration is ellipseMode(CENTER), which specifies the location of the ellipse as the center of the shape. The RADIUS mode is the same, but the width and height parameters to ellipse() specify the radius of the ellipse, rather than the diameter. The CORNER mode draws the shape from the upper-left corner of its bounding box. The CORNERS mode uses the four parameters to ellipse() to set two opposing corners of the ellipse's bounding box. The parameter must be written in "ALL CAPS" because Processing is a case sensitive language.
+ *
+ * ( end auto-generated )
* @webref shape:attributes
- *
- * @param mode Either CENTER, RADIUS, CORNER, or CORNERS.
+ * @param mode either CENTER, RADIUS, CORNER, or CORNERS
* @see PApplet#ellipse(float, float, float, float)
*/
public void ellipseMode(int mode) {
@@ -9723,17 +9794,16 @@ public class PApplet extends Applet
/**
- * Draws an ellipse (oval) in the display window. An ellipse with an equal
- * width and height is a circle. The first two parameters set
- * the location, the third sets the width, and the fourth sets the height.
- * The origin may be changed with the ellipseMode() function.
- *
+ * ( begin auto-generated from ellipse.xml )
+ *
+ * Draws an ellipse (oval) in the display window. An ellipse with an equal width and height is a circle. The first two parameters set the location, the third sets the width, and the fourth sets the height. The origin may be changed with the ellipseMode() function.
+ *
+ * ( end auto-generated )
* @webref shape:2d_primitives
* @param a x-coordinate of the ellipse
* @param b y-coordinate of the ellipse
* @param c width of the ellipse
* @param d height of the ellipse
- *
* @see PApplet#ellipseMode(int)
*/
public void ellipse(float a, float b, float c, float d) {
@@ -9743,14 +9813,11 @@ public class PApplet extends Applet
/**
- * Draws an arc in the display window.
- * Arcs are drawn along the outer edge of an ellipse defined by the
- * x, y, width and height parameters.
- * The origin or the arc's ellipse may be changed with the
- * ellipseMode() function.
- * The start and stop parameters specify the angles
- * at which to draw the arc.
- *
+ * ( begin auto-generated from arc.xml )
+ *
+ * Draws an arc in the display window. Arcs are drawn along the outer edge of an ellipse defined by the x, y, width and height parameters. The origin or the arc's ellipse may be changed with the ellipseMode() function. The start and stop parameters specify the angles at which to draw the arc.
+ *
+ * ( end auto-generated )
* @webref shape:2d_primitives
* @param a x-coordinate of the arc's ellipse
* @param b y-coordinate of the arc's ellipse
@@ -9758,7 +9825,6 @@ public class PApplet extends Applet
* @param d height of the arc's ellipse
* @param start angle to start the arc, specified in radians
* @param stop angle to stop the arc, specified in radians
- *
* @see PGraphics#ellipseMode(int)
* @see PGraphics#ellipse(float, float, float, float)
*/
@@ -9779,15 +9845,16 @@ public class PApplet extends Applet
/**
- * A box is an extruded rectangle. A box with equal dimension
- * on all sides is a cube.
- *
+ * ( begin auto-generated from box.xml )
+ *
+ * A box is an extruded rectangle. A box with equal dimension on all sides is a cube.
+ *
+ * ( end auto-generated )
* @webref shape:3d_primitives
* @param w dimension of the box in the x-dimension
* @param h dimension of the box in the y-dimension
* @param d dimension of the box in the z-dimension
- *
- * @see PApplet#sphere(float)
+ * @see PGraphics#sphere(float)
*/
public void box(float w, float h, float d) {
if (recorder != null) recorder.box(w, h, d);
@@ -9805,29 +9872,18 @@ public class PApplet extends Applet
/**
- * Controls the detail used to render a sphere by adjusting the number of
- * vertices of the sphere mesh. The default resolution is 30, which creates
- * a fairly detailed sphere definition with vertices every 360/30 = 12
- * degrees. If you're going to render a great number of spheres per frame,
- * it is advised to reduce the level of detail using this function.
- * The setting stays active until sphereDetail() is called again with
- * a new parameter and so should not be called prior to every
- * sphere() statement, unless you wish to render spheres with
- * different settings, e.g. using less detail for smaller spheres or ones
- * further away from the camera. To control the detail of the horizontal
- * and vertical resolution independently, use the version of the functions
- * with two parameters.
- *
+ * ( begin auto-generated from sphereDetail.xml )
+ *
+ * Controls the detail used to render a sphere by adjusting the number of vertices of the sphere mesh. The default resolution is 30, which creates a fairly detailed sphere definition with vertices every 360/30 = 12 degrees. If you're going to render a great number of spheres per frame, it is advised to reduce the level of detail using this function. The setting stays active until sphereDetail() is called again with a new parameter and so should not be called prior to every sphere() statement, unless you wish to render spheres with different settings, e.g. using less detail for smaller spheres or ones further away from the camera. To control the detail of the horizontal and vertical resolution independently, use the version of the functions with two parameters.
+ *
+ * ( end auto-generated )
* Advanced
* Code for sphereDetail() submitted by toxi [031031].
* Code for enhanced u/v version from davbol [080801].
*
* @webref shape:3d_primitives
- * @param ures number of segments used horizontally (longitudinally)
- * per full circle revolution
- * @param vres number of segments used vertically (latitudinally)
- * from top to bottom
- *
+ * @param ures number of segments used longitudinally per full circle revolutoin
+ * @param vres number of segments used latitudinally from top to bottom
* @see PGraphics#sphere(float)
*/
/**
@@ -9842,8 +9898,11 @@ public class PApplet extends Applet
/**
- * Draw a sphere with radius r centered at coordinate 0, 0, 0.
+ * ( begin auto-generated from sphere.xml )
+ *
* A sphere is a hollow ball made from tessellated triangles.
+ *
+ * ( end auto-generated )
* Advanced
* Advanced
* For instance, to convert the following example:
* stroke(255, 102, 0);
@@ -9908,7 +9966,6 @@ public class PApplet extends Applet
* @param c coordinate of second control point
* @param d coordinate of second point on the curve
* @param t value between 0 and 1
- *
* @see PGraphics#bezier(float, float, float, float, float, float, float, float, float, float, float, float)
* @see PGraphics#bezierVertex(float, float, float, float, float, float)
* @see PGraphics#curvePoint(float, float, float, float, float)
@@ -9919,9 +9976,11 @@ public class PApplet extends Applet
/**
- * Calculates the tangent of a point on a Bezier curve. There is a good
- * definition of "tangent" at Wikipedia: http://en.wikipedia.org/wiki/Tangent
- *
+ * ( begin auto-generated from bezierTangent.xml )
+ *
+ * Calculates the tangent of a point on a Bezier curve. There is a good definition of "tangent" at Wikipedia: http://en.wikipedia.org/wiki/Tangent
+ *
+ * ( end auto-generated )
* Advanced
* Code submitted by Dave Bollinger (davol) for release 0136.
*
@@ -9931,7 +9990,6 @@ public class PApplet extends Applet
* @param c coordinate of second control point
* @param d coordinate of second point on the curve
* @param t value between 0 and 1
- *
* @see PGraphics#bezier(float, float, float, float, float, float, float, float, float, float, float, float)
* @see PGraphics#bezierVertex(float, float, float, float, float, float)
* @see PGraphics#curvePoint(float, float, float, float, float)
@@ -9942,14 +10000,16 @@ public class PApplet extends Applet
/**
+ * ( begin auto-generated from bezierDetail.xml )
+ *
* Sets the resolution at which Beziers display. The default value is 20. This function is only useful when using the P3D or OPENGL renderer as the default (JAVA2D) renderer does not use this information.
- *
+ *
+ * ( end auto-generated )
* @webref shape:curves
* @param detail resolution of the curves
- *
- * @see PApplet#curve(float, float, float, float, float, float, float, float, float, float, float, float)
- * @see PApplet#curveVertex(float, float)
- * @see PApplet#curveTightness(float)
+ * @see PGraphics#curve(float, float, float, float, float, float, float, float, float, float, float, float)
+ * @see PGraphics#curveVertex(float, float, float)
+ * @see PGraphics#curveTightness(float)
*/
public void bezierDetail(int detail) {
if (recorder != null) recorder.bezierDetail(detail);
@@ -9957,15 +10017,21 @@ public class PApplet extends Applet
}
+ public void bezier(float x1, float y1,
+ float x2, float y2,
+ float x3, float y3,
+ float x4, float y4) {
+ if (recorder != null) recorder.bezier(x1, y1, x2, y2, x3, y3, x4, y4);
+ g.bezier(x1, y1, x2, y2, x3, y3, x4, y4);
+ }
+
+
/**
- * Draws a Bezier curve on the screen. These curves are defined by a series
- * of anchor and control points. The first two parameters specify the first
- * anchor point and the last two parameters specify the other anchor point.
- * The middle parameters specify the control points which define the shape
- * of the curve. Bezier curves were developed by French engineer Pierre
- * Bezier. Using the 3D version of requires rendering with P3D or OPENGL
- * (see the Environment reference for more information).
- *
+ * ( begin auto-generated from bezier.xml )
+ *
+ * Draws a Bezier curve on the screen. These curves are defined by a series of anchor and control points. The first two parameters specify the first anchor point and the last two parameters specify the other anchor point. The middle parameters specify the control points which define the shape of the curve. Bezier curves were developed by French engineer Pierre Bezier. Using the 3D version of requires rendering with P3D or OPENGL (see the Environment reference for more information).
+ *
+ * ( end auto-generated )
* Advanced
* Draw a cubic bezier curve. The first and last points are
* the on-curve points. The middle two are the 'control' points,
@@ -10006,15 +10072,6 @@ public class PApplet extends Applet
* @see PGraphics#bezierVertex(float, float, float, float, float, float)
* @see PGraphics#curve(float, float, float, float, float, float, float, float, float, float, float, float)
*/
- public void bezier(float x1, float y1,
- float x2, float y2,
- float x3, float y3,
- float x4, float y4) {
- if (recorder != null) recorder.bezier(x1, y1, x2, y2, x3, y3, x4, y4);
- g.bezier(x1, y1, x2, y2, x3, y3, x4, y4);
- }
-
-
public void bezier(float x1, float y1, float z1,
float x2, float y2, float z2,
float x3, float y3, float z3,
@@ -10024,20 +10081,18 @@ public class PApplet extends Applet
}
- /**
- * Evalutes the Catmull-Rom curve at point t for points a, b, c, d. The
- * parameter t varies between 0 and 1, a and d are points on the curve,
- * and b and c are the control points. This can be done once with the x
- * coordinates and a second time with the y coordinates to get the
- * location of a curve at t.
- *
+ /*
+ * ( begin auto-generated from curvePoint.xml )
+ *
+ * Evalutes the curve at point t for points a, b, c, d. The parameter t varies between 0 and 1, a and d are points on the curve, and b and c are the control points. This can be done once with the x coordinates and a second time with the y coordinates to get the location of a curve at t.
+ *
+ * ( end auto-generated )
* @webref shape:curves
* @param a coordinate of first point on the curve
* @param b coordinate of second point on the curve
* @param c coordinate of third point on the curve
* @param d coordinate of fourth point on the curve
* @param t value between 0 and 1
- *
* @see PGraphics#curve(float, float, float, float, float, float, float, float, float, float, float, float)
* @see PGraphics#curveVertex(float, float)
* @see PGraphics#bezierPoint(float, float, float, float, float)
@@ -10048,8 +10103,11 @@ public class PApplet extends Applet
/**
- * Calculates the tangent of a point on a Catmull-Rom curve. There is a good definition of "tangent" at Wikipedia: http://en.wikipedia.org/wiki/Tangent.
- *
+ * ( begin auto-generated from curveTangent.xml )
+ *
+ * Calculates the tangent of a point on a curve. There is a good definition of "tangent" at Wikipedia: http://en.wikipedia.org/wiki/Tangent
+ *
+ * ( end auto-generated )
* Advanced
* Code thanks to Dave Bollinger (Bug #715)
*
@@ -10059,7 +10117,6 @@ public class PApplet extends Applet
* @param c coordinate of second control point
* @param d coordinate of second point on the curve
* @param t value between 0 and 1
- *
* @see PGraphics#curve(float, float, float, float, float, float, float, float, float, float, float, float)
* @see PGraphics#curveVertex(float, float)
* @see PGraphics#curvePoint(float, float, float, float, float)
@@ -10071,13 +10128,13 @@ public class PApplet extends Applet
/**
- * Sets the resolution at which curves display. The default value is 20.
- * This function is only useful when using the P3D or OPENGL renderer as
- * the default (JAVA2D) renderer does not use this information.
- *
+ * ( begin auto-generated from curveDetail.xml )
+ *
+ * Sets the resolution at which curves display. The default value is 20. This function is only useful when using the P3D or OPENGL renderer as the default (JAVA2D) renderer does not use this information.
+ *
+ * ( end auto-generated )
* @webref shape:curves
* @param detail resolution of the curves
- *
* @see PGraphics#curve(float, float, float, float, float, float, float, float, float, float, float, float)
* @see PGraphics#curveVertex(float, float)
* @see PGraphics#curveTightness(float)
@@ -10089,21 +10146,15 @@ public class PApplet extends Applet
/**
- * Modifies the quality of forms created with curve() and
- *curveVertex(). The parameter squishy determines how the
- * curve fits to the vertex points. The value 0.0 is the default value for
- * squishy (this value defines the curves to be Catmull-Rom splines)
- * and the value 1.0 connects all the points with straight lines.
- * Values within the range -5.0 and 5.0 will deform the curves but
- * will leave them recognizable and as values increase in magnitude,
- * they will continue to deform.
- *
+ * ( begin auto-generated from curveTightness.xml )
+ *
+ * Modifies the quality of forms created with curve() and curveVertex(). The parameter squishy determines how the curve fits to the vertex points. The value 0.0 is the default value for squishy (this value defines the curves to be Catmull-Rom splines) and the value 1.0 connects all the points with straight lines. Values within the range -5.0 and 5.0 will deform the curves but will leave them recognizable and as values increase in magnitude, they will continue to deform.
+ *
+ * ( end auto-generated )
* @webref shape:curves
* @param tightness amount of deformation from the original vertices
- *
* @see PGraphics#curve(float, float, float, float, float, float, float, float, float, float, float, float)
* @see PGraphics#curveVertex(float, float)
- *
*/
public void curveTightness(float tightness) {
if (recorder != null) recorder.curveTightness(tightness);
@@ -10111,17 +10162,21 @@ public class PApplet extends Applet
}
+ public void curve(float x1, float y1,
+ float x2, float y2,
+ float x3, float y3,
+ float x4, float y4) {
+ if (recorder != null) recorder.curve(x1, y1, x2, y2, x3, y3, x4, y4);
+ g.curve(x1, y1, x2, y2, x3, y3, x4, y4);
+ }
+
+
/**
- * Draws a curved line on the screen. The first and second parameters
- * specify the beginning control point and the last two parameters specify
- * the ending control point. The middle parameters specify the start and
- * stop of the curve. Longer curves can be created by putting a series of
- * curve() functions together or using curveVertex().
- * An additional function called curveTightness() provides control
- * for the visual quality of the curve. The curve() function is an
- * implementation of Catmull-Rom splines. Using the 3D version of requires
- * rendering with P3D or OPENGL (see the Environment reference for more
- * information).
+ * ( begin auto-generated from curve.xml )
+ *
+ * Draws a curved line on the screen. The first and second parameters specify the beginning control point and the last two parameters specify the ending control point. The middle parameters specify the start and stop of the curve. Longer curves can be created by putting a series of curve() functions together or using curveVertex(). An additional function called curveTightness() provides control for the visual quality of the curve. The curve() function is an implementation of Catmull-Rom splines. Using the 3D version of requires rendering with P3D or OPENGL (see the Environment reference for more information).
+ *
+ * ( end auto-generated )
*
* Advanced
* As of revision 0070, this function no longer doubles the first
@@ -10150,20 +10205,10 @@ public class PApplet extends Applet
* @param x4 coordinates for the ending control point
* @param y4 coordinates for the ending control point
* @param z4 coordinates for the ending control point
- *
* @see PGraphics#curveVertex(float, float)
* @see PGraphics#curveTightness(float)
* @see PGraphics#bezier(float, float, float, float, float, float, float, float, float, float, float, float)
*/
- public void curve(float x1, float y1,
- float x2, float y2,
- float x3, float y3,
- float x4, float y4) {
- if (recorder != null) recorder.curve(x1, y1, x2, y2, x3, y3, x4, y4);
- g.curve(x1, y1, x2, y2, x3, y3, x4, y4);
- }
-
-
public void curve(float x1, float y1, float z1,
float x2, float y2, float z2,
float x3, float y3, float z3,
@@ -10174,8 +10219,21 @@ public class PApplet extends Applet
/**
- * If true in PImage, use bilinear interpolation for copy()
- * operations. When inherited by PGraphics, also controls shapes.
+ * ( begin auto-generated from smooth.xml )
+ *
+ * Draws all geometry with smooth (anti-aliased) edges. This will slow down the frame rate of the application, but will enhance the visual refinement.
+ *
+ * Note that smooth() will also improve image quality of resized images, and noSmooth() will disable image (and font) smoothing altogether.
+ *
+ * Starting in Processing 1.0, smoothing is always enabled with the OPENGL renderer setting. The smooth() and noSmooth() methods are ignored. See the hint() reference for information on disabling smoothing with OpenGL.
+ *
+ * In the current release, smoothing is imperfect with the P2D and P3D renderers. In some situations, drawing with smooth() will create small hairlines inside filled shapes or inaccuracies with shape depth can cause odd visual artifacts at the edges of shapes.
+ *
+ * ( end auto-generated )
+ * @webref shape:attributes
+ * @see PGraphics#noSmooth()
+ * @see PGraphics#hint(int)
+ * @see PApplet#size(int, int, String)
*/
public void smooth() {
if (recorder != null) recorder.smooth();
@@ -10184,7 +10242,13 @@ public class PApplet extends Applet
/**
- * Disable smoothing. See smooth().
+ * ( begin auto-generated from noSmooth.xml )
+ *
+ * Draws all geometry with jagged (aliased) edges.
+ *
+ * ( end auto-generated )
+ * @webref shape:attributes
+ * @see PGraphics#smooth()
*/
public void noSmooth() {
if (recorder != null) recorder.noSmooth();
@@ -10193,25 +10257,19 @@ public class PApplet extends Applet
/**
- * Modifies the location from which images draw. The default mode is
- * imageMode(CORNER), which specifies the location to be the
- * upper-left corner and uses the fourth and fifth parameters of
- * image() to set the image's width and height. The syntax
- * imageMode(CORNERS) uses the second and third parameters of
- * image() to set the location of one corner of the image and
- * uses the fourth and fifth parameters to set the opposite corner.
- * Use imageMode(CENTER) to draw images centered at the given
- * x and y position.
- *
The parameter to imageMode() must be written in
- * ALL CAPS because Processing syntax is case sensitive.
- *
+ * ( begin auto-generated from imageMode.xml )
+ *
+ * Modifies the location from which images draw. The default mode is imageMode(CORNER), which specifies the location to be the upper left corner and uses the fourth and fifth parameters of image() to set the image's width and height. The syntax imageMode(CORNERS) uses the second and third parameters of image() to set the location of one corner of the image and uses the fourth and fifth parameters to set the opposite corner. Use imageMode(CENTER) to draw images centered at the given x and y position.
+ *
+ * The parameter to imageMode() must be written in ALL CAPS because Processing is a case sensitive language.
+ *
+ * ( end auto-generated )
* @webref image:loading_displaying
- * @param mode Either CORNER, CORNERS, or CENTER
- *
- * @see processing.core.PApplet#loadImage(String, String)
- * @see processing.core.PImage
- * @see processing.core.PApplet#image(PImage, float, float, float, float)
- * @see processing.core.PGraphics#background(float, float, float, float)
+ * @param mode either CORNER, CORNERS, or CENTER
+ * @see PApplet#loadImage(String, String)
+ * @see PImage
+ * @see PGraphics#image(PImage, float, float, float, float)
+ * @see PGraphics#background(float, float, float, float)
*/
public void imageMode(int mode) {
if (recorder != null) recorder.imageMode(mode);
@@ -10226,20 +10284,14 @@ public class PApplet extends Applet
/**
- * Displays images to the screen. The images must be in the sketch's "data"
- * directory to load correctly. Select "Add file..." from the "Sketch" menu
- * to add the image. Processing currently works with GIF, JPEG, and Targa
- * images. The color of an image may be modified with the tint()
- * function and if a GIF has transparency, it will maintain its transparency.
- * The img parameter specifies the image to display and the x
- * and y parameters define the location of the image from its
- * upper-left corner. The image is displayed at its original size unless
- * the width and height parameters specify a different size.
- * The imageMode() function changes the way the parameters work.
- * A call to imageMode(CORNERS) will change the width and height
- * parameters to define the x and y values of the opposite corner of the
- * image.
- *
+ * ( begin auto-generated from image.xml )
+ *
+ * Displays images to the screen. The images must be in the sketch's "data" directory to load correctly. Select "Add file..." from the "Sketch" menu to add the image. Processing currently works with GIF, JPEG, and Targa images. The color of an image may be modified with the tint() function and if a GIF has transparency, it will maintain its transparency. The img parameter specifies the image to display and the x and y parameters define the location of the image from its upper-left corner. The image is displayed at its original size unless the width and height parameters specify a different size. The imageMode() function changes the way the parameters work. A call to imageMode(CORNERS) will change the width and height parameters to define the x and y values of the opposite corner of the image.
+ *
+ * Starting with release 0124, when using the default (JAVA2D) renderer,
+ * smooth() will also improve image quality of resized images.
+ *
+ * ( end auto-generated )
* Advanced
* Starting with release 0124, when using the default (JAVA2D) renderer,
* smooth() will also improve image quality of resized images.
@@ -10250,13 +10302,12 @@ public class PApplet extends Applet
* @param y y-coordinate of the image
* @param c width to display the image
* @param d height to display the image
- *
- * @see processing.core.PApplet#loadImage(String, String)
- * @see processing.core.PImage
- * @see processing.core.PGraphics#imageMode(int)
- * @see processing.core.PGraphics#tint(float)
- * @see processing.core.PGraphics#background(float, float, float, float)
- * @see processing.core.PGraphics#alpha(int)
+ * @see PApplet#loadImage(String, String)
+ * @see PImage
+ * @see PGraphics#imageMode(int)
+ * @see PGraphics#tint(float)
+ * @see PGraphics#background(float, float, float, float)
+ * @see PGraphics#alpha(int)
*/
public void image(PImage image, float x, float y, float c, float d) {
if (recorder != null) recorder.image(image, x, y, c, d);
@@ -10269,6 +10320,7 @@ public class PApplet extends Applet
* In this method, the u, v coordinates are always based on image space
* location, regardless of the current textureMode().
*/
+ /** ??? */
public void image(PImage image,
float a, float b, float c, float d,
int u1, int v1, int u2, int v2) {
@@ -10278,22 +10330,13 @@ public class PApplet extends Applet
/**
- * Modifies the location from which shapes draw.
- * The default mode is shapeMode(CORNER), which specifies the
- * location to be the upper left corner of the shape and uses the third
- * and fourth parameters of shape() to specify the width and height.
- * The syntax shapeMode(CORNERS) uses the first and second parameters
- * of shape() to set the location of one corner and uses the third
- * and fourth parameters to set the opposite corner.
- * The syntax shapeMode(CENTER) draws the shape from its center point
- * and uses the third and forth parameters of shape() to specify the
- * width and height.
- * The parameter must be written in "ALL CAPS" because Processing syntax
- * is case sensitive.
- *
- * @param mode One of CORNER, CORNERS, CENTER
- *
+ * ( begin auto-generated from shapeMode.xml )
+ *
+ * Modifies the location from which shapes draw. The default mode is shapeMode(CORNER), which specifies the location to be the upper left corner of the shape and uses the third and fourth parameters of shape() to specify the width and height. The syntax shapeMode(CORNERS) uses the first and second parameters of shape() to set the location of one corner and uses the third and fourth parameters to set the opposite corner. The syntax shapeMode(CENTER) draws the shape from its center point and uses the third and forth parameters of shape() to specify the width and height. The parameter must be written in "ALL CAPS" because Processing is a case sensitive language.
+ *
+ * ( end auto-generated )
* @webref shape:loading_displaying
+ * @param mode either CORNER, CORNERS, CENTER
* @see PGraphics#shape(PShape)
* @see PGraphics#rectMode(int)
*/
@@ -10319,30 +10362,19 @@ public class PApplet extends Applet
/**
- * Displays shapes to the screen. The shapes must be in the sketch's "data"
- * directory to load correctly. Select "Add file..." from the "Sketch" menu
- * to add the shape.
- * Processing currently works with SVG shapes only.
- * The sh parameter specifies the shape to display and the x
- * and y parameters define the location of the shape from its
- * upper-left corner.
- * The shape is displayed at its original size unless the width
- * and height parameters specify a different size.
- * The shapeMode() function changes the way the parameters work.
- * A call to shapeMode(CORNERS), for example, will change the width
- * and height parameters to define the x and y values of the opposite corner
- * of the shape.
- *
- * Note complex shapes may draw awkwardly with P2D, P3D, and OPENGL. Those
- * renderers do not yet support shapes that have holes or complicated breaks.
- *
- * @param shape
+ * ( begin auto-generated from shape.xml )
+ *
+ * Displays shapes to the screen. The shapes must be in the sketch's "data" directory to load correctly. Select "Add file..." from the "Sketch" menu to add the shape. Processing currently works with SVG shapes only. The sh parameter specifies the shape to display and the x and y parameters define the location of the shape from its upper-left corner. The shape is displayed at its original size unless the width and height parameters specify a different size. The shapeMode() function changes the way the parameters work. A call to shapeMode(CORNERS), for example, will change the width and height parameters to define the x and y values of the opposite corner of the shape.
+ *
+ * Note complex shapes may draw awkwardly with P2D, P3D, and OPENGL. Those renderers do not yet support shapes that have holes or complicated breaks.
+ *
+ * ( end auto-generated )
+ * @webref shape:loading_displaying
+ * @param shape the shape to display
* @param x x-coordinate of the shape
* @param y y-coordinate of the shape
* @param c width to display the shape
* @param d height to display the shape
- *
- * @webref shape:loading_displaying
* @see PShape
* @see PApplet#loadShape(String)
* @see PGraphics#shapeMode(int)
@@ -10353,10 +10385,6 @@ public class PApplet extends Applet
}
- /**
- * Sets the alignment of the text to one of LEFT, CENTER, or RIGHT.
- * This will also reset the vertical text alignment to BASELINE.
- */
public void textAlign(int align) {
if (recorder != null) recorder.textAlign(align);
g.textAlign(align);
@@ -10364,9 +10392,23 @@ public class PApplet extends Applet
/**
- * Sets the horizontal and vertical alignment of the text. The horizontal
- * alignment can be one of LEFT, CENTER, or RIGHT. The vertical alignment
- * can be TOP, BOTTOM, CENTER, or the BASELINE (the default).
+ * ( begin auto-generated from textAlign.xml )
+ *
+ * Sets the current alignment for drawing text. The parameters LEFT, CENTER, and RIGHT set the display characteristics of the letters in relation to the values for the x and y parameters of the text() function.
+ *
+ * In Processing 0125 and later, an optional second parameter can be used to vertically align the text. BASELINE is the default, and the vertical alignment will be reset to BASELINE if the second parameter is not used. The TOP and CENTER parameters are straightforward. The BOTTOM parameter offsets the line based on the current textDescent(). For multiple lines, the final line will be aligned to the bottom, with the previous lines appearing above it.
+ *
+ * When using text() with width and height parameters, BASELINE is ignored, and treated as TOP. (Otherwise, text would by default draw outside the box, since BASELINE is the default setting. BASELINE is not a useful drawing mode for text drawn in a rectangle.)
+ *
+ * The vertical alignment is based on the value of textAscent(), which many fonts do not specify correctly. It may be necessary to use a hack and offset by a few pixels by hand so that the offset looks correct. To do this as less of a hack, use some percentage of textAscent() or textDescent() so that the hack works even if you change the size of the font.
+ *
+ * ( end auto-generated )
+ * @webref typography:attributes
+ * @param alignX horizontal alignment, either LEFT, CENTER, or RIGHT
+ * @param alignY vertical alignment, either TOP, BOTTOM, CENTER, or BASELINE
+ * @see PApplet#loadFont(String)
+ * @see PFont
+ * @see PGraphics#text(String, float, float, float, float, float)
*/
public void textAlign(int alignX, int alignY) {
if (recorder != null) recorder.textAlign(alignX, alignY);
@@ -10375,9 +10417,13 @@ public class PApplet extends Applet
/**
- * Returns the ascent of the current font at the current size.
- * This is a method, rather than a variable inside the PGraphics object
- * because it requires calculation.
+ * ( begin auto-generated from textAscent.xml )
+ *
+ * Returns ascent of the current font at its current size. This information is useful for determining the height of the font above the baseline. For example, adding the textAscent() and textDescent() values will give you the total height of the line.
+ *
+ * ( end auto-generated )
+ * @webref typography:metrics
+ * @see PGraphics#textDescent()
*/
public float textAscent() {
return g.textAscent();
@@ -10385,9 +10431,13 @@ public class PApplet extends Applet
/**
- * Returns the descent of the current font at the current size.
- * This is a method, rather than a variable inside the PGraphics object
- * because it requires calculation.
+ * ( begin auto-generated from textDescent.xml )
+ *
+ * Returns descent of the current font at its current size. This information is useful for determining the height of the font below the baseline. For example, adding the textAscent() and textDescent() values will give you the total height of the line.
+ *
+ * ( end auto-generated )
+ * @webref typography:metrics
+ * @see PGraphics#textAscent()
*/
public float textDescent() {
return g.textDescent();
@@ -10395,9 +10445,17 @@ public class PApplet extends Applet
/**
- * Sets the current font. The font's size will be the "natural"
- * size of this font (the size that was set when using "Create Font").
- * The leading will also be reset.
+ * ( begin auto-generated from textFont.xml )
+ *
+ * Sets the current font that will be drawn with the text() function. Fonts must be loaded with loadFont() before it can be used. This font will be used in all subsequent calls to the text() function. If no size parameter is input, the font will appear at its original size (the size it was created at with the "Create Font..." tool) until it is changed with textSize().
Because fonts are usually bitmaped, you should create fonts at the sizes that will be used most commonly. Using textFont() without the size parameter will result in the cleanest-looking text.
With the default (JAVA2D) and PDF renderers, it's also possible to enable the use of native fonts via the command hint(ENABLE_NATIVE_FONTS). This will produce vector text in JAVA2D sketches and PDF output in cases where the vector data is available: when the font is still installed, or the font is created via the createFont() function (rather than the Create Font tool).
+ *
+ * ( end auto-generated )
+ * @webref typography:loading_display
+ * @param which any variable of the type PFont
+ * @see PApplet#createFont(String, float, boolean)
+ * @see PApplet#loadFont(String)
+ * @see PFont#PFont
+ * @see PGraphics#text(String, float, float, float, float, float)
*/
public void textFont(PFont which) {
if (recorder != null) recorder.textFont(which);
@@ -10406,7 +10464,7 @@ public class PApplet extends Applet
/**
- * Useful function to set the font and size at the same time.
+ * @param size the size of the letters in units of pixels
*/
public void textFont(PFont which, float size) {
if (recorder != null) recorder.textFont(which, size);
@@ -10415,9 +10473,17 @@ public class PApplet extends Applet
/**
- * Set the text leading to a specific value. If using a custom
- * value for the text leading, you'll have to call textLeading()
- * again after any calls to textSize().
+ * ( begin auto-generated from textLeading.xml )
+ *
+ * Sets the spacing between lines of text in units of pixels. This setting will be used in all subsequent calls to the text() function.
+ *
+ * ( end auto-generated )
+ * @webref typography:attributes
+ * @param leading the sie in pixels for spacing between lines
+ * @see PApplet#loadFont(String)
+ * @see PFont#PFont
+ * @see PGraphics#text(String, float, float, float, float, float)
+ * @see PGraphics#textFont(PFont)
*/
public void textLeading(float leading) {
if (recorder != null) recorder.textLeading(leading);
@@ -10426,10 +10492,24 @@ public class PApplet extends Applet
/**
- * Sets the text rendering/placement to be either MODEL (the normal mode,
- * where text bitmaps are used (or the native font, when available).
- * Or SHAPE, where text is rendered as actual vector data (much slower in
- * some cases, faster in others). SCREEN mode has been removed for 2.0.
+ * ( begin auto-generated from textMode.xml )
+ *
+ * Sets the way text draws to the screen. In the default configuration (the MODEL mode), it's possible to rotate, scale, and place letters in two and three dimensional space.
+ *
+ * Changing to SCREEN mode draws letters directly to the front of the window and greatly increases rendering quality and speed when used with the P2D and P3D renderers. textMode(SCREEN) with OPENGL and JAVA2D (the default) renderers will generally be slower, though pixel accurate with P2D and P3D. With textMode(SCREEN), the letters draw at the actual size of the font (in pixels) and therefore calls to textSize() will not affect the size of the letters. To create a font at the size you desire, use the "Create font..." option in the Tools menu, or use the createFont() function. When using textMode(SCREEN), any z-coordinate passed to a text() command will be ignored, because your computer screen is...flat!
+ *
+ * The SHAPE mode draws text using the the glyph outlines of individual characters rather than as textures. This mode is only only supported with the PDF and OPENGL renderer settings. With the PDF renderer, you must call textMode(SHAPE) before any other drawing occurs. If the outlines are not available, then textMode(SHAPE) will be ignored and textMode(MODEL) will be used instead.
+ *
+ * The textMode(SHAPE) option in OPENGL mode can be combined with beginRaw() to write vector-accurate text to 2D and 3D output files, for instance DXF or PDF. textMode(SHAPE) is not currently optimized for OPENGL, so if recording shape data, use textMode(MODEL) until you're ready to capture the geometry with beginRaw().
+ *
+ * ( end auto-generated )
+ * @webref typography:attributes
+ * @param mode either MODEL, SCREEN, or SHAPE
+ * @see PApplet#loadFont(String)
+ * @see PFont#PFont
+ * @see PGraphics#text(String, float, float, float, float, float)
+ * @see PGraphics#textFont(PFont)
+ * @see PApplet#createFont(String, float, boolean)
*/
public void textMode(int mode) {
if (recorder != null) recorder.textMode(mode);
@@ -10438,7 +10518,17 @@ public class PApplet extends Applet
/**
- * Sets the text size, also resets the value for the leading.
+ * ( begin auto-generated from textSize.xml )
+ *
+ * Sets the current font size. This size will be used in all subsequent calls to the text() function. Font size is measured in units of pixels.
+ *
+ * ( end auto-generated )
+ * @webref typography:attributes
+ * @param size the size of the letters in units of pixels
+ * @see PApplet#loadFont(String)
+ * @see PFont#PFont
+ * @see PGraphics#text(String, float, float, float, float, float)
+ * @see PGraphics#textFont(PFont)
*/
public void textSize(float size) {
if (recorder != null) recorder.textSize(size);
@@ -10452,8 +10542,17 @@ public class PApplet extends Applet
/**
- * Return the width of a line of text. If the text has multiple
- * lines, this returns the length of the longest line.
+ * ( begin auto-generated from textWidth.xml )
+ *
+ * Calculates and returns the width of any character or text string.
+ *
+ * ( end auto-generated )
+ * @webref typography:attributes
+ * @param str
+ * @see PApplet#loadFont(String)
+ * @see PFont#PFont
+ * @see PGraphics#text(String, float, float, float, float, float)
+ * @see PGraphics#textFont(PFont)
*/
public float textWidth(String str) {
return g.textWidth(str);
@@ -10461,6 +10560,7 @@ public class PApplet extends Applet
/**
+ * ???
* TODO not sure if this stays...
*/
public float textWidth(char[] chars, int start, int length) {
@@ -10469,7 +10569,22 @@ public class PApplet extends Applet
/**
- * Write text where we just left off.
+ * ( begin auto-generated from text.xml )
+ *
+ * Draws text to the screen. Displays the information specified in the data or stringdata parameters on the screen in the position specified by the x and y parameters and the optional z parameter. A default font will be used unless a font is set with the textFont() function. Change the color of the text with the fill() function. The text displays in relation to the textAlign() function, which gives the option to draw to the left, right, and center of the coordinates.
+ *
+ * The width and height parameters define a rectangular area to display within and may only be used with string data. For text drawn inside a rectangle, the coordinates are interpreted based on the current rectMode() setting.
+ *
+ * Use the textMode() function with the SCREEN parameter to display text in 2D at the surface of the window.
+ *
+ * ( end auto-generated )
+ * @webref typography:loading_displaying
+ * @param c the alphanumeric symbols to be displayed
+ * @see PGraphics#textAlign(int, int)
+ * @see PGraphics#textMode(int)
+ * @see PApplet#loadFont(String)
+ * @see PFont#PFont
+ * @see PGraphics#textFont(PFont)
*/
public void text(char c) {
if (recorder != null) recorder.text(c);
@@ -10478,9 +10593,12 @@ public class PApplet extends Applet
/**
+ * Advanced
* Draw a single character on screen.
* Extremely slow when used with textMode(SCREEN) and Java 2D,
* because loadPixels has to be called first and updatePixels last.
+ * @param x x-coordinate of text
+ * @param y y-coordinate of text
*/
public void text(char c, float x, float y) {
if (recorder != null) recorder.text(c, x, y);
@@ -10489,7 +10607,7 @@ public class PApplet extends Applet
/**
- * Draw a single character on screen (with a z coordinate)
+ * @param z z-coordinate of text
*/
public void text(char c, float x, float y, float z) {
if (recorder != null) recorder.text(c, x, y, z);
@@ -10498,7 +10616,7 @@ public class PApplet extends Applet
/**
- * Write text where we just left off.
+ * @param str the alphanumeric symbols to be displayed
*/
public void text(String str) {
if (recorder != null) recorder.text(str);
@@ -10507,6 +10625,7 @@ public class PApplet extends Applet
/**
+ * Advanced
* Draw a chunk of text.
* Newlines that are \n (Unix newline or linefeed char, ascii 10)
* are honored, but \r (carriage return, Windows and Mac OS) are
@@ -10519,9 +10638,15 @@ public class PApplet extends Applet
/**
+ * Advanced
* Method to draw text from an array of chars. This method will usually be
* more efficient than drawing from a String object, because the String will
* not be converted to a char array before drawing.
+ * @param chars letters to be displayed
+ * @param start ???
+ * @param stop ???
+ * @param x ???
+ * @param y ???
*/
public void text(char[] chars, int start, int stop, float x, float y) {
if (recorder != null) recorder.text(chars, start, stop, x, y);
@@ -10546,6 +10671,7 @@ public class PApplet extends Applet
/**
+ * Advanced
* Draw text in a box that is constrained to a particular size.
* The current rectMode() determines what the coordinates mean
* (whether x1/y1/x2/y2 or x/y/w/h).
@@ -10557,6 +10683,11 @@ public class PApplet extends Applet
* Newlines that are \n (Unix newline or linefeed char, ascii 10)
* are honored, and \r (carriage return, Windows and Mac OS) are
* ignored.
+ *
+ * @param x1 x-coordinate of text
+ * @param y1 y-coordinate of text
+ * @param x2 ???
+ * @param y2 ???
*/
public void text(String str, float x1, float y1, float x2, float y2) {
if (recorder != null) recorder.text(str, x1, y1, x2, y2);
@@ -10588,6 +10719,8 @@ public class PApplet extends Applet
* Users who want more control should use their own nf() cmmand,
* or if they want the long, ugly version of float,
* use String.valueOf() to convert the float to a String first.
+ *
+ * @param num the alphanumeric symbols to be displayed
*/
public void text(float num, float x, float y) {
if (recorder != null) recorder.text(num, x, y);
@@ -10602,7 +10735,18 @@ public class PApplet extends Applet
/**
- * Push a copy of the current transformation matrix onto the stack.
+ * ( begin auto-generated from pushMatrix.xml )
+ *
+ * Pushes the current transformation matrix onto the matrix stack. Understanding pushMatrix() and popMatrix() requires understanding the concept of a matrix stack. The pushMatrix() function saves the current coordinate system to the stack and popMatrix() restores the prior coordinate system. pushMatrix() and popMatrix() are used in conjuction with the other transformation methods and may be embedded to control the scope of the transformations.
+ *
+ * ( end auto-generated )
+ * @webref transform
+ * @see PGraphics#popMatrix()
+ * @see PGraphics#translate(float, float, float)
+ * @see PGraphics#rotate(float)
+ * @see PGraphics#rotateX(float)
+ * @see PGraphics#rotateY(float)
+ * @see PGraphics#rotateZ(float)
*/
public void pushMatrix() {
if (recorder != null) recorder.pushMatrix();
@@ -10611,7 +10755,13 @@ public class PApplet extends Applet
/**
- * Replace the current transformation matrix with the top of the stack.
+ * ( begin auto-generated from popMatrix.xml )
+ *
+ * Pops the current transformation matrix off the matrix stack. Understanding pushing and popping requires understanding the concept of a matrix stack. The pushMatrix() function saves the current coordinate system to the stack and popMatrix() restores the prior coordinate system. pushMatrix() and popMatrix() are used in conjuction with the other transformation methods and may be embedded to control the scope of the transformations.
+ *
+ * ( end auto-generated )
+ * @webref transform
+ * @see PGraphics#pushMatrix()
*/
public void popMatrix() {
if (recorder != null) recorder.popMatrix();
@@ -10620,7 +10770,21 @@ public class PApplet extends Applet
/**
- * Translate in X and Y.
+ * ( begin auto-generated from translate.xml )
+ *
+ * Specifies an amount to displace objects within the display window. The x parameter specifies left/right translation, the y parameter specifies up/down translation, and the z parameter specifies translations toward/away from the screen. Using this function with the z parameter requires using the P3D or OPENGL parameter in combination with size as shown in the above example. Transformations apply to everything that happens after and subsequent calls to the function accumulates the effect. For example, calling translate(50, 0) and then translate(20, 0) is the same as translate(70, 0). If translate() is called within draw(), the transformation is reset when the loop begins again. This function can be further controlled by the pushMatrix() and popMatrix().
+ *
+ * ( end auto-generated )
+ * @webref transform
+ * @param tx left/right translation
+ * @param ty up/down translation
+ * @see PGraphics#popMatrix()
+ * @see PGraphics#pushMatrix()
+ * @see PGraphics#rotate(float)
+ * @see PGraphics#rotateX(float)
+ * @see PGraphics#rotateY(float)
+ * @see PGraphics#rotateZ(float)
+ * @see PGraphics#scale(float, float, float)
*/
public void translate(float tx, float ty) {
if (recorder != null) recorder.translate(tx, ty);
@@ -10629,7 +10793,7 @@ public class PApplet extends Applet
/**
- * Translate in X, Y, and Z.
+ * @param tz forward/backward translation
*/
public void translate(float tx, float ty, float tz) {
if (recorder != null) recorder.translate(tx, ty, tz);
@@ -10638,13 +10802,24 @@ public class PApplet extends Applet
/**
- * Two dimensional rotation.
- *
- * Same as rotateZ (this is identical to a 3D rotation along the z-axis)
- * but included for clarity. It'd be weird for people drawing 2D graphics
- * to be using rotateZ. And they might kick our a-- for the confusion.
- *
- * Additional background.
+ * ( begin auto-generated from rotate.xml )
+ *
+ * Rotates a shape the amount specified by the angle parameter. Angles should be specified in radians (values from 0 to TWO_PI) or converted to radians with the radians() function.
+ *
+ * Objects are always rotated around their relative position to the origin and positive numbers rotate objects in a clockwise direction. Transformations apply to everything that happens after and subsequent calls to the function accumulates the effect. For example, calling rotate(HALF_PI) and then rotate(HALF_PI) is the same as rotate(PI). All tranformations are reset when draw() begins again.
+ *
+ * Technically, rotate() multiplies the current transformation matrix by a rotation matrix. This function can be further controlled by the pushMatrix() and popMatrix().
+ *
+ * ( end auto-generated )
+ * @webref transform
+ * @param angle angle of rotation specified in radians
+ * @see PGraphics#popMatrix()
+ * @see PGraphics#pushMatrix()
+ * @see PGraphics#rotateX(float)
+ * @see PGraphics#rotateY(float)
+ * @see PGraphics#rotateZ(float)
+ * @see PGraphics#scale(float, float, float)
+ * @see PApplet#radians(float)
*/
public void rotate(float angle) {
if (recorder != null) recorder.rotate(angle);
@@ -10653,7 +10828,20 @@ public class PApplet extends Applet
/**
- * Rotate around the X axis.
+ * ( begin auto-generated from rotateX.xml )
+ *
+ * Rotates a shape around the x-axis the amount specified by the angle parameter. Angles should be specified in radians (values from 0 to PI*2) or converted to radians with the radians() function. Objects are always rotated around their relative position to the origin and positive numbers rotate objects in a counterclockwise direction. Transformations apply to everything that happens after and subsequent calls to the function accumulates the effect. For example, calling rotateX(PI/2) and then rotateX(PI/2) is the same as rotateX(PI). If rotateX() is called within the draw(), the transformation is reset when the loop begins again. This function requires passing P3D or OPENGL into the size() parameter as shown in the example above.
+ *
+ * ( end auto-generated )
+ * @webref transform
+ * @param angle angle of rotation specified in radians
+ * @see PGraphics#popMatrix()
+ * @see PGraphics#pushMatrix()
+ * @see PGraphics#rotate(float)
+ * @see PGraphics#rotateY(float)
+ * @see PGraphics#rotateZ(float)
+ * @see PGraphics#scale(float, float, float)
+ * @see PGraphics#translate(float, float, float)
*/
public void rotateX(float angle) {
if (recorder != null) recorder.rotateX(angle);
@@ -10662,7 +10850,20 @@ public class PApplet extends Applet
/**
- * Rotate around the Y axis.
+ * ( begin auto-generated from rotateY.xml )
+ *
+ * Rotates a shape around the y-axis the amount specified by the angle parameter. Angles should be specified in radians (values from 0 to PI*2) or converted to radians with the radians() function. Objects are always rotated around their relative position to the origin and positive numbers rotate objects in a counterclockwise direction. Transformations apply to everything that happens after and subsequent calls to the function accumulates the effect. For example, calling rotateY(PI/2) and then rotateY(PI/2) is the same as rotateY(PI). If rotateY() is called within the draw(), the transformation is reset when the loop begins again. This function requires passing P3D or OPENGL into the size() parameter as shown in the example above.
+ *
+ * ( end auto-generated )
+ * @webref transform
+ * @param angle angle of rotation specified in radians
+ * @see PGraphics#popMatrix()
+ * @see PGraphics#pushMatrix()
+ * @see PGraphics#rotate(float)
+ * @see PGraphics#rotateX(float)
+ * @see PGraphics#rotateZ(float)
+ * @see PGraphics#scale(float, float, float)
+ * @see PGraphics#translate(float, float, float)
*/
public void rotateY(float angle) {
if (recorder != null) recorder.rotateY(angle);
@@ -10671,12 +10872,20 @@ public class PApplet extends Applet
/**
- * Rotate around the Z axis.
- *
- * The functions rotate() and rotateZ() are identical, it's just that it make
- * sense to have rotate() and then rotateX() and rotateY() when using 3D;
- * nor does it make sense to use a function called rotateZ() if you're only
- * doing things in 2D. so we just decided to have them both be the same.
+ * ( begin auto-generated from rotateZ.xml )
+ *
+ * Rotates a shape around the z-axis the amount specified by the angle parameter. Angles should be specified in radians (values from 0 to PI*2) or converted to radians with the radians() function. Objects are always rotated around their relative position to the origin and positive numbers rotate objects in a counterclockwise direction. Transformations apply to everything that happens after and subsequent calls to the function accumulates the effect. For example, calling rotateZ(PI/2) and then rotateZ(PI/2) is the same as rotateZ(PI). If rotateZ() is called within the draw(), the transformation is reset when the loop begins again. This function requires passing P3D or OPENGL into the size() parameter as shown in the example above.
+ *
+ * ( end auto-generated )
+ * @webref transform
+ * @param angle angle of rotation specified in radians
+ * @see PGraphics#popMatrix()
+ * @see PGraphics#pushMatrix()
+ * @see PGraphics#rotate(float)
+ * @see PGraphics#rotateX(float)
+ * @see PGraphics#rotateY(float)
+ * @see PGraphics#scale(float, float, float)
+ * @see PGraphics#translate(float, float, float)
*/
public void rotateZ(float angle) {
if (recorder != null) recorder.rotateZ(angle);
@@ -10685,7 +10894,11 @@ public class PApplet extends Applet
/**
+ * Advanced
* Rotate about a vector in space. Same as the glRotatef() function.
+ * @param vx ???
+ * @param vy ???
+ * @param vz ???
*/
public void rotate(float angle, float vx, float vy, float vz) {
if (recorder != null) recorder.rotate(angle, vx, vy, vz);
@@ -10694,7 +10907,20 @@ public class PApplet extends Applet
/**
- * Scale in all dimensions.
+ * ( begin auto-generated from scale.xml )
+ *
+ * Increases or decreases the size of a shape by expanding and contracting vertices. Objects always scale from their relative origin to the coordinate system. Scale values are specified as decimal percentages. For example, the function call scale(2.0) increases the dimension of a shape by 200%. Transformations apply to everything that happens after and subsequent calls to the function multiply the effect. For example, calling scale(2.0) and then scale(1.5) is the same as scale(3.0). If scale() is called within draw(), the transformation is reset when the loop begins again. Using this fuction with the z parameter requires passing P3D or OPENGL into the size() parameter as shown in the example above. This function can be further controlled by pushMatrix() and popMatrix().
+ *
+ * ( end auto-generated )
+ * @webref transform
+ * @param s percentage to scale the object
+ * @see PGraphics#popMatrix()
+ * @see PGraphics#pushMatrix()
+ * @see PGraphics#rotate(float)
+ * @see PGraphics#rotateX(float)
+ * @see PGraphics#rotateY(float)
+ * @see PGraphics#rotateZ(float)
+ * @see PGraphics#translate(float, float, float)
*/
public void scale(float s) {
if (recorder != null) recorder.scale(s);
@@ -10703,10 +10929,14 @@ public class PApplet extends Applet
/**
+ * Advanced
* Scale in X and Y. Equivalent to scale(sx, sy, 1).
*
* Not recommended for use in 3D, because the z-dimension is just
* scaled by 1, since there's no way to know what else to scale it by.
+ *
+ * @param sx percentage to scale the object in the x-axis
+ * @param sy percentage to scale the objects in the y-axis
*/
public void scale(float sx, float sy) {
if (recorder != null) recorder.scale(sx, sy);
@@ -10715,7 +10945,9 @@ public class PApplet extends Applet
/**
- * Scale in X, Y, and Z.
+ * @param x percentage to scale the object in the x-axis
+ * @param y percentage to scale the objects in the y-axis
+ * @param z percentage to scale the object in the z-axis
*/
public void scale(float x, float y, float z) {
if (recorder != null) recorder.scale(x, y, z);
@@ -10724,7 +10956,21 @@ public class PApplet extends Applet
/**
- * Shear along X axis
+ * ( begin auto-generated from shearX.xml )
+ *
+ * Shears a shape around the x-axis the amount specified by the angle parameter. Angles should be specified in radians (values from 0 to PI*2) or converted to radians with the radians() function. Objects are always sheared around their relative position to the origin and positive numbers shear objects in a clockwise direction. Transformations apply to everything that happens after and subsequent calls to the function accumulates the effect. For example, calling shearX(PI/2) and then shearX(PI/2) is the same as shearX(PI). If shearX() is called within the draw(), the transformation is reset when the loop begins again. This function works in P2D or JAVA2D mode as shown in the example above.
+ *
+ * Technically, shearX() multiplies the current transformation matrix by a rotation matrix. This function can be further controlled by the pushMatrix() and popMatrix() functions.
+ *
+ * ( end auto-generated )
+ * @webref transform
+ * @param angle angle of shear specified in radians
+ * @see PGraphics#popMatrix()
+ * @see PGraphics#pushMatrix()
+ * @see PGraphics#shearY(float)
+ * @see PGraphics#scale(float, float, float)
+ * @see PGraphics#translate(float, float, float)
+ * @see PApplet#radians(float)
*/
public void shearX(float angle) {
if (recorder != null) recorder.shearX(angle);
@@ -10733,7 +10979,21 @@ public class PApplet extends Applet
/**
- * Shear along Y axis
+ * ( begin auto-generated from shearY.xml )
+ *
+ * Shears a shape around the y-axis the amount specified by the angle parameter. Angles should be specified in radians (values from 0 to PI*2) or converted to radians with the radians() function. Objects are always sheared around their relative position to the origin and positive numbers shear objects in a clockwise direction. Transformations apply to everything that happens after and subsequent calls to the function accumulates the effect. For example, calling shearY(PI/2) and then shearY(PI/2) is the same as shearY(PI). If shearY() is called within the draw(), the transformation is reset when the loop begins again. This function works in P2D or JAVA2D mode as shown in the example above.
+ *
+ * Technically, shearY() multiplies the current transformation matrix by a rotation matrix. This function can be further controlled by the pushMatrix() and popMatrix() functions.
+ *
+ * ( end auto-generated )
+ * @webref transform
+ * @param angle angle of shear specified in radians
+ * @see PGraphics#popMatrix()
+ * @see PGraphics#pushMatrix()
+ * @see PGraphics#shearX(float)
+ * @see PGraphics#scale(float, float, float)
+ * @see PGraphics#translate(float, float, float)
+ * @see PApplet#radians(float)
*/
public void shearY(float angle) {
if (recorder != null) recorder.shearY(angle);
@@ -10742,7 +11002,16 @@ public class PApplet extends Applet
/**
- * Set the current transformation matrix to identity.
+ * ( begin auto-generated from resetMatrix.xml )
+ *
+ * Replaces the current matrix with the identity matrix. The equivalent function in OpenGL is glLoadIdentity().
+ *
+ * ( end auto-generated )
+ * @webref transform
+ * @see PGraphics#pushMatrix()
+ * @see PGraphics#popMatrix()
+ * @see PGraphics#applyMatrix(PMatrix)
+ * @see PGraphics#printMatrix()
*/
public void resetMatrix() {
if (recorder != null) recorder.resetMatrix();
@@ -10750,6 +11019,19 @@ public class PApplet extends Applet
}
+ /**
+ * ( begin auto-generated from applyMatrix.xml )
+ *
+ * Multiplies the current matrix by the one specified through the parameters. This is very slow because it will try to calculate the inverse of the transform, so avoid it whenever possible. The equivalent function in OpenGL is glMultMatrix().
+ *
+ * ( end auto-generated )
+ * @webref transform
+ * @source ???
+ * @see PGraphics#pushMatrix()
+ * @see PGraphics#popMatrix()
+ * @see PGraphics#resetMatrix()
+ * @see PGraphics#printMatrix()
+ */
public void applyMatrix(PMatrix source) {
if (recorder != null) recorder.applyMatrix(source);
g.applyMatrix(source);
@@ -10763,7 +11045,12 @@ public class PApplet extends Applet
/**
- * Apply a 3x2 affine transformation matrix.
+ * @param n00 numbers which define the 4x4 matrix to be multiplied
+ * @param n01 numbers which define the 4x4 matrix to be multiplied
+ * @param n02 numbers which define the 4x4 matrix to be multiplied
+ * @param n10 numbers which define the 4x4 matrix to be multiplied
+ * @param n11 numbers which define the 4x4 matrix to be multiplied
+ * @param n12 numbers which define the 4x4 matrix to be multiplied
*/
public void applyMatrix(float n00, float n01, float n02,
float n10, float n11, float n12) {
@@ -10772,6 +11059,17 @@ public class PApplet extends Applet
}
+ /**
+ * @param n13 numbers which define the 4x4 matrix to be multiplied
+ * @param n20 numbers which define the 4x4 matrix to be multiplied
+ * @param n21 numbers which define the 4x4 matrix to be multiplied
+ * @param n22 numbers which define the 4x4 matrix to be multiplied
+ * @param n23 numbers which define the 4x4 matrix to be multiplied
+ * @param n30 numbers which define the 4x4 matrix to be multiplied
+ * @param n31 numbers which define the 4x4 matrix to be multiplied
+ * @param n32 numbers which define the 4x4 matrix to be multiplied
+ * @param n33 numbers which define the 4x4 matrix to be multiplied
+ */
public void applyMatrix(PMatrix3D source) {
if (recorder != null) recorder.applyMatrix(source);
g.applyMatrix(source);
@@ -10841,7 +11139,16 @@ public class PApplet extends Applet
/**
- * Print the current model (or "transformation") matrix.
+ * ( begin auto-generated from printMatrix.xml )
+ *
+ * Prints the current matrix to the text window.
+ *
+ * ( end auto-generated )
+ * @webref transform
+ * @see PGraphics#pushMatrix()
+ * @see PGraphics#popMatrix()
+ * @see PGraphics#resetMatrix()
+ * @see PGraphics#applyMatrix(PMatrix)
*/
public void printMatrix() {
if (recorder != null) recorder.printMatrix();
@@ -10849,24 +11156,68 @@ public class PApplet extends Applet
}
+/**
+ * ( begin auto-generated from beginCamera.xml )
+ *
+ * The beginCamera() and endCamera() functions enable advanced customization of the camera space. The functions are useful if you want to more control over camera movement, however for most users, the camera() function will be sufficient.
The camera functions will replace any transformations (such as rotate() or translate()) that occur before them in draw(), but they will not automatically replace the camera transform itself. For this reason, camera functions should be placed at the beginning of draw() (so that transformations happen afterwards), and the camera() function can be used after beginCamera() if you want to reset the camera before applying transformations.
This function sets the matrix mode to the camera matrix so calls such as translate(), rotate(), applyMatrix() and resetMatrix() affect the camera. beginCamera() should always be used with a following endCamera() and pairs of beginCamera() and endCamera() cannot be nested.
+ *
+ * ( end auto-generated )
+ * @webref lights_camera:camera
+ * @see PGraphics#camera()
+ * @see PGraphics#endCamera()
+ * @see PGraphics#applyMatrix(PMatrix)
+ * @see PGraphics#resetMatrix()
+ * @see PGraphics#translate(float, float, float)
+ * @see PGraphics#scale(float, float, float)
+ */
public void beginCamera() {
if (recorder != null) recorder.beginCamera();
g.beginCamera();
}
+/**
+ * ( begin auto-generated from endCamera.xml )
+ *
+ * The beginCamera() and endCamera() functions enable advanced customization of the camera space. Please see the reference for beginCamera() for a description of how the functions are used.
+ *
+ * ( end auto-generated )
+ * @webref lights_camera:camera
+ * @see PGraphics#camera(float, float, float, float, float, float, float, float, float)
+ */
public void endCamera() {
if (recorder != null) recorder.endCamera();
g.endCamera();
}
+/**
+ * ( 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. Moving the eye position and the direction it is pointing (the center of the scene) allows the images to be seen from different angles. The version without any parameters sets the camera to the default position, pointing to the center of the display window with the Y axis as up. The default values are camera(width/2.0, height/2.0, (height/2.0) / tan(PI*60.0 / 360.0), width/2.0, height/2.0, 0, 0, 1, 0). This function is similar to gluLookAt() in OpenGL, but it first clears the current camera settings.
+ *
+ * ( end auto-generated )
+ * @webref lights_camera:camera
+ * @see PGraphics#endCamera()
+ * @see PGraphics#frustum(float, float, float, float, float, float)
+ */
public void camera() {
if (recorder != null) recorder.camera();
g.camera();
}
+/**
+ * @param eyeX x-coordinate for the eye
+ * @param eyeY y-coordinate for the eye
+ * @param eyeZ z-coordinate for the eye
+ * @param centerX x-coordinate for the center of the scene
+ * @param centerY y-coordinate for the center of the scene
+ * @param centerZ z-coordinate for the center of the scene
+ * @param upX usually 0.0, 1.0, or -1.0
+ * @param upY usually 0.0, 1.0, or -1.0
+ * @param upZ usually 0.0, 1.0, or -1.0
+ */
public void camera(float eyeX, float eyeY, float eyeZ,
float centerX, float centerY, float centerZ,
float upX, float upY, float upZ) {
@@ -10875,18 +11226,41 @@ public class PApplet extends Applet
}
+/**
+ * ( begin auto-generated from printCamera.xml )
+ *
+ * Prints the current camera matrix to the text window.
+ *
+ * ( end auto-generated )
+ * @webref lights_camera:camera
+ * @see PGraphics#camera(float, float, float, float, float, float, float, float, float)
+ */
public void printCamera() {
if (recorder != null) recorder.printCamera();
g.printCamera();
}
+/**
+ * ( begin auto-generated from ortho.xml )
+ *
+ * Sets an orthographic projection and defines a parallel clipping volume. All objects with the same dimension appear the same size, regardless of whether they are near or far from the camera. The parameters to this function specify the clipping volume where left and right are the minimum and maximum x values, top and bottom are the minimum and maximum y values, and near and far are the minimum and maximum z values. If no parameters are given, the default is used: ortho(0, width, 0, height, -10, 10).
+ *
+ * ( end auto-generated )
+ * @webref lights_camera:camera
+ */
public void ortho() {
if (recorder != null) recorder.ortho();
g.ortho();
}
+/**
+ * @param left left plane of the clipping volume
+ * @param right right plane of the clipping volume
+ * @param bottom bottom plane of the clipping volume
+ * @param top top plane of the clipping volume
+ */
public void ortho(float left, float right,
float bottom, float top) {
if (recorder != null) recorder.ortho(left, right, bottom, top);
@@ -10894,6 +11268,10 @@ public class PApplet extends Applet
}
+/**
+ * @param near maximum distance from the origin to the viewer
+ * @param far maximum distance from the origin away from the viewer
+ */
public void ortho(float left, float right,
float bottom, float top,
float near, float far) {
@@ -10902,18 +11280,49 @@ public class PApplet extends Applet
}
+/**
+ * ( begin auto-generated from perspective.xml )
+ *
+ * Sets a perspective projection applying foreshortening, making distant objects appear smaller than closer ones. The parameters define a viewing volume with the shape of truncated pyramid. Objects near to the front of the volume appear their actual size, while farther objects appear smaller. This projection simulates the perspective of the world more accurately than orthographic projection. The version of perspective without parameters sets the default perspective and the version with four parameters allows the programmer to set the area precisely. The default values are: perspective(PI/3.0, width/height, cameraZ/10.0, cameraZ*10.0) where cameraZ is ((height/2.0) / tan(PI*60.0/360.0));
+ *
+ * ( end auto-generated )
+ * @webref lights_camera:camera
+ */
public void perspective() {
if (recorder != null) recorder.perspective();
g.perspective();
}
+/**
+ * @param fovy field-of-view angle (in radians) for vertical direction
+ * @param aspect ratio of width to height
+ * @param zNear z-position of nearest clipping plane
+ * @param zFar z-position of nearest farthest plane
+ */
public void perspective(float fovy, float aspect, float zNear, float zFar) {
if (recorder != null) recorder.perspective(fovy, aspect, zNear, zFar);
g.perspective(fovy, aspect, zNear, zFar);
}
+/**
+ * ( begin auto-generated from frustum.xml )
+ *
+ * Sets a perspective matrix defined through the parameters. Works like glFrustum, except it wipes out the current perspective matrix rather than muliplying itself with it.
+ *
+ * ( end auto-generated )
+ * @webref lights_camera:camera
+ * @param left left coordinate of the clipping plane
+ * @param right right coordinate of the clipping plane
+ * @param bottom bottom coordinate of the clipping plane
+ * @param top top coordinate of the clipping plane
+ * @param near near component of the clipping plane
+ * @param far far component of the clipping plane
+ * @see PGraphics#camera(float, float, float, float, float, float, float, float, float)
+ * @see PGraphics#endCamera()
+ * @see PGraphics#perspective(float, float, float, float)
+ */
public void frustum(float left, float right,
float bottom, float top,
float near, float far) {
@@ -10922,6 +11331,15 @@ public class PApplet extends Applet
}
+/**
+ * ( begin auto-generated from printProjection.xml )
+ *
+ * Prints the current projection matrix to the text window.
+ *
+ * ( end auto-generated )
+ * @webref lights_camera:camera
+ * @see PGraphics#camera(float, float, float, float, float, float, float, float, float)
+ */
public void printProjection() {
if (recorder != null) recorder.printProjection();
g.printProjection();
@@ -10929,9 +11347,16 @@ public class PApplet extends Applet
/**
- * Given an x and y coordinate, returns the x position of where
- * that point would be placed on screen, once affected by translate(),
- * scale(), or any other transformations.
+ * ( 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.
+ *
+ * ( end auto-generated )
+ * @webref lights_camera:coordinates
+ * @param x 3D x-coordinate to be mapped
+ * @param y 3D y-coordinate to be mapped
+ * @see PGraphics#screenY(float, float, float)
+ * @see PGraphics#screenZ(float, float, float)
*/
public float screenX(float x, float y) {
return g.screenX(x, y);
@@ -10939,9 +11364,16 @@ public class PApplet extends Applet
/**
- * Given an x and y coordinate, returns the y position of where
- * that point would be placed on screen, once affected by translate(),
- * scale(), or any other transformations.
+ * ( 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.
+ *
+ * ( end auto-generated )
+ * @webref lights_camera:coordinates
+ * @param x 3D x-coordinate to be mapped
+ * @param y 3D y-coordinate to be mapped
+ * @see PGraphics#screenX(float, float, float)
+ * @see PGraphics#screenZ(float, float, float)
*/
public float screenY(float x, float y) {
return g.screenY(x, y);
@@ -10949,11 +11381,7 @@ public class PApplet extends Applet
/**
- * Maps a three dimensional point to its placement on-screen.
- *
+ * In the example, the modelX(), modelY(), and modelZ() methods record the location of a box in space after being placed using a series of translate and rotate commands. After popMatrix() is called, those transformations no longer apply, but the (x, y, z) coordinate returned by the model functions is used to place another box in the same location.
+ *
+ * ( end auto-generated )
+ * @webref lights_camera
+ * @param x 3D x-coordinate to be mapped
+ * @param y 3D y-coordinate to be mapped
+ * @param z 3D z-coordinate to be mapped
+ * @see PGraphics#modelY(float, float, float)
+ * @see PGraphics#modelZ(float, float, float)
*/
public float modelX(float x, float y, float z) {
return g.modelX(x, y, z);
@@ -11003,7 +11435,19 @@ public class PApplet extends Applet
/**
- * Returns the model space y value for an x, y, z coordinate.
+ * ( begin auto-generated from modelY.xml )
+ *
+ * Returns the three-dimensional X, Y, Z position in model space. This returns the Y value for a given coordinate based on the current set of transformations (scale, rotate, translate, etc.) The Y value can be used to place an object in space relative to the location of the original point once the transformations are no longer in use.
+ *
+ * In the example, the modelX(), modelY(), and modelZ() methods record the location of a box in space after being placed using a series of translate and rotate commands. After popMatrix() is called, those transformations no longer apply, but the (x, y, z) coordinate returned by the model functions is used to place another box in the same location.
+ *
+ * ( end auto-generated )
+ * @webref lights_camera
+ * @param x 3D x-coordinate to be mapped
+ * @param y 3D y-coordinate to be mapped
+ * @param z 3D z-coordinate to be mapped
+ * @see PGraphics#modelX(float, float, float)
+ * @see PGraphics#modelZ(float, float, float)
*/
public float modelY(float x, float y, float z) {
return g.modelY(x, y, z);
@@ -11011,19 +11455,52 @@ public class PApplet extends Applet
/**
- * Returns the model space z value for an x, y, z coordinate.
+ * ( begin auto-generated from modelZ.xml )
+ *
+ * Returns the three-dimensional X, Y, Z position in model space. This returns the Z value for a given coordinate based on the current set of transformations (scale, rotate, translate, etc.) The Z value can be used to place an object in space relative to the location of the original point once the transformations are no longer in use.
+ *
+ * In the example, the modelX(), modelY(), and modelZ() methods record the location of a box in space after being placed using a series of translate and rotate commands. After popMatrix() is called, those transformations no longer apply, but the (x, y, z) coordinate returned by the model functions is used to place another box in the same location.
+ *
+ * ( end auto-generated )
+ * @webref lights_camera
+ * @param x 3D x-coordinate to be mapped
+ * @param y 3D y-coordinate to be mapped
+ * @param z 3D z-coordinate to be mapped
+ * @see PGraphics#modelX(float, float, float)
+ * @see PGraphics#modelY(float, float, float)
*/
public float modelZ(float x, float y, float z) {
return g.modelZ(x, y, z);
}
+/**
+ * ( begin auto-generated from pushStyle.xml )
+ *
+ * The pushStyle() function saves the current style settings and popStyle() restores the prior settings. Note that these functions are always used together. They allow you to change the style settings and later return to what you had. When a new style is started with pushStyle(), it builds on the current style information. The pushStyle() and popStyle() functions can be embedded to provide more control (see the second example above for a demonstration.)
+ *
+ * The style information controlled by the following functions are included in the style:
+ * fill(), stroke(), tint(), strokeWeight(), strokeCap(), strokeJoin(), imageMode(), rectMode(), ellipseMode(), shapeMode(), colorMode(), textAlign(), textFont(), textMode(), textSize(), textLeading(), emissive(), specular(), shininess(), ambient()
+ *
+ * ( end auto-generated )
+ * @webref structure
+ * @see PGraphics#popStyle()
+ */
public void pushStyle() {
if (recorder != null) recorder.pushStyle();
g.pushStyle();
}
+/**
+ * ( 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. They allow you to change the style settings and later return to what you had. When a new style is started with pushStyle(), it builds on the current style information. The pushStyle() and popStyle() functions can be embedded to provide more control (see the second example above for a demonstration.)
+ *
+ * ( end auto-generated )
+ * @webref structure
+ * @see PGraphics#pushStyle()
+ */
public void popStyle() {
if (recorder != null) recorder.popStyle();
g.popStyle();
@@ -11036,18 +11513,65 @@ public class PApplet extends Applet
}
+/**
+ * ( begin auto-generated from strokeWeight.xml )
+ *
+ * Sets the width of the stroke used for lines, points, and the border around shapes. All widths are set in units of pixels.
+ *
+ * With P2D, P3D, and OPENGL, series of connected lines (such as the stroke around a polygon, triangle, or ellipse) produce unattractive results when strokeWeight is set (Bug 955).
+ *
+ * When used with P3D, strokeWeight does not interpolate the Z-coordinates of the lines, which means that when rotated, these flat lines will disappear (Bug 956). The OPENGL renderer setting does not share this problem because it always draws lines perpendicular to the screen.
+ *
+ * When using OPENGL, the minimum and maximum values for strokeWeight() are controlled by the graphics card and the operating system's OpenGL implementation. For instance, the weight may not go higher than 10.
+ *
+ * ( end auto-generated )
+ * @webref shape:attributes
+ * @param weight the weight (in pixels) of the stroke
+ * @see PGraphics#stroke(int, float)
+ * @see PGraphics#strokeJoin(int)
+ * @see PGraphics#strokeCap(int)
+ */
public void strokeWeight(float weight) {
if (recorder != null) recorder.strokeWeight(weight);
g.strokeWeight(weight);
}
+/**
+ * ( begin auto-generated from strokeJoin.xml )
+ *
+ * Sets the style of the joints which connect line segments. These joints are either mitered, beveled, or rounded and specified with the corresponding parameters MITER, BEVEL, and ROUND. The default joint is MITER.
+ *
+ * This function is not available with the P2D, P3D, or OPENGL renderers (see bug report). More information about the renderers can be found in the size() reference.
+ *
+ * ( end auto-generated )
+ * @webref shape:attributes
+ * @param join either MITER, BEVEL, ROUND
+ * @see PGraphics#stroke(int, float)
+ * @see PGraphics#strokeWeight(float)
+ * @see PGraphics#strokeCap(int)
+ */
public void strokeJoin(int join) {
if (recorder != null) recorder.strokeJoin(join);
g.strokeJoin(join);
}
+/**
+ * ( begin auto-generated from strokeCap.xml )
+ *
+ * Sets the style for rendering line endings. These ends are either squared, extended, or rounded and specified with the corresponding parameters SQUARE, PROJECT, and ROUND. The default cap is ROUND.
+ *
+ * This function is not available with the P2D, P3D, or OPENGL renderers (see bug report). More information about the renderers can be found in the size() reference.
+ *
+ * ( end auto-generated )
+ * @webref shape:attributes
+ * @param cap either SQUARE, PROJECT, or ROUND
+ * @see PGraphics#stroke(int, float)
+ * @see PGraphics#strokeWeight(float)
+ * @see PGraphics#strokeJoin(int)
+ * @see PApplet#size(int, int, String, String)
+ */
public void strokeCap(int cap) {
if (recorder != null) recorder.strokeCap(cap);
g.strokeCap(cap);
@@ -11055,11 +11579,12 @@ public class PApplet extends Applet
/**
- * Disables drawing the stroke (outline). If both noStroke() and
- * noFill() are called, no shapes will be drawn to the screen.
- *
+ * ( begin auto-generated from noStroke.xml )
+ *
+ * Disables drawing the stroke (outline). If both noStroke() and noFill() are called, nothing will be drawn to the screen.
+ *
+ * ( end auto-generated )
* @webref color:setting
- *
* @see PGraphics#stroke(float, float, float, float)
*/
public void noStroke() {
@@ -11069,10 +11594,22 @@ public class PApplet extends Applet
/**
- * Set the tint to either a grayscale or ARGB value.
- * See notes attached to the fill() function.
+ * ( begin auto-generated from stroke.xml )
+ *
+ * Sets the color used to draw lines and borders around shapes. This color is either specified in terms of the RGB or HSB color depending on the current colorMode() (the default color space is RGB, with each value in the range from 0 to 255).
+ *
+ * When using hexadecimal notation to specify a color, use "#" or "0x" before the values (e.g. #CCFFAA, 0xFFCCFFAA). The # syntax uses six digits to specify a color (the way colors are specified in HTML and CSS). When using the hexadecimal notation starting with "0x", the hexadecimal value must be specified with eight characters; the first two characters define the alpha component and the remainder the red, green, and blue components.
+ *
+ * The value for the parameter "gray" must be less than or equal to the current maximum value as specified by colorMode(). The default maximum value is 255.
+ *
+ * ( end auto-generated )
+ * @webref color:setting
* @param rgb color value in hexadecimal notation
- * (i.e. #FFCC00 or 0xFFFFCC00) or any value of the color datatype
+ * @see PGraphics#noStroke()
+ * @see PGraphics#fill(int, float)
+ * @see PGraphics#tint(int, float)
+ * @see PGraphics#background(float, float, float, float)
+ * @see PGraphics#colorMode(int, float, float, float, float)
*/
public void stroke(int rgb) {
if (recorder != null) recorder.stroke(rgb);
@@ -11080,6 +11617,9 @@ public class PApplet extends Applet
}
+/**
+ * @param alpha opacity of the stroke
+ */
public void stroke(int rgb, float alpha) {
if (recorder != null) recorder.stroke(rgb, alpha);
g.stroke(rgb, alpha);
@@ -11087,7 +11627,6 @@ public class PApplet extends Applet
/**
- *
* @param gray specifies a value between white and black
*/
public void stroke(float gray) {
@@ -11102,6 +11641,11 @@ public class PApplet extends Applet
}
+/**
+ * @param x red or hue value (depending on current color mode)
+ * @param y green or saturation value (depending on current color mode)
+ * @param z blue or brightness value (depending on current color mode)
+ */
public void stroke(float x, float y, float z) {
if (recorder != null) recorder.stroke(x, y, z);
g.stroke(x, y, z);
@@ -11109,26 +11653,7 @@ public class PApplet extends Applet
/**
- * Sets the color used to draw lines and borders around shapes. This color
- * is either specified in terms of the RGB or HSB color depending on the
- * current colorMode() (the default color space is RGB, with each
- * value in the range from 0 to 255).
- *
When using hexadecimal notation to specify a color, use "#" or
- * "0x" before the values (e.g. #CCFFAA, 0xFFCCFFAA). The # syntax uses six
- * digits to specify a color (the way colors are specified in HTML and CSS).
- * When using the hexadecimal notation starting with "0x", the hexadecimal
- * value must be specified with eight characters; the first two characters
- * define the alpha component and the remainder the red, green, and blue
- * components.
- *
The value for the parameter "gray" must be less than or equal
- * to the current maximum value as specified by colorMode().
- * The default maximum value is 255.
- *
- * @webref color:setting
- * @param alpha opacity of the stroke
- * @param x red or hue value (depending on the current color mode)
- * @param y green or saturation value (depending on the current color mode)
- * @param z blue or brightness value (depending on the current color mode)
+ * @param a opacity of the stroke
*/
public void stroke(float x, float y, float z, float a) {
if (recorder != null) recorder.stroke(x, y, z, a);
@@ -11137,11 +11662,15 @@ public class PApplet extends Applet
/**
+ * ( begin auto-generated from noTint.xml )
+ *
* Removes the current fill value for displaying images and reverts to displaying images with their original hues.
- *
+ *
+ * ( end auto-generated )
* @webref image:loading_displaying
- * @see processing.core.PGraphics#tint(float, float, float, float)
- * @see processing.core.PGraphics#image(PImage, float, float, float, float)
+ * @usage web_application
+ * @see PGraphics#tint(float, float, float, float)
+ * @see PGraphics#image(PImage, float, float, float, float)
*/
public void noTint() {
if (recorder != null) recorder.noTint();
@@ -11150,7 +11679,24 @@ public class PApplet extends Applet
/**
- * Set the tint to either a grayscale or ARGB value.
+ * ( begin auto-generated from tint.xml )
+ *
+ * Sets the fill value for displaying images. Images can be tinted to specified colors or made transparent by setting the alpha.
+ *
+ * To make an image transparent, but not change it's color, use white as the tint color and specify an alpha value. For instance, tint(255, 128) will make an image 50% transparent (unless colorMode() has been used).
+ *
+ * When using hexadecimal notation to specify a color, use "#" or "0x" before the values (e.g. #CCFFAA, 0xFFCCFFAA). The # syntax uses six digits to specify a color (the way colors are specified in HTML and CSS). When using the hexadecimal notation starting with "0x", the hexadecimal value must be specified with eight characters; the first two characters define the alpha component and the remainder the red, green, and blue components.
+ *
+ * The value for the parameter "gray" must be less than or equal to the current maximum value as specified by colorMode(). The default maximum value is 255.
+ *
+ * The tint() method is also used to control the coloring of textures in 3D.
+ *
+ * ( end auto-generated )
+ * @webref image:loading_displaying
+ * @usage web_application
+ * @param rgb color value in hexadecimal notation
+ * @see PGraphics#noTint()
+ * @see PGraphics#image(PImage, float, float, float, float)
*/
public void tint(int rgb) {
if (recorder != null) recorder.tint(rgb);
@@ -11160,7 +11706,6 @@ public class PApplet extends Applet
/**
* @param rgb color value in hexadecimal notation
- * (i.e. #FFCC00 or 0xFFFFCC00) or any value of the color datatype
* @param alpha opacity of the image
*/
public void tint(int rgb, float alpha) {
@@ -11184,6 +11729,11 @@ public class PApplet extends Applet
}
+/**
+ * @param x red or hue value (depending on current color mode)
+ * @param y green or saturation value (depending on current color mode)
+ * @param z blue or brightness value (depending on current color mode)
+ */
public void tint(float x, float y, float z) {
if (recorder != null) recorder.tint(x, y, z);
g.tint(x, y, z);
@@ -11191,33 +11741,7 @@ public class PApplet extends Applet
/**
- * Sets the fill value for displaying images. Images can be tinted to
- * specified colors or made transparent by setting the alpha.
- *
To make an image transparent, but not change it's color,
- * use white as the tint color and specify an alpha value. For instance,
- * tint(255, 128) will make an image 50% transparent (unless
- * colorMode() has been used).
- *
- *
When using hexadecimal notation to specify a color, use "#" or
- * "0x" before the values (e.g. #CCFFAA, 0xFFCCFFAA). The # syntax uses six
- * digits to specify a color (the way colors are specified in HTML and CSS).
- * When using the hexadecimal notation starting with "0x", the hexadecimal
- * value must be specified with eight characters; the first two characters
- * define the alpha component and the remainder the red, green, and blue
- * components.
- *
The value for the parameter "gray" must be less than or equal
- * to the current maximum value as specified by colorMode().
- * The default maximum value is 255.
- *
The tint() method is also used to control the coloring of
- * textures in 3D.
- *
- * @webref image:loading_displaying
- * @param x red or hue value
- * @param y green or saturation value
- * @param z blue or brightness value
- *
- * @see processing.core.PGraphics#noTint()
- * @see processing.core.PGraphics#image(PImage, float, float, float, float)
+ * @param z opacity of the image
*/
public void tint(float x, float y, float z, float a) {
if (recorder != null) recorder.tint(x, y, z, a);
@@ -11226,13 +11750,14 @@ public class PApplet extends Applet
/**
- * Disables filling geometry. If both noStroke() and noFill()
- * are called, no shapes will be drawn to the screen.
- *
+ * ( begin auto-generated from noFill.xml )
+ *
+ * Disables filling geometry. If both noStroke() and noFill() are called, nothing will be drawn to the screen.
+ *
+ * ( end auto-generated )
* @webref color:setting
- *
+ * @usage web_application
* @see PGraphics#fill(float, float, float, float)
- *
*/
public void noFill() {
if (recorder != null) recorder.noFill();
@@ -11241,8 +11766,25 @@ public class PApplet extends Applet
/**
- * Set the fill to either a grayscale value or an ARGB int.
+ * ( begin auto-generated from fill.xml )
+ *
+ * Sets the color used to fill shapes. For example, if you run fill(204, 102, 0), all subsequent shapes will be filled with orange. This color is either specified in terms of the RGB or HSB color depending on the current colorMode() (the default color space is RGB, with each value in the range from 0 to 255).
+ *
+ * When using hexadecimal notation to specify a color, use "#" or "0x" before the values (e.g. #CCFFAA, 0xFFCCFFAA). The # syntax uses six digits to specify a color (the way colors are specified in HTML and CSS). When using the hexadecimal notation starting with "0x", the hexadecimal value must be specified with eight characters; the first two characters define the alpha component and the remainder the red, green, and blue components.
+ *
+ * The value for the parameter "gray" must be less than or equal to the current maximum value as specified by colorMode(). The default maximum value is 255.
+ *
+ * To change the color of an image (or a texture), use tint().
+ *
+ * ( end auto-generated )
+ * @webref color:setting
+ * @usage web_application
* @param rgb color value in hexadecimal notation (i.e. #FFCC00 or 0xFFFFCC00) or any value of the color datatype
+ * @see PGraphics#noFill()
+ * @see PGraphics#stroke(int, float)
+ * @see PGraphics#tint(int, float)
+ * @see PGraphics#background(float, float, float, float)
+ * @see PGraphics#colorMode(int, float, float, float, float)
*/
public void fill(int rgb) {
if (recorder != null) recorder.fill(rgb);
@@ -11250,6 +11792,9 @@ public class PApplet extends Applet
}
+/**
+ * @param alpha opacity of the fill
+ */
public void fill(int rgb, float alpha) {
if (recorder != null) recorder.fill(rgb, alpha);
g.fill(rgb, alpha);
@@ -11278,22 +11823,7 @@ public class PApplet extends Applet
/**
- * Sets the color used to fill shapes. For example, if you run fill(204, 102, 0), all subsequent shapes will be filled with orange. This color is either specified in terms of the RGB or HSB color depending on the current colorMode() (the default color space is RGB, with each value in the range from 0 to 255).
- *
When using hexadecimal notation to specify a color, use "#" or "0x" before the values (e.g. #CCFFAA, 0xFFCCFFAA). The # syntax uses six digits to specify a color (the way colors are specified in HTML and CSS). When using the hexadecimal notation starting with "0x", the hexadecimal value must be specified with eight characters; the first two characters define the alpha component and the remainder the red, green, and blue components.
- *
The value for the parameter "gray" must be less than or equal to the current maximum value as specified by colorMode(). The default maximum value is 255.
- *
To change the color of an image (or a texture), use tint().
- *
- * @webref color:setting
- * @param x red or hue value
- * @param y green or saturation value
- * @param z blue or brightness value
- * @param alpha opacity of the fill
- *
- * @see PGraphics#noFill()
- * @see PGraphics#stroke(float)
- * @see PGraphics#tint(float)
- * @see PGraphics#background(float, float, float, float)
- * @see PGraphics#colorMode(int, float, float, float, float)
+ * @param a opacity of the fill
*/
public void fill(float x, float y, float z, float a) {
if (recorder != null) recorder.fill(x, y, z, a);
@@ -11301,84 +11831,205 @@ public class PApplet extends Applet
}
+/**
+ * ( begin auto-generated from ambient.xml )
+ *
+ * Sets the ambient reflectance for shapes drawn to the screen. This is combined with the ambient light component of environment. The color components set through the parameters define the reflectance. For example in the default color mode, setting v1=255, v2=126, v3=0, would cause all the red light to reflect and half of the green light to reflect. Used in combination with emissive(), specular(), and shininess() in setting the material properties of shapes.
+ *
+ * ( end auto-generated )
+ * @webref lights_camera:material_properties
+ * @usage web_application
+ * @param rgb ???
+ * @see PGraphics#emissive(float, float, float)
+ * @see PGraphics#specular(float, float, float)
+ * @see PGraphics#shininess(float)
+ */
public void ambient(int rgb) {
if (recorder != null) recorder.ambient(rgb);
g.ambient(rgb);
}
+/**
+ * @param gray number specifying value between white and black
+ */
public void ambient(float gray) {
if (recorder != null) recorder.ambient(gray);
g.ambient(gray);
}
+/**
+ * @param x red or hue value (depending on current color mode)
+ * @param y green or saturation value (depending on current color mode)
+ * @param z blue or brightness value (depending on current color mode)
+ */
public void ambient(float x, float y, float z) {
if (recorder != null) recorder.ambient(x, y, z);
g.ambient(x, y, z);
}
+/**
+ * ( 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. Specular refers to light which bounces off a surface in a perferred direction (rather than bouncing in all directions like a diffuse light). Used in combination with emissive(), ambient(), and shininess() in setting the material properties of shapes.
+ *
+ * ( end auto-generated )
+ * @webref lights_camera:material_properties
+ * @usage web_application
+ * @param rgb ???
+ * @see PGraphics#emissive(float, float, float)
+ * @see PGraphics#ambient(float, float, float)
+ * @see PGraphics#shininess(float)
+ */
public void specular(int rgb) {
if (recorder != null) recorder.specular(rgb);
g.specular(rgb);
}
+/**
+ * gray number specifying value between white and black
+ */
public void specular(float gray) {
if (recorder != null) recorder.specular(gray);
g.specular(gray);
}
+/**
+ * @param x red or hue value (depending on current color mode)
+ * @param y green or saturation value (depending on current color mode)
+ * @param z blue or brightness value (depending on current color mode)
+ */
public void specular(float x, float y, float z) {
if (recorder != null) recorder.specular(x, y, z);
g.specular(x, y, z);
}
+/**
+ * ( begin auto-generated from shininess.xml )
+ *
+ * Sets the amount of gloss in the surface of shapes. Used in combination with ambient(), specular(), and emissive() in setting the material properties of shapes.
+ *
+ * ( end auto-generated )
+ * @webref lights_camera:material_properties
+ * @usage web_application
+ * @param shine degree of shininess
+ * @see PGraphics#emissive(float, float, float)
+ * @see PGraphics#ambient(float, float, float)
+ * @see PGraphics#specular(float, float, float)
+ */
public void shininess(float shine) {
if (recorder != null) recorder.shininess(shine);
g.shininess(shine);
}
+/**
+ * ( begin auto-generated from emissive.xml )
+ *
+ * Sets the emissive color of the material used for drawing shapes drawn to the screen. Used in combination with ambient(), specular(), and shininess() in setting the material properties of shapes.
+ *
+ * ( end auto-generated )
+ * @webref lights_camera:material_properties
+ * @usage web_application
+ * @param rgb ???
+ * @see PGraphics#ambient(float, float, float)
+ * @see PGraphics#specular(float, float, float)
+ * @see PGraphics#shininess(float)
+ */
public void emissive(int rgb) {
if (recorder != null) recorder.emissive(rgb);
g.emissive(rgb);
}
+/**
+ * gray number specifying value between white and black
+ */
public void emissive(float gray) {
if (recorder != null) recorder.emissive(gray);
g.emissive(gray);
}
+/**
+ * @param x red or hue value (depending on current color mode)
+ * @param y green or saturation value (depending on current color mode)
+ * @param z blue or brightness value (depending on current color mode)
+ */
public void emissive(float x, float y, float z) {
if (recorder != null) recorder.emissive(x, y, z);
g.emissive(x, y, z);
}
+/**
+ * ( begin auto-generated from lights.xml )
+ *
+ * Sets the default ambient light, directional light, falloff, and specular values. The defaults are ambientLight(128, 128, 128) and directionalLight(128, 128, 128, 0, 0, -1), lightFalloff(1, 0, 0), and lightSpecular(0, 0, 0). Lights need to be included in the draw() to remain persistent in a looping program. Placing them in the setup() of a looping program will cause them to only have an effect the first time through the loop.
+ *
+ * ( end auto-generated )
+ * @webref lights_camera:lights
+ * @usage web_application
+ * @see PGraphics#ambientLight(float, float, float, float, float, float)
+ * @see PGraphics#directionalLight(float, float, float, float, float, float)
+ * @see PGraphics#pointLight(float, float, float, float, float, float)
+ * @see PGraphics#spotLight(float, float, float, float, float, float, float, float, float, float, float)
+ * @see PGraphics#noLights()
+ */
public void lights() {
if (recorder != null) recorder.lights();
g.lights();
}
+/**
+ * ( begin auto-generated from noLights.xml )
+ *
+ * Disable all lighting. Lighting is turned off by default and enabled with the lights() method. This function can be used to disable lighting so that 2D geometry (which does not require lighting) can be drawn after a set of lighted 3D geometry.
+ *
+ * ( end auto-generated )
+ * @webref lights_camera:lights
+ * @usage web_application
+ * @see PGraphics#lights()
+ */
public void noLights() {
if (recorder != null) recorder.noLights();
g.noLights();
}
+/**
+ * ( begin auto-generated from ambientLight.xml )
+ *
+ * Adds an ambient light. Ambient light doesn't come from a specific direction, the rays have light have bounced around so much that objects are evenly lit from all sides. Ambient lights are almost always used in combination with other types of lights. Lights need to be included in the draw() to remain persistent in a looping program. Placing them in the setup() of a looping program will cause them to only have an effect the first time through the loop. The effect of the parameters is determined by the current color mode.
+ *
+ * ( end auto-generated )
+ * @webref lights_camera:lights
+ * @usage web_application
+ * @param red red or hue value
+ * @param green green or hue value
+ * @param blue blue or hue value
+ * @see PGraphics#lights()
+ * @see PGraphics#directionalLight(float, float, float, float, float, float)
+ * @see PGraphics#pointLight(float, float, float, float, float, float)
+ * @see PGraphics#spotLight(float, float, float, float, float, float, float, float, float, float, float)
+ */
public void ambientLight(float red, float green, float blue) {
if (recorder != null) recorder.ambientLight(red, green, blue);
g.ambientLight(red, green, blue);
}
+/**
+ * @param x x-coordinate of the light
+ * @param y y-coordinate of the light
+ * @param z z-coordinate of the light
+ */
public void ambientLight(float red, float green, float blue,
float x, float y, float z) {
if (recorder != null) recorder.ambientLight(red, green, blue, x, y, z);
@@ -11386,6 +12037,25 @@ public class PApplet extends Applet
}
+/**
+ * ( begin auto-generated from directionalLight.xml )
+ *
+ * Adds a directional light. Directional light comes from one direction and is stronger when hitting a surface squarely and weaker if it hits at a a gentle angle. After hitting a surface, a directional lights scatters in all directions. Lights need to be included in the draw() to remain persistent in a looping program. Placing them in the setup() of a looping program will cause them to only have an effect the first time through the loop. The affect of the v1, v2, and v3 parameters is determined by the current color mode. The nx, ny, and nz parameters specify the direction the light is facing. For example, setting ny to -1 will cause the geometry to be lit from below (the light is facing directly upward).
+ *
+ * ( end auto-generated )
+ * @webref lights_camera:lights
+ * @usage web_application
+ * @param red red or hue value
+ * @param green green or hue value
+ * @param blue blue or hue value
+ * @param nx direction along the x-axis
+ * @param ny direction along the y-axis
+ * @param nz direction along the z-axis
+ * @see PGraphics#lights()
+ * @see PGraphics#ambientLight(float, float, float, float, float, float)
+ * @see PGraphics#pointLight(float, float, float, float, float, float)
+ * @see PGraphics#spotLight(float, float, float, float, float, float, float, float, float, float, float)
+ */
public void directionalLight(float red, float green, float blue,
float nx, float ny, float nz) {
if (recorder != null) recorder.directionalLight(red, green, blue, nx, ny, nz);
@@ -11422,70 +12092,17 @@ public class PApplet extends Applet
/**
- * Set the background to a gray or ARGB color.
- *
or any value of the color datatype
- */
- public void background(int rgb) {
- if (recorder != null) recorder.background(rgb);
- g.background(rgb);
- }
-
-
- /**
- * See notes about alpha in background(x, y, z, a).
- */
- public void background(int rgb, float alpha) {
- if (recorder != null) recorder.background(rgb, alpha);
- g.background(rgb, alpha);
- }
-
-
- /**
- * Set the background to a grayscale value, based on the
- * current colorMode.
- */
- public void background(float gray) {
- if (recorder != null) recorder.background(gray);
- g.background(gray);
- }
-
-
- /**
- * See notes about alpha in background(x, y, z, a).
- * @param gray specifies a value between white and black
- * @param alpha opacity of the background
- */
- public void background(float gray, float alpha) {
- if (recorder != null) recorder.background(gray, alpha);
- g.background(gray, alpha);
- }
-
-
- /**
- * Set the background to an r, g, b or h, s, b value,
- * based on the current colorMode.
- */
- public void background(float x, float y, float z) {
- if (recorder != null) recorder.background(x, y, z);
- g.background(x, y, z);
- }
-
-
- /**
+ * ( begin auto-generated from background.xml )
+ *
* The background() function sets the color used for the background of the Processing window. The default background is light gray. In the draw() function, the background color is used to clear the display window at the beginning of each frame.
- *
An image can also be used as the background for a sketch, however its width and height must be the same size as the sketch window. To resize an image 'b' to the size of the sketch window, use b.resize(width, height).
- *
Images used as background will ignore the current tint() setting.
- *
It is not possible to use transparency (alpha) in background colors with the main drawing surface, however they will work properly with createGraphics.
- *
+ *
+ * An image can also be used as the background for a sketch, however its width and height must be the same size as the sketch window. To resize an image 'b' to the size of the sketch window, use b.resize(width, height).
+ *
+ * Images used as background will ignore the current tint() setting.
+ *
+ * It is not possible to use transparency (alpha) in background colors with the main drawing surface, however they will work properly with createGraphics().
+ *
+ * ( end auto-generated )
* Advanced
*
or any value of the color datatype
* @see PGraphics#stroke(float)
* @see PGraphics#fill(float)
* @see PGraphics#tint(float)
* @see PGraphics#colorMode(int)
*/
+ public void background(int rgb) {
+ if (recorder != null) recorder.background(rgb);
+ g.background(rgb);
+ }
+
+
+ /**
+ * @param alpha opacity of the background
+ */
+ public void background(int rgb, float alpha) {
+ if (recorder != null) recorder.background(rgb, alpha);
+ g.background(rgb, alpha);
+ }
+
+
+ /**
+ * @param gray specifies a value between white and black
+ */
+ public void background(float gray) {
+ if (recorder != null) recorder.background(gray);
+ g.background(gray);
+ }
+
+
+ public void background(float gray, float alpha) {
+ if (recorder != null) recorder.background(gray, alpha);
+ g.background(gray, alpha);
+ }
+
+
+ /**
+ * @param x red or hue value (depending on the current color mode)
+ * @param y green or saturation value (depending on the current color mode)
+ * @param z blue or brightness value (depending on the current color mode)
+ */
+ public void background(float x, float y, float z) {
+ if (recorder != null) recorder.background(x, y, z);
+ g.background(x, y, z);
+ }
+
+
+/**
+ * @param a opacity of the background
+ */
public void background(float x, float y, float z, float a) {
if (recorder != null) recorder.background(x, y, z, a);
g.background(x, y, z, a);
@@ -11513,6 +12172,7 @@ public class PApplet extends Applet
/**
+ * ???
* Takes an RGB or ARGB image and sets it as the background.
* The width and height of the image must be the same size as the sketch.
* Use image.resize(width, height) to make short work of such a task.
@@ -11530,16 +12190,15 @@ public class PApplet extends Applet
}
- /**
- * @param mode Either RGB or HSB, corresponding to Red/Green/Blue and Hue/Saturation/Brightness
- * @param max range for all color elements
- */
public void colorMode(int mode) {
if (recorder != null) recorder.colorMode(mode);
g.colorMode(mode);
}
+ /**
+ * @param max range for all color elements
+ */
public void colorMode(int mode, float max) {
if (recorder != null) recorder.colorMode(mode, max);
g.colorMode(mode, max);
@@ -11547,13 +12206,9 @@ public class PApplet extends Applet
/**
- * Set the colorMode and the maximum values for (r, g, b)
- * or (h, s, b).
- * colorMode(HSB, 360, 100, 100);
- * because the alpha values were still between 0 and 255.
+ * @param maxX range for the red or hue depending on the current color mode
+ * @param maxY range for the green or saturation depending on the current color mode
+ * @param maxZ range for the blue or brightness depending on the current color mode
*/
public void colorMode(int mode, float maxX, float maxY, float maxZ) {
if (recorder != null) recorder.colorMode(mode, maxX, maxY, maxZ);
@@ -11561,19 +12216,9 @@ public class PApplet extends Applet
}
- /**
- * Changes the way Processing interprets color data. By default, the parameters for fill(), stroke(), background(), and color() are defined by values between 0 and 255 using the RGB color model. The colorMode() function is used to change the numerical range used for specifying colors and to switch color systems. For example, calling colorMode(RGB, 1.0) will specify that values are specified between 0 and 1. The limits for defining colors are altered by setting the parameters range1, range2, range3, and range 4.
- *
- * @webref color:setting
- * @param maxX range for the red or hue depending on the current color mode
- * @param maxY range for the green or saturation depending on the current color mode
- * @param maxZ range for the blue or brightness depending on the current color mode
- * @param maxA range for the alpha
- *
- * @see PGraphics#background(float)
- * @see PGraphics#fill(float)
- * @see PGraphics#stroke(float)
- */
+/**
+ * @param maxA range for the alpha
+ */
public void colorMode(int mode,
float maxX, float maxY, float maxZ, float maxA) {
if (recorder != null) recorder.colorMode(mode, maxX, maxY, maxZ, maxA);
@@ -11582,10 +12227,20 @@ public class PApplet extends Applet
/**
+ * ( begin auto-generated from alpha.xml )
+ *
* Extracts the alpha value from a color.
- *
+ *
+ * ( end auto-generated )
* @webref color:creating_reading
+ * @usage web_application
* @param what any value of the color datatype
+ * @see PGraphics#green(int)
+ * @see PGraphics#red(int)
+ * @see PGraphics#blue(int)
+ * @see PGraphics#hue(int)
+ * @see PGraphics#saturation(int)
+ * @see PGraphics#brightness(int)
*/
public final float alpha(int what) {
return g.alpha(what);
@@ -11593,11 +12248,14 @@ public class PApplet extends Applet
/**
- * Extracts the red value from a color, scaled to match current colorMode(). This value is always returned as a float so be careful not to assign it to an int value.
The red() function is easy to use and undestand, but is slower than another technique. To achieve the same results when working in colorMode(RGB, 255), but with greater speed, use the >> (right shift) operator with a bit mask. For example, the following two lines of code are equivalent:float r1 = red(myColor);
- *
+ * ( begin auto-generated from red.xml )
+ *
+ * Extracts the red value from a color, scaled to match current colorMode(). This value is always returned as a float so be careful not to assign it to an int value.
float r2 = myColor >> 16 & 0xFF;
The red() function is easy to use and undestand, but is slower than another technique. To achieve the same results when working in colorMode(RGB, 255), but with greater speed, use the >> (right shift) operator with a bit mask. For example, the following two lines of code are equivalent:float r1 = red(myColor);
+ *
+ * ( end auto-generated )
* @webref color:creating_reading
+ * @usage web_application
* @param what any value of the color datatype
- *
* @see PGraphics#green(int)
* @see PGraphics#blue(int)
* @see PGraphics#hue(int)
@@ -11611,11 +12269,14 @@ public class PApplet extends Applet
/**
- * Extracts the green value from a color, scaled to match current colorMode(). This value is always returned as a float so be careful not to assign it to an int value.
float r2 = myColor >> 16 & 0xFF;
The green() function is easy to use and undestand, but is slower than another technique. To achieve the same results when working in colorMode(RGB, 255), but with greater speed, use the >> (right shift) operator with a bit mask. For example, the following two lines of code are equivalent:float r1 = green(myColor);
- *
+ * ( begin auto-generated from green.xml )
+ *
+ * Extracts the green value from a color, scaled to match current colorMode(). This value is always returned as a float so be careful not to assign it to an int value.
float r2 = myColor >> 8 & 0xFF;
The green() function is easy to use and undestand, but is slower than another technique. To achieve the same results when working in colorMode(RGB, 255), but with greater speed, use the >> (right shift) operator with a bit mask. For example, the following two lines of code are equivalent:float r1 = green(myColor);
+ *
+ * ( end auto-generated )
* @webref color:creating_reading
+ * @usage web_application
* @param what any value of the color datatype
- *
* @see PGraphics#red(int)
* @see PGraphics#blue(int)
* @see PGraphics#hue(int)
@@ -11629,11 +12290,14 @@ public class PApplet extends Applet
/**
- * Extracts the blue value from a color, scaled to match current colorMode(). This value is always returned as a float so be careful not to assign it to an int value.
float r2 = myColor >> 8 & 0xFF;
The blue() function is easy to use and undestand, but is slower than another technique. To achieve the same results when working in colorMode(RGB, 255), but with greater speed, use a bit mask to remove the other color components. For example, the following two lines of code are equivalent:float r1 = blue(myColor);
- *
+ * ( begin auto-generated from blue.xml )
+ *
+ * Extracts the blue value from a color, scaled to match current colorMode(). This value is always returned as a float so be careful not to assign it to an int value.
float r2 = myColor & 0xFF;
The blue() function is easy to use and undestand, but is slower than another technique. To achieve the same results when working in colorMode(RGB, 255), but with greater speed, use a bit mask to remove the other color components. For example, the following two lines of code are equivalent:float r1 = blue(myColor);
+ *
+ * ( end auto-generated )
* @webref color:creating_reading
+ * @usage web_application
* @param what any value of the color datatype
- *
* @see PGraphics#red(int)
* @see PGraphics#green(int)
* @see PGraphics#hue(int)
@@ -11646,11 +12310,14 @@ public class PApplet extends Applet
/**
+ * ( begin auto-generated from hue.xml )
+ *
* Extracts the hue value from a color.
- *
+ *
+ * ( end auto-generated )
* @webref color:creating_reading
+ * @usage web_application
* @param what any value of the color datatype
- *
* @see PGraphics#red(int)
* @see PGraphics#green(int)
* @see PGraphics#blue(int)
@@ -11663,11 +12330,14 @@ public class PApplet extends Applet
/**
+ * ( begin auto-generated from saturation.xml )
+ *
* Extracts the saturation value from a color.
- *
+ *
+ * ( end auto-generated )
* @webref color:creating_reading
+ * @usage web_application
* @param what any value of the color datatype
- *
* @see PGraphics#red(int)
* @see PGraphics#green(int)
* @see PGraphics#blue(int)
@@ -11680,12 +12350,14 @@ public class PApplet extends Applet
/**
+ * ( begin auto-generated from brightness.xml )
+ *
* Extracts the brightness value from a color.
- *
- *
+ *
+ * ( end auto-generated )
* @webref color:creating_reading
+ * @usage web_application
* @param what any value of the color datatype
- *
* @see PGraphics#red(int)
* @see PGraphics#green(int)
* @see PGraphics#blue(int)
@@ -11698,13 +12370,16 @@ public class PApplet extends Applet
/**
- * Calculates a color or colors between two color at a specific increment. The amt parameter is the amount to interpolate between the two values where 0.0 equal to the first point, 0.1 is very near the first point, 0.5 is half-way in between, etc.
- *
+ * ( begin auto-generated from lerpColor.xml )
+ *
+ * Calculates a color or colors between two color at a specific increment. The amt parameter is the amount to interpolate between the two values where 0.0 equal to the first point, 0.1 is very near the first point, 0.5 is half-way in between, etc.
+ *
+ * ( end auto-generated )
* @webref color:creating_reading
+ * @usage web_application
* @param c1 interpolate from this color
* @param c2 interpolate to this color
* @param amt between 0.0 and 1.0
- *
* @see PGraphics#blendColor(int, int, int)
* @see PGraphics#color(float, float, float, float)
*/
@@ -11714,8 +12389,11 @@ public class PApplet extends Applet
/**
+ *
float r2 = myColor & 0xFF;Advanced
* Interpolate between two colors. Like lerp(), but for the
* individual color components of a color supplied as an int value.
+ *
+ * @param mode ???
*/
static public int lerpColor(int c1, int c2, float amt, int mode) {
return PGraphics.lerpColor(c1, c2, amt, mode);
@@ -11924,6 +12602,7 @@ public class PApplet extends Applet
/**
+ * ???
* Returns an ARGB "color" type (a packed 32 bit int with the color.
* If the coordinate is outside the image, zero is returned
* (black, but completely transparent).
@@ -11947,20 +12626,17 @@ public class PApplet extends Applet
/**
- * Reads the color of any pixel or grabs a group of pixels. If no parameters are specified, the entire image is returned. Get the value of one pixel by specifying an x,y coordinate. Get a section of the display window by specifing an additional width and height parameter. If the pixel requested is outside of the image window, black is returned. The numbers returned are scaled according to the current color ranges, but only RGB values are returned by this function. Even though you may have drawn a shape with colorMode(HSB), the numbers returned will be in RGB.
- *
Getting the color of a single pixel with get(x, y) is easy, but not as fast as grabbing the data directly from pixels[]. The equivalent statement to "get(x, y)" using pixels[] is "pixels[y*width+x]". Processing requires calling loadPixels() to load the display window data into the pixels[] array before getting the values.
- *
As of release 0149, this function ignores imageMode().
- *
- * @webref
+ * @generate PImage_get.xml
+ * @webref pimaget:method
* @brief Reads the color of any pixel or grabs a rectangle of pixels
+ * @usage web_application
* @param x x-coordinate of the pixel
* @param y y-coordinate of the pixel
* @param w width of pixel rectangle to get
* @param h height of pixel rectangle to get
- *
- * @see processing.core.PImage#set(int, int, int)
- * @see processing.core.PImage#pixels
- * @see processing.core.PImage#copy(PImage, int, int, int, int, int, int, int, int)
+ * @see PImage#set(int, int, int)
+ * @see PImage#pixels
+ * @see PImage#copy(PImage, int, int, int, int, int, int, int, int)
*/
public PImage get(int x, int y, int w, int h) {
return g.get(x, y, w, h);
@@ -11976,17 +12652,19 @@ public class PApplet extends Applet
/**
- * Changes the color of any pixel or writes an image directly into the display window. The x and y parameters specify the pixel to change and the color parameter specifies the color value. The color parameter is affected by the current color mode (the default is RGB values from 0 to 255). When setting an image, the x and y parameters define the coordinates for the upper-left corner of the image.
- *
Setting the color of a single pixel with set(x, y) is easy, but not as fast as putting the data directly into pixels[]. The equivalent statement to "set(x, y, #000000)" using pixels[] is "pixels[y*width+x] = #000000". You must call loadPixels() to load the display window data into the pixels[] array before setting the values and calling updatePixels() to update the window with any changes.
- *
As of release 1.0, this function ignores imageMode().
- *
Due to what appears to be a bug in Apple's Java implementation, the point() and set() methods are extremely slow in some circumstances when used with the default renderer. Using P2D or P3D will fix the problem. Grouping many calls to point() or set() together can also help. (Bug 1094)
+ * @generate PImage_set.xml
* Advanced
*
As of release 0149, this function ignores imageMode().
- *
- * @webref image:pixels
+ *
+ * @webref pimage:method
+ * @brief writes a color to any pixel or writes an image into another
+ * @usage web_application
* @param x x-coordinate of the pixel
* @param y y-coordinate of the pixel
* @param c any value of the color datatype
+ * @see PImage#get(int, int, int, int)
+ * @see PImage#pixels
+ * @see PImage#copy(PImage, int, int, int, int, int, int, int, int)
*/
public void set(int x, int y, int c) {
if (recorder != null) recorder.set(x, y, c);
@@ -11995,9 +12673,12 @@ public class PApplet extends Applet
/**
+ * Advanced
* Efficient method of drawing an image's pixels directly to this surface.
* No variations are employed, meaning that any scale, tint, or imageMode
* settings will be ignored.
+ *
+ * @param src ???
*/
public void set(int x, int y, PImage src) {
if (recorder != null) recorder.set(x, y, src);
@@ -12006,6 +12687,7 @@ public class PApplet extends Applet
/**
+ * ???
* Set alpha channel for an image. Black colors in the source
* image will make the destination image completely transparent,
* and white will make things fully opaque. Gray values will
@@ -12018,7 +12700,10 @@ public class PApplet extends Applet
* which will make the image into a "correct" grayscale by
* performing a proper luminance-based conversion.
*
- * @param maskArray any array of Integer numbers used as the alpha channel, needs to be same length as the image's pixel array
+ * @generate PImage_mask.xml
+ * @webref pimage:pixels
+ * @usage web_application
+ * @param maskArray[] any arry of Integer numbers used as the alpha channel, needs to be the same length as the image's pixel array
*/
public void mask(int maskArray[]) {
if (recorder != null) recorder.mask(maskArray);
@@ -12027,15 +12712,7 @@ public class PApplet extends Applet
/**
- * Masks part of an image from displaying by loading another image and using it as an alpha channel.
- * This mask image should only contain grayscale data, but only the blue color channel is used.
- * The mask image needs to be the same size as the image to which it is applied.
- * In addition to using a mask image, an integer array containing the alpha channel data can be specified directly.
- * This method is useful for creating dynamically generated alpha masks.
- * This array must be of the same length as the target image's pixels array and should contain only grayscale data of values between 0-255.
- * @webref
- * @brief Masks part of the image from displaying
- * @param maskImg any PImage object used as the alpha channel for "img", needs to be same size as "img"
+ * @param maskImg any PImage object used as the alpha chanell for "img", needs to be same size as "img"
*/
public void mask(PImage maskImg) {
if (recorder != null) recorder.mask(maskImg);
@@ -12050,7 +12727,7 @@ public class PApplet extends Applet
/**
- * Filters an image as defined by one of the following modes:
THRESHOLD - converts the image to black and white pixels depending if they are above or below the threshold defined by the level parameter. The level must be between 0.0 (black) and 1.0(white). If no level is specified, 0.5 is used.
GRAY - converts any colors in the image to grayscale equivalents
INVERT - sets each pixel to its inverse value
POSTERIZE - limits each channel of the image to the number of colors specified as the level parameter
BLUR - executes a Guassian blur with the level parameter specifying the extent of the blurring. If no level parameter is used, the blur is equivalent to Guassian blur of radius 1.
OPAQUE - sets the alpha channel to entirely opaque.
ERODE - reduces the light areas with the amount defined by the level parameter.
DILATE - increases the light areas with the amount defined by the level parameter
+ * @generate PImage_filter.xml
* Advanced
* Method to apply a variety of basic filters to this image.
*
As of release 0149, this function ignores imageMode().
- *
- * @webref
+ * @generate PImage_copy.xml
+ * @webref pimage:method
* @brief Copies the entire image
+ * @usage web_application
* @param sx X coordinate of the source's upper left corner
* @param sy Y coordinate of the source's upper left corner
* @param sw source image width
@@ -12105,11 +12771,19 @@ public class PApplet extends Applet
* @param dy Y coordinate of the destination's upper left corner
* @param dw destination image width
* @param dh destination image height
- * @param src an image variable referring to the source image.
- *
- * @see processing.core.PGraphics#alpha(int)
- * @see processing.core.PImage#blend(PImage, int, int, int, int, int, int, int, int, int)
+ * @see PGraphics#alpha(int)
+ * @see PImage#blend(PImage, int, int, int, int, int, int, int, int, int)
*/
+ public void copy(int sx, int sy, int sw, int sh,
+ int dx, int dy, int dw, int dh) {
+ if (recorder != null) recorder.copy(sx, sy, sw, sh, dx, dy, dw, dh);
+ g.copy(sx, sy, sw, sh, dx, dy, dw, dh);
+ }
+
+
+/**
+ * @param src an image variable referring to the source image.
+ */
public void copy(PImage src,
int sx, int sy, int sw, int sh,
int dx, int dy, int dw, int dh) {
@@ -12119,7 +12793,8 @@ public class PApplet extends Applet
/**
- * Blend two colors based on a particular mode.
+ * @generate blendColor.xml
+ * Advanced
*
*