diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java
index 2a722fcd0..98cbf7e51 100644
--- a/core/src/processing/core/PApplet.java
+++ b/core/src/processing/core/PApplet.java
@@ -11905,33 +11905,33 @@ public class PApplet implements PConstants {
}
- /**
- *
- * 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 with the z parameter requires the P3D
- * parameter in combination with size() as shown in the above example.
- *
- *
- * Use stroke() to set the color of a point().
- *
- * Point appears round with the default strokeCap(ROUND) and square with
- * strokeCap(PROJECT). Points are invisible with strokeCap(SQUARE)
- * (no cap).
- *
- * Using point() with strokeWeight(1) or smaller may draw nothing to the screen,
- * depending on the graphics settings of the computer. Workarounds include
- * setting the pixel using set() or drawing the point using either
- * circle() or square().
- *
- *
- * @webref shape:2d_primitives
- * @webBrief Draws a point, a coordinate in space at the dimension of one pixel.
- * @param x x-coordinate of the point
- * @param y y-coordinate of the point
- * @see PGraphics#stroke(int)
- */
+ /**
+ *
+ * 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 with the z parameter requires the P3D
+ * parameter in combination with size() as shown in the above example.
+ *
+ *
+ * Use stroke() to set the color of a point().
+ *
+ * Point appears round with the default strokeCap(ROUND) and square with
+ * strokeCap(PROJECT). Points are invisible with strokeCap(SQUARE)
+ * (no cap).
+ *
+ * Using point() with strokeWeight(1) or smaller may draw nothing to the screen,
+ * depending on the graphics settings of the computer. Workarounds include
+ * setting the pixel using set() or drawing the point using either
+ * circle() or square().
+ *
+ *
+ * @webref shape:2d_primitives
+ * @webBrief Draws a point, a coordinate in space at the dimension of one pixel.
+ * @param x x-coordinate of the point
+ * @param y y-coordinate of the point
+ * @see PGraphics#stroke(int)
+ */
public void point(float x, float y) {
if (recorder != null) recorder.point(x, y);
g.point(x, y);
@@ -12036,67 +12036,67 @@ public class PApplet implements PConstants {
}
- /**
- *
- * Modifies the location from which rectangles are drawn by changing the way in
- * which parameters given to rect() are intepreted.
- *
- * The default mode is rectMode(CORNER), which interprets the first two
- * parameters of rect() as the upper-left corner of the shape, while the
- * third and fourth parameters are its width and height.
- *
- * rectMode(CORNERS) interprets the first two parameters of rect()
- * as the location of one corner, and the third and fourth parameters as the
- * location of the opposite corner.
- *
- * rectMode(CENTER) interprets the first two parameters of rect()
- * as the shape's center point, while the third and fourth parameters are its
- * width and height.
- *
- * rectMode(RADIUS) also uses the first two parameters of rect()
- * as the shape's center point, but uses the third and fourth parameters to
- * specify half of the shapes's width and height.
- *
- * The parameter must be written in ALL CAPS because Processing is a
- * case-sensitive language.
- *
- * @webref shape:attributes
- * @webBrief Modifies the location from which rectangles draw.
- * @param mode either CORNER, CORNERS, CENTER, or RADIUS
- * @see PGraphics#rect(float, float, float, float)
- */
+ /**
+ *
+ * Modifies the location from which rectangles are drawn by changing the way in
+ * which parameters given to rect() are intepreted.
+ *
+ * The default mode is rectMode(CORNER), which interprets the first two
+ * parameters of rect() as the upper-left corner of the shape, while the
+ * third and fourth parameters are its width and height.
+ *
+ * rectMode(CORNERS) interprets the first two parameters of rect()
+ * as the location of one corner, and the third and fourth parameters as the
+ * location of the opposite corner.
+ *
+ * rectMode(CENTER) interprets the first two parameters of rect()
+ * as the shape's center point, while the third and fourth parameters are its
+ * width and height.
+ *
+ * rectMode(RADIUS) also uses the first two parameters of rect()
+ * as the shape's center point, but uses the third and fourth parameters to
+ * specify half of the shapes's width and height.
+ *
+ * The parameter must be written in ALL CAPS because Processing is a
+ * case-sensitive language.
+ *
+ * @webref shape:attributes
+ * @webBrief Modifies the location from which rectangles draw.
+ * @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);
}
- /**
- *
- * 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. The way these parameters are interpreted, however, may be
- * changed with the rectMode() function.
- *
- * To draw a rounded rectangle, add a fifth parameter, which is used as the
- * radius value for all four corners.
- *
- * To use a different radius value for each corner, include eight parameters.
- * When using eight parameters, the latter four set the radius of the arc at
- * each corner separately, starting with the top-left corner and moving
- * clockwise around the rectangle.
- *
- *
- * @webref shape:2d_primitives
- * @webBrief Draws a rectangle to the screen.
- * @param a x-coordinate of the rectangle by default
- * @param b y-coordinate of the rectangle by default
- * @param c width of the rectangle by default
- * @param d height of the rectangle by default
- * @see PGraphics#rectMode(int)
- * @see PGraphics#quad(float, float, float, float, float, float, float, float)
- */
+ /**
+ *
+ * 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. The way these parameters are interpreted, however, may be
+ * changed with the rectMode() function.
+ *
+ * To draw a rounded rectangle, add a fifth parameter, which is used as the
+ * radius value for all four corners.
+ *
+ * To use a different radius value for each corner, include eight parameters.
+ * When using eight parameters, the latter four set the radius of the arc at
+ * each corner separately, starting with the top-left corner and moving
+ * clockwise around the rectangle.
+ *
+ *
+ * @webref shape:2d_primitives
+ * @webBrief Draws a rectangle to the screen.
+ * @param a x-coordinate of the rectangle by default
+ * @param b y-coordinate of the rectangle by default
+ * @param c width of the rectangle by default
+ * @param d height of the rectangle by default
+ * @see PGraphics#rectMode(int)
+ * @see PGraphics#quad(float, float, float, float, float, float, float, float)
+ */
public void rect(float a, float b, float c, float d) {
if (recorder != null) recorder.rect(a, b, c, d);
g.rect(a, b, c, d);
@@ -12149,98 +12149,98 @@ public class PApplet implements PConstants {
}
- /**
- *
- * Modifies the location from which ellipses are drawn by changing the way in
- * which parameters given to ellipse() are intepreted.
- *
- * The default mode is ellipseMode(CENTER), which interprets the first
- * two parameters of ellipse() as the shape's center point, while the
- * third and fourth parameters are its width and height.
- *
- * ellipseMode(RADIUS) also uses the first two parameters of
- * ellipse() as the shape's center point, but uses the third and fourth
- * parameters to specify half of the shapes's width and height.
- *
- * ellipseMode(CORNER) interprets the first two parameters of
- * ellipse() as the upper-left corner of the shape, while the third and
- * fourth parameters are its width and height.
- *
- * ellipseMode(CORNERS) interprets the first two parameters of
- * ellipse() as the location of one corner of the ellipse's bounding box,
- * and the third and fourth parameters as the location of the opposite
- * corner.
- *
- * The parameter must be written in ALL CAPS because Processing is a
- * case-sensitive language.
- *
- * @webref shape:attributes
- * @webBrief The origin of the ellipse is modified by the ellipseMode()
- * function.
- * @param mode either CENTER, RADIUS, CORNER, or CORNERS
- * @see PApplet#ellipse(float, float, float, float)
- * @see PApplet#arc(float, float, float, float, float, float)
- */
+ /**
+ *
+ * Modifies the location from which ellipses are drawn by changing the way in
+ * which parameters given to ellipse() are intepreted.
+ *
+ * The default mode is ellipseMode(CENTER), which interprets the first
+ * two parameters of ellipse() as the shape's center point, while the
+ * third and fourth parameters are its width and height.
+ *
+ * ellipseMode(RADIUS) also uses the first two parameters of
+ * ellipse() as the shape's center point, but uses the third and fourth
+ * parameters to specify half of the shapes's width and height.
+ *
+ * ellipseMode(CORNER) interprets the first two parameters of
+ * ellipse() as the upper-left corner of the shape, while the third and
+ * fourth parameters are its width and height.
+ *
+ * ellipseMode(CORNERS) interprets the first two parameters of
+ * ellipse() as the location of one corner of the ellipse's bounding box,
+ * and the third and fourth parameters as the location of the opposite
+ * corner.
+ *
+ * The parameter must be written in ALL CAPS because Processing is a
+ * case-sensitive language.
+ *
+ * @webref shape:attributes
+ * @webBrief The origin of the ellipse is modified by the ellipseMode()
+ * function.
+ * @param mode either CENTER, RADIUS, CORNER, or CORNERS
+ * @see PApplet#ellipse(float, float, float, float)
+ * @see PApplet#arc(float, float, float, float, float, float)
+ */
public void ellipseMode(int mode) {
if (recorder != null) recorder.ellipseMode(mode);
g.ellipseMode(mode);
}
- /**
- *
- * Draws an ellipse (oval) to the screen. An ellipse with equal width and height
- * is a circle. By default, the first two parameters set the location, and the
- * third and fourth parameters set the shape's width and height. The origin may
- * be changed with the ellipseMode() function.
- *
- * @webref shape:2d_primitives
- * @webBrief Draws an ellipse (oval) in the display window.
- * @param a x-coordinate of the ellipse
- * @param b y-coordinate of the ellipse
- * @param c width of the ellipse by default
- * @param d height of the ellipse by default
- * @see PApplet#ellipseMode(int)
- * @see PApplet#arc(float, float, float, float, float, float)
- */
+ /**
+ *
+ * Draws an ellipse (oval) to the screen. An ellipse with equal width and height
+ * is a circle. By default, the first two parameters set the location, and the
+ * third and fourth parameters set the shape's width and height. The origin may
+ * be changed with the ellipseMode() function.
+ *
+ * @webref shape:2d_primitives
+ * @webBrief Draws an ellipse (oval) in the display window.
+ * @param a x-coordinate of the ellipse
+ * @param b y-coordinate of the ellipse
+ * @param c width of the ellipse by default
+ * @param d height of the ellipse by default
+ * @see PApplet#ellipseMode(int)
+ * @see PApplet#arc(float, float, float, float, float, float)
+ */
public void ellipse(float a, float b, float c, float d) {
if (recorder != null) recorder.ellipse(a, b, c, d);
g.ellipse(a, b, c, d);
}
- /**
- *
- * Draws an arc to the screen. Arcs are drawn along the outer edge of an ellipse
- * defined by the a, b, c, and d parameters. The
- * origin of the arc's ellipse may be changed with the ellipseMode()
- * function. Use the start and stop parameters to specify the
- * angles (in radians) at which to draw the arc. The start/stop values must be
- * in clockwise order.
- *
- * There are three ways to draw an arc; the rendering technique used is defined
- * by the optional seventh parameter. The three options, depicted in the above
- * examples, are PIE, OPEN, and CHORD. The default mode is the OPEN stroke with
- * a PIE fill.
- *
- * In some cases, the arc() function isn't accurate enough for smooth
- * drawing. For example, the shape may jitter on screen when rotating slowly. If
- * you're having an issue with how arcs are rendered, you'll need to draw the
- * arc yourself with beginShape()/endShape() or a PShape.
- *
- * @webref shape:2d_primitives
- * @webBrief Draws an arc in the display window.
- * @param a x-coordinate of the arc's ellipse
- * @param b y-coordinate of the arc's ellipse
- * @param c width of the arc's ellipse by default
- * @param d height of the arc's ellipse by default
- * @param start angle to start the arc, specified in radians
- * @param stop angle to stop the arc, specified in radians
- * @see PApplet#ellipse(float, float, float, float)
- * @see PApplet#ellipseMode(int)
- * @see PApplet#radians(float)
- * @see PApplet#degrees(float)
- */
+ /**
+ *
+ * Draws an arc to the screen. Arcs are drawn along the outer edge of an ellipse
+ * defined by the a, b, c, and d parameters. The
+ * origin of the arc's ellipse may be changed with the ellipseMode()
+ * function. Use the start and stop parameters to specify the
+ * angles (in radians) at which to draw the arc. The start/stop values must be
+ * in clockwise order.
+ *
+ * There are three ways to draw an arc; the rendering technique used is defined
+ * by the optional seventh parameter. The three options, depicted in the above
+ * examples, are PIE, OPEN, and CHORD. The default mode is the OPEN stroke with
+ * a PIE fill.
+ *
+ * In some cases, the arc() function isn't accurate enough for smooth
+ * drawing. For example, the shape may jitter on screen when rotating slowly. If
+ * you're having an issue with how arcs are rendered, you'll need to draw the
+ * arc yourself with beginShape()/endShape() or a PShape.
+ *
+ * @webref shape:2d_primitives
+ * @webBrief Draws an arc in the display window.
+ * @param a x-coordinate of the arc's ellipse
+ * @param b y-coordinate of the arc's ellipse
+ * @param c width of the arc's ellipse by default
+ * @param d height of the arc's ellipse by default
+ * @param start angle to start the arc, specified in radians
+ * @param stop angle to stop the arc, specified in radians
+ * @see PApplet#ellipse(float, float, float, float)
+ * @see PApplet#ellipseMode(int)
+ * @see PApplet#radians(float)
+ * @see PApplet#degrees(float)
+ */
public void arc(float a, float b, float c, float d,
float start, float stop) {
if (recorder != null) recorder.arc(a, b, c, d, start, stop);
@@ -12458,21 +12458,21 @@ public class PApplet implements PConstants {
}
- /**
- *
- * Sets the resolution at which Beziers display. The default value is 20. This
- * function is only useful when using the P3D renderer; the default
- * P2D renderer does not use this information.
- *
- *
- * @webref shape:curves
- * @webBrief Sets the resolution at which Beziers display.
- * @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, float)
- * @see PGraphics#curveTightness(float)
- */
+ /**
+ *
+ * Sets the resolution at which Beziers display. The default value is 20. This
+ * function is only useful when using the P3D renderer; the default
+ * P2D renderer does not use this information.
+ *
+ *
+ * @webref shape:curves
+ * @webBrief Sets the resolution at which Beziers display.
+ * @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, float)
+ * @see PGraphics#curveTightness(float)
+ */
public void bezierDetail(int detail) {
if (recorder != null) recorder.bezierDetail(detail);
g.bezierDetail(detail);
@@ -12549,29 +12549,29 @@ public class PApplet implements PConstants {
}
- /**
- *
- * Evaluates the curve at point t for points a, b,
- * c, d. The parameter t may range from 0 (the start of the
- * curve) and 1 (the end of the curve). a and d are the control
- * points, and b and c are points on the curve. As seen in the
- * example above, this can be used once with the x coordinates and a
- * second time with the y coordinates to get the location of a curve at
- * t.
- *
- *
- * @webref shape:curves
- * @webBrief Evalutes the curve at point t for points a, b, c, d.
- * @param a coordinate of first control point
- * @param b coordinate of first point on the curve
- * @param c coordinate of second point on the curve
- * @param d coordinate of second control point
- * @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)
- */
+ /**
+ *
+ * Evaluates the curve at point t for points a, b,
+ * c, d. The parameter t may range from 0 (the start of the
+ * curve) and 1 (the end of the curve). a and d are the control
+ * points, and b and c are points on the curve. As seen in the
+ * example above, this can be used once with the x coordinates and a
+ * second time with the y coordinates to get the location of a curve at
+ * t.
+ *
+ *
+ * @webref shape:curves
+ * @webBrief Evalutes the curve at point t for points a, b, c, d.
+ * @param a coordinate of first control point
+ * @param b coordinate of first point on the curve
+ * @param c coordinate of second point on the curve
+ * @param d coordinate of second control point
+ * @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)
+ */
public float curvePoint(float a, float b, float c, float d, float t) {
return g.curvePoint(a, b, c, d, t);
}
@@ -12624,25 +12624,25 @@ public class PApplet implements PConstants {
}
- /**
- *
- * Modifies the quality of forms created with curve() and
- * curveVertex(). The parameter tightness determines how the curve
- * fits to the vertex points. The value 0.0 is the default value for
- * tightness (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.
- *
- * @webref shape:curves
- * @webBrief Modifies the quality of forms created with curve() and
- * curveVertex().
- * @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)
- */
+ /**
+ *
+ * Modifies the quality of forms created with curve() and
+ * curveVertex(). The parameter tightness determines how the curve
+ * fits to the vertex points. The value 0.0 is the default value for
+ * tightness (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.
+ *
+ * @webref shape:curves
+ * @webBrief Modifies the quality of forms created with curve() and
+ * curveVertex().
+ * @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);
g.curveTightness(tightness);
@@ -12714,74 +12714,74 @@ public class PApplet implements PConstants {
}
- /**
- *
- * Modifies the location from which images are drawn by changing the way in
- * which parameters given to image() are intepreted.
- *
- * The default mode is imageMode(CORNER), which interprets the second and
- * third parameters of image() as the upper-left corner of the image. If
- * two additional parameters are specified, they are used to set the image's
- * width and height.
- *
- * imageMode(CORNERS) interprets the second and third parameters of
- * image() as the location of one corner, and the fourth and fifth
- * parameters as the opposite corner.
- *
- * imageMode(CENTER) interprets the second and third parameters of
- * image() as the image's center point. If two additional parameters are
- * specified, they are used to set the image's width and height.
- *
- * The parameter must be written in ALL CAPS because Processing is a
- * case-sensitive language.
- *
- *
- * @webref image:loading_displaying
- * @webBrief Modifies the location from which images draw.
- * @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)
- */
+ /**
+ *
+ * Modifies the location from which images are drawn by changing the way in
+ * which parameters given to image() are intepreted.
+ *
+ * The default mode is imageMode(CORNER), which interprets the second and
+ * third parameters of image() as the upper-left corner of the image. If
+ * two additional parameters are specified, they are used to set the image's
+ * width and height.
+ *
+ * imageMode(CORNERS) interprets the second and third parameters of
+ * image() as the location of one corner, and the fourth and fifth
+ * parameters as the opposite corner.
+ *
+ * imageMode(CENTER) interprets the second and third parameters of
+ * image() as the image's center point. If two additional parameters are
+ * specified, they are used to set the image's width and height.
+ *
+ * The parameter must be written in ALL CAPS because Processing is a
+ * case-sensitive language.
+ *
+ *
+ * @webref image:loading_displaying
+ * @webBrief Modifies the location from which images draw.
+ * @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);
g.imageMode(mode);
}
- /**
- *
- * The image() function draws an image to the display window. Images must
- * be in the sketch's "data" directory to load correctly. Select "Add file..."
- * from the "Sketch" menu to add the image to the data directory, or just drag
- * the image file onto the sketch window. Processing currently works with GIF,
- * JPEG, and PNG images.
- *
- * The img parameter specifies the image to display and by default the
- * a and b parameters define the location of its upper-left
- * corner. The image is displayed at its original size unless the c and
- * d parameters specify a different size. The imageMode() function
- * can be used to change the way these parameters draw the image.
- *
- * The color of an image may be modified with the tint() function. This
- * function will maintain transparency for GIF and PNG images.
- *
- *
Advanced
Starting with release 0124, when using the default (JAVA2D)
- * renderer, smooth() will also improve image quality of resized images.
- *
- * @webref image:loading_displaying
- * @webBrief Displays images to the screen.
- * @param img the image to display
- * @param a x-coordinate of the image by default
- * @param b y-coordinate of the image by default
- * @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)
- */
+ /**
+ *
+ * The image() function draws an image to the display window. Images must
+ * be in the sketch's "data" directory to load correctly. Select "Add file..."
+ * from the "Sketch" menu to add the image to the data directory, or just drag
+ * the image file onto the sketch window. Processing currently works with GIF,
+ * JPEG, and PNG images.
+ *
+ * The img parameter specifies the image to display and by default the
+ * a and b parameters define the location of its upper-left
+ * corner. The image is displayed at its original size unless the c and
+ * d parameters specify a different size. The imageMode() function
+ * can be used to change the way these parameters draw the image.
+ *
+ * The color of an image may be modified with the tint() function. This
+ * function will maintain transparency for GIF and PNG images.
+ *
+ *
Advanced
Starting with release 0124, when using the default (JAVA2D)
+ * renderer, smooth() will also improve image quality of resized images.
+ *
+ * @webref image:loading_displaying
+ * @webBrief Displays images to the screen.
+ * @param img the image to display
+ * @param a x-coordinate of the image by default
+ * @param b y-coordinate of the image by default
+ * @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 img, float a, float b) {
if (recorder != null) recorder.image(img, a, b);
g.image(img, a, b);
@@ -12847,29 +12847,29 @@ public class PApplet implements PConstants {
}
- /**
- *
- * Draws shapes to the display window. 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, OBJ, and custom-created
- * shapes. The shape parameter specifies the shape to display and the
- * coordinate parameters define the location of the shape from its upper-left
- * corner. The shape is displayed at its original size unless the c and
- * d parameters specify a different size. The shapeMode() function
- * can be used to change the way these parameters are interpreted.
- *
- *
- * @webref shape:loading_displaying
- * @webBrief Displays shapes to the screen.
- * @param shape the shape to display
- * @param x x-coordinate of the shape
- * @param y y-coordinate of the shape
- * @see PShape
- * @see PApplet#loadShape(String)
- * @see PGraphics#shapeMode(int)
- *
- * Convenience method to draw at a particular location.
- */
+ /**
+ *
+ * Draws shapes to the display window. 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, OBJ, and custom-created
+ * shapes. The shape parameter specifies the shape to display and the
+ * coordinate parameters define the location of the shape from its upper-left
+ * corner. The shape is displayed at its original size unless the c and
+ * d parameters specify a different size. The shapeMode() function
+ * can be used to change the way these parameters are interpreted.
+ *
+ *
+ * @webref shape:loading_displaying
+ * @webBrief Displays shapes to the screen.
+ * @param shape the shape to display
+ * @param x x-coordinate of the shape
+ * @param y y-coordinate of the shape
+ * @see PShape
+ * @see PApplet#loadShape(String)
+ * @see PGraphics#shapeMode(int)
+ *
+ * Convenience method to draw at a particular location.
+ */
public void shape(PShape shape, float x, float y) {
if (recorder != null) recorder.shape(shape, x, y);
g.shape(shape, x, y);
@@ -12894,109 +12894,109 @@ public class PApplet implements PConstants {
}
- /**
- *
- * 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.
- *
- * 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.
- *
- *
- *
- * @webref typography:attributes
- * @webBrief Sets the current alignment for drawing text.
- * @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)
- * @see PGraphics#textSize(float)
- * @see PGraphics#textAscent()
- * @see PGraphics#textDescent()
- */
+ /**
+ *
+ * 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.
+ *
+ * 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.
+ *
+ *
+ *
+ * @webref typography:attributes
+ * @webBrief Sets the current alignment for drawing text.
+ * @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)
+ * @see PGraphics#textSize(float)
+ * @see PGraphics#textAscent()
+ * @see PGraphics#textDescent()
+ */
public void textAlign(int alignX, int alignY) {
if (recorder != null) recorder.textAlign(alignX, alignY);
g.textAlign(alignX, alignY);
}
- /**
- *
- * Returns ascent of the current font at its current size. This information is
- * useful for determining the height of the font above the baseline.
- *
- *
- * @webref typography:metrics
- * @webBrief Returns ascent of the current font at its current size.
- * @see PGraphics#textDescent()
- */
+ /**
+ *
+ * Returns ascent of the current font at its current size. This information is
+ * useful for determining the height of the font above the baseline.
+ *
+ *
+ * @webref typography:metrics
+ * @webBrief Returns ascent of the current font at its current size.
+ * @see PGraphics#textDescent()
+ */
public float textAscent() {
return g.textAscent();
}
- /**
- *
- * Returns descent of the current font at its current size. This information is
- * useful for determining the height of the font below the baseline.
- *
- * @webref typography:metrics
- * @webBrief Returns descent of the current font at its current size.
- * @see PGraphics#textAscent()
- */
+ /**
+ *
+ * Returns descent of the current font at its current size. This information is
+ * useful for determining the height of the font below the baseline.
+ *
+ * @webref typography:metrics
+ * @webBrief Returns descent of the current font at its current size.
+ * @see PGraphics#textAscent()
+ */
public float textDescent() {
return g.textDescent();
}
- /**
- *
- * Sets the current font that will be drawn with the text() function.
- * Fonts must be created for Processing with createFont() or loaded with
- * loadFont() before they can be used. The font set through
- * textFont() will be used in all subsequent calls to the text()
- * function. If no size parameter is specified, the font size defaults to
- * the original size (the size in which it was created with the "Create Font..."
- * tool) overriding any previous calls to textFont() or
- * textSize().
- *
- * When fonts are rendered as an image texture (as is the case with the P2D and
- * P3D renderers as well as with loadFont() and vlw files), you should
- * create fonts at the sizes that will be used most commonly. Using
- * textFont() without the size parameter will result in the cleanest
- * type.
- *
- *
- *
- * @webref typography:loading_displaying
- * @webBrief Sets the current font that will be drawn with the text()
- * function.
- * @param which any variable of the type PFont
- * @see PApplet#createFont(String, float, boolean)
- * @see PApplet#loadFont(String)
- * @see PFont
- * @see PGraphics#text(String, float, float)
- * @see PGraphics#textSize(float)
- */
+ /**
+ *
+ * Sets the current font that will be drawn with the text() function.
+ * Fonts must be created for Processing with createFont() or loaded with
+ * loadFont() before they can be used. The font set through
+ * textFont() will be used in all subsequent calls to the text()
+ * function. If no size parameter is specified, the font size defaults to
+ * the original size (the size in which it was created with the "Create Font..."
+ * tool) overriding any previous calls to textFont() or
+ * textSize().
+ *
+ * When fonts are rendered as an image texture (as is the case with the P2D and
+ * P3D renderers as well as with loadFont() and vlw files), you should
+ * create fonts at the sizes that will be used most commonly. Using
+ * textFont() without the size parameter will result in the cleanest
+ * type.
+ *
+ *
+ *
+ * @webref typography:loading_displaying
+ * @webBrief Sets the current font that will be drawn with the text()
+ * function.
+ * @param which any variable of the type PFont
+ * @see PApplet#createFont(String, float, boolean)
+ * @see PApplet#loadFont(String)
+ * @see PFont
+ * @see PGraphics#text(String, float, float)
+ * @see PGraphics#textSize(float)
+ */
public void textFont(PFont which) {
if (recorder != null) recorder.textFont(which);
g.textFont(which);
@@ -13012,59 +13012,59 @@ public class PApplet implements PConstants {
}
- /**
- *
- * Sets the spacing between lines of text in units of pixels. This setting will
- * be used in all subsequent calls to the text() function. Note, however,
- * that the leading is reset by textSize(). For example, if the leading
- * is set to 20 with textLeading(20), then if textSize(48) is run
- * at a later point, the leading will be reset to the default for the text size
- * of 48.
- *
- *
- * @webref typography:attributes
- * @webBrief Sets the spacing between lines of text in units of pixels.
- * @param leading the size in pixels for spacing between lines
- * @see PApplet#loadFont(String)
- * @see PFont#PFont
- * @see PGraphics#text(String, float, float)
- * @see PGraphics#textFont(PFont)
- * @see PGraphics#textSize(float)
- */
+ /**
+ *
+ * Sets the spacing between lines of text in units of pixels. This setting will
+ * be used in all subsequent calls to the text() function. Note, however,
+ * that the leading is reset by textSize(). For example, if the leading
+ * is set to 20 with textLeading(20), then if textSize(48) is run
+ * at a later point, the leading will be reset to the default for the text size
+ * of 48.
+ *
+ *
+ * @webref typography:attributes
+ * @webBrief Sets the spacing between lines of text in units of pixels.
+ * @param leading the size in pixels for spacing between lines
+ * @see PApplet#loadFont(String)
+ * @see PFont#PFont
+ * @see PGraphics#text(String, float, float)
+ * @see PGraphics#textFont(PFont)
+ * @see PGraphics#textSize(float)
+ */
public void textLeading(float leading) {
if (recorder != null) recorder.textLeading(leading);
g.textLeading(leading);
}
- /**
- *
- * Sets the way text draws to the screen, either as texture maps or as vector
- * geometry. The default textMode(MODEL), uses textures to render the
- * fonts. The textMode(SHAPE) mode draws text using the glyph outlines of
- * individual characters rather than as textures. This mode is only supported
- * with the PDF and P3D 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 P3D can be combined with
- * beginRaw() to write vector-accurate text to 2D and 3D output files,
- * for instance DXF or PDF. The SHAPE mode is not currently
- * optimized for P3D, so if recording shape data, use
- * textMode(MODEL) until you're ready to capture the geometry with
- * beginRaw().
- *
- * @webref typography:attributes
- * @webBrief Sets the way text draws to the screen.
- * @param mode either MODEL or SHAPE
- * @see PApplet#loadFont(String)
- * @see PFont#PFont
- * @see PGraphics#text(String, float, float)
- * @see PGraphics#textFont(PFont)
- * @see PGraphics#beginRaw(PGraphics)
- * @see PApplet#createFont(String, float, boolean)
- */
+ /**
+ *
+ * Sets the way text draws to the screen, either as texture maps or as vector
+ * geometry. The default textMode(MODEL), uses textures to render the
+ * fonts. The textMode(SHAPE) mode draws text using the glyph outlines of
+ * individual characters rather than as textures. This mode is only supported
+ * with the PDF and P3D 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 P3D can be combined with
+ * beginRaw() to write vector-accurate text to 2D and 3D output files,
+ * for instance DXF or PDF. The SHAPE mode is not currently
+ * optimized for P3D, so if recording shape data, use
+ * textMode(MODEL) until you're ready to capture the geometry with
+ * beginRaw().
+ *
+ * @webref typography:attributes
+ * @webBrief Sets the way text draws to the screen.
+ * @param mode either MODEL or SHAPE
+ * @see PApplet#loadFont(String)
+ * @see PFont#PFont
+ * @see PGraphics#text(String, float, float)
+ * @see PGraphics#textFont(PFont)
+ * @see PGraphics#beginRaw(PGraphics)
+ * @see PApplet#createFont(String, float, boolean)
+ */
public void textMode(int mode) {
if (recorder != null) recorder.textMode(mode);
g.textMode(mode);
@@ -13126,45 +13126,45 @@ public class PApplet implements PConstants {
}
- /**
- *
- * Draws text to the screen. Displays the information specified in the first
- * parameter on the screen in the position specified by the additional
- * parameters. A default font will be used unless a font is set with the
- * textFont() function and a default size will be used unless a font is
- * set with textSize(). 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 x2 and y2 parameters define a rectangular area to display
- * within and may only be used with string data. When these parameters are
- * specified, they are interpreted based on the current rectMode()
- * setting. Text that does not fit completely within the rectangle specified
- * will not be drawn to the screen.
- *
- * Note that Processing now lets you call text() without first specifying
- * a PFont with textFont(). In that case, a generic sans-serif font will
- * be used instead. (See the third example above.)
- *
- *
- * @webref typography:loading_displaying
- * @webBrief Draws text to the screen.
- * @param c the alphanumeric character to be displayed
- * @param x x-coordinate of text
- * @param y y-coordinate of text
- * @see PGraphics#textAlign(int, int)
- * @see PGraphics#textFont(PFont)
- * @see PGraphics#textMode(int)
- * @see PGraphics#textSize(float)
- * @see PGraphics#textLeading(float)
- * @see PGraphics#textWidth(String)
- * @see PGraphics#textAscent()
- * @see PGraphics#textDescent()
- * @see PGraphics#rectMode(int)
- * @see PGraphics#fill(int, float)
- * @see_external String
- */
+ /**
+ *
+ * Draws text to the screen. Displays the information specified in the first
+ * parameter on the screen in the position specified by the additional
+ * parameters. A default font will be used unless a font is set with the
+ * textFont() function and a default size will be used unless a font is
+ * set with textSize(). 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 x2 and y2 parameters define a rectangular area to display
+ * within and may only be used with string data. When these parameters are
+ * specified, they are interpreted based on the current rectMode()
+ * setting. Text that does not fit completely within the rectangle specified
+ * will not be drawn to the screen.
+ *
+ * Note that Processing now lets you call text() without first specifying
+ * a PFont with textFont(). In that case, a generic sans-serif font will
+ * be used instead. (See the third example above.)
+ *
+ *
+ * @webref typography:loading_displaying
+ * @webBrief Draws text to the screen.
+ * @param c the alphanumeric character to be displayed
+ * @param x x-coordinate of text
+ * @param y y-coordinate of text
+ * @see PGraphics#textAlign(int, int)
+ * @see PGraphics#textFont(PFont)
+ * @see PGraphics#textMode(int)
+ * @see PGraphics#textSize(float)
+ * @see PGraphics#textLeading(float)
+ * @see PGraphics#textWidth(String)
+ * @see PGraphics#textAscent()
+ * @see PGraphics#textDescent()
+ * @see PGraphics#rectMode(int)
+ * @see PGraphics#fill(int, float)
+ * @see_external String
+ */
public void text(char c, float x, float y) {
if (recorder != null) recorder.text(c, x, y);
g.text(c, x, y);
@@ -13408,36 +13408,36 @@ public class PApplet implements PConstants {
}
- /**
- *
- * 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 P3D as a parameter in combination with size
- * as shown in the above example.
- *
- * Transformations are cumulative and 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 using pushMatrix() and
- * popMatrix().
- *
- *
- * @webref transform
- * @webBrief Specifies an amount to displace objects within the display window.
- * @param x left/right translation
- * @param y 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)
- */
+ /**
+ *
+ * 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 P3D as a parameter in combination with size
+ * as shown in the above example.
+ *
+ * Transformations are cumulative and 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 using pushMatrix() and
+ * popMatrix().
+ *
+ *
+ * @webref transform
+ * @webBrief Specifies an amount to displace objects within the display window.
+ * @param x left/right translation
+ * @param y 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 x, float y) {
if (recorder != null) recorder.translate(x, y);
g.translate(x, y);
@@ -13605,36 +13605,36 @@ public class PApplet implements PConstants {
}
- /**
- *
- * 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 function with the z parameter
- * requires using P3D as a parameter for size(), as shown in the third
- * example above. This function can be further controlled with
- * pushMatrix() and popMatrix().
- *
- *
- * @webref transform
- * @webBrief Increases or decreases the size of a shape by expanding and
- * contracting vertices.
- * @param s percentage to scale the object
- * @see PGraphics#pushMatrix()
- * @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)
- */
+ /**
+ *
+ * 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 function with the z parameter
+ * requires using P3D as a parameter for size(), as shown in the third
+ * example above. This function can be further controlled with
+ * pushMatrix() and popMatrix().
+ *
+ *
+ * @webref transform
+ * @webBrief Increases or decreases the size of a shape by expanding and
+ * contracting vertices.
+ * @param s percentage to scale the object
+ * @see PGraphics#pushMatrix()
+ * @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 scale(float s) {
if (recorder != null) recorder.scale(s);
g.scale(s);
@@ -13736,19 +13736,19 @@ public class PApplet implements PConstants {
}
- /**
- *
- * Replaces the current matrix with the identity matrix. The equivalent function
- * in OpenGL is glLoadIdentity().
- *
- *
- * @webref transform
- * @webBrief Replaces the current matrix with the identity matrix.
- * @see PGraphics#pushMatrix()
- * @see PGraphics#popMatrix()
- * @see PGraphics#applyMatrix(PMatrix)
- * @see PGraphics#printMatrix()
- */
+ /**
+ *
+ * Replaces the current matrix with the identity matrix. The equivalent function
+ * in OpenGL is glLoadIdentity().
+ *
+ *
+ * @webref transform
+ * @webBrief Replaces the current matrix with the identity matrix.
+ * @see PGraphics#pushMatrix()
+ * @see PGraphics#popMatrix()
+ * @see PGraphics#applyMatrix(PMatrix)
+ * @see PGraphics#printMatrix()
+ */
public void resetMatrix() {
if (recorder != null) recorder.resetMatrix();
g.resetMatrix();
@@ -14011,21 +14011,21 @@ public class PApplet implements PConstants {
}
- /**
- *
- * 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(-width/2, width/2, -height/2, height/2).
- *
- *
- * @webref lights_camera:camera
- * @webBrief Sets an orthographic projection and defines a parallel clipping
- * volume.
- */
+ /**
+ *
+ * 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(-width/2, width/2, -height/2, height/2).
+ *
+ *
+ * @webref lights_camera:camera
+ * @webBrief Sets an orthographic projection and defines a parallel clipping
+ * volume.
+ */
public void ortho() {
if (recorder != null) recorder.ortho();
g.ortho();
@@ -14093,44 +14093,44 @@ public class PApplet implements PConstants {
}
- /**
- *
- * Sets a perspective matrix as defined by the parameters.
- *
- * A frustum is a geometric form: a pyramid with its top cut off. With the
- * viewer's eye at the imaginary top of the pyramid, the six planes of the
- * frustum act as clipping planes when rendering a 3D view. Thus, any form
- * inside the clipping planes is rendered and visible; anything outside those
- * planes is not visible.
- *
- * Setting the frustum has the effect of changing the perspective with
- * which the scene is rendered. This can be achieved more simply in many cases
- * by using perspective().
- *
- * Note that the near value must be greater than zero (as the point of the
- * frustum "pyramid" cannot converge "behind" the viewer). Similarly, the far
- * value must be greater than the near value (as the "far" plane of the frustum
- * must be "farther away" from the viewer than the near plane).
- *
- * Works like glFrustum, except it wipes out the current perspective matrix
- * rather than multiplying itself with it.
- *
- *
- * @webref lights_camera:camera
- * @webBrief Sets a perspective matrix defined through the parameters.
- * @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; must be greater than zero
- * @param far far component of the clipping plane; must be greater than the
- * near value
- * @see PGraphics#camera(float, float, float, float, float, float, float, float,
- * float)
- * @see PGraphics#beginCamera()
- * @see PGraphics#endCamera()
- * @see PGraphics#perspective(float, float, float, float)
- */
+ /**
+ *
+ * Sets a perspective matrix as defined by the parameters.
+ *
+ * A frustum is a geometric form: a pyramid with its top cut off. With the
+ * viewer's eye at the imaginary top of the pyramid, the six planes of the
+ * frustum act as clipping planes when rendering a 3D view. Thus, any form
+ * inside the clipping planes is rendered and visible; anything outside those
+ * planes is not visible.
+ *
+ * Setting the frustum has the effect of changing the perspective with
+ * which the scene is rendered. This can be achieved more simply in many cases
+ * by using perspective().
+ *
+ * Note that the near value must be greater than zero (as the point of the
+ * frustum "pyramid" cannot converge "behind" the viewer). Similarly, the far
+ * value must be greater than the near value (as the "far" plane of the frustum
+ * must be "farther away" from the viewer than the near plane).
+ *
+ * Works like glFrustum, except it wipes out the current perspective matrix
+ * rather than multiplying itself with it.
+ *
+ *
+ * @webref lights_camera:camera
+ * @webBrief Sets a perspective matrix defined through the parameters.
+ * @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; must be greater than zero
+ * @param far far component of the clipping plane; must be greater than the
+ * near value
+ * @see PGraphics#camera(float, float, float, float, float, float, float, float,
+ * float)
+ * @see PGraphics#beginCamera()
+ * @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) {
@@ -14371,68 +14371,68 @@ public class PApplet implements PConstants {
}
- /**
- *
- * Sets the width of the stroke used for lines, points, and the border around
- * shapes. All widths are set in units of pixels.
- *
- * Using point() with strokeWeight(1) or smaller may draw nothing to the screen,
- * depending on the graphics settings of the computer. Workarounds include
- * setting the pixel using set() or drawing the point using either
- * circle() or square().
- *
- *
- * @webref shape:attributes
- * @webBrief Sets the width of the stroke used for lines, points, and the border
- * around shapes.
- * @param weight the weight (in pixels) of the stroke
- * @see PGraphics#stroke(int, float)
- * @see PGraphics#strokeJoin(int)
- * @see PGraphics#strokeCap(int)
- */
+ /**
+ *
+ * Sets the width of the stroke used for lines, points, and the border around
+ * shapes. All widths are set in units of pixels.
+ *
+ * Using point() with strokeWeight(1) or smaller may draw nothing to the screen,
+ * depending on the graphics settings of the computer. Workarounds include
+ * setting the pixel using set() or drawing the point using either
+ * circle() or square().
+ *
+ *
+ * @webref shape:attributes
+ * @webBrief Sets the width of the stroke used for lines, points, and the border
+ * around shapes.
+ * @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);
}
- /**
- *
- * 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.
- *
- *
- * @webref shape:attributes
- * @webBrief Sets the style of the joints which connect line segments.
- * @param join either MITER, BEVEL, ROUND
- * @see PGraphics#stroke(int, float)
- * @see PGraphics#strokeWeight(float)
- * @see PGraphics#strokeCap(int)
- */
+ /**
+ *
+ * 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.
+ *
+ *
+ * @webref shape:attributes
+ * @webBrief Sets the style of the joints which connect line segments.
+ * @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);
}
- /**
- *
- * Sets the style for rendering line endings. These ends are either squared,
- * extended, or rounded, each of which specified with the corresponding
- * parameters: SQUARE, PROJECT, and ROUND. The default cap is ROUND.
- *
- * To make point() appear square, use strokeCap(PROJECT). Using
- * strokeCap(SQUARE) (no cap) causes points to become invisible.
- *
- * @webref shape:attributes
- * @webBrief Sets the style for rendering line endings.
- * @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)
- */
+ /**
+ *
+ * Sets the style for rendering line endings. These ends are either squared,
+ * extended, or rounded, each of which specified with the corresponding
+ * parameters: SQUARE, PROJECT, and ROUND. The default cap is ROUND.
+ *
+ * To make point() appear square, use strokeCap(PROJECT). Using
+ * strokeCap(SQUARE) (no cap) causes points to become invisible.
+ *
+ * @webref shape:attributes
+ * @webBrief Sets the style for rendering line endings.
+ * @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);
@@ -14457,42 +14457,42 @@ public class PApplet implements PConstants {
}
- /**
- *
- * 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 or 0xFFCCFFAA).
- * The # syntax uses six digits to specify a color (just as colors are
- * typically 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 define the red, green, and blue components.
- *
- * The value for the gray parameter must be less than or equal to the current
- * maximum value as specified by colorMode(). The default maximum value
- * is 255.
- *
- * When drawing in 2D with the default renderer, you may need
- * hint(ENABLE_STROKE_PURE) to improve drawing quality (at the expense of
- * performance). See the hint() documentation for more details.
- *
- * @webref color:setting
- * @webBrief Sets the color used to draw lines and borders around shapes.
- * @param rgb color value in hexadecimal notation
- * @see PGraphics#noStroke()
- * @see PGraphics#strokeWeight(float)
- * @see PGraphics#strokeJoin(int)
- * @see PGraphics#strokeCap(int)
- * @see PGraphics#fill(int, float)
- * @see PGraphics#noFill()
- * @see PGraphics#tint(int, float)
- * @see PGraphics#background(float, float, float, float)
- * @see PGraphics#colorMode(int, float, float, float, float)
- */
+ /**
+ *
+ * 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 or 0xFFCCFFAA).
+ * The # syntax uses six digits to specify a color (just as colors are
+ * typically 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 define the red, green, and blue components.
+ *
+ * The value for the gray parameter must be less than or equal to the current
+ * maximum value as specified by colorMode(). The default maximum value
+ * is 255.
+ *
+ * When drawing in 2D with the default renderer, you may need
+ * hint(ENABLE_STROKE_PURE) to improve drawing quality (at the expense of
+ * performance). See the hint() documentation for more details.
+ *
+ * @webref color:setting
+ * @webBrief Sets the color used to draw lines and borders around shapes.
+ * @param rgb color value in hexadecimal notation
+ * @see PGraphics#noStroke()
+ * @see PGraphics#strokeWeight(float)
+ * @see PGraphics#strokeJoin(int)
+ * @see PGraphics#strokeCap(int)
+ * @see PGraphics#fill(int, float)
+ * @see PGraphics#noFill()
+ * @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);
g.stroke(rgb);
@@ -14559,39 +14559,39 @@ public class PApplet implements PConstants {
}
- /**
- *
- * Sets the fill value for displaying images. Images can be tinted to specified
- * colors or made transparent by including an alpha value.
- *
- * To apply transparency to an image without affecting its color, use white as
- * the tint color and specify an alpha value. For instance, tint(255,
- * 128) will make an image 50% transparent (assuming the default alpha range
- * of 0-255, which can be changed with colorMode()).
- *
- * When using hexadecimal notation to specify a color, use "#" or
- * "0x" before the values (e.g., #CCFFAA or 0xFFCCFFAA).
- * The # syntax uses six digits to specify a color (just as colors are
- * typically 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 define the red, green, and blue components.
- *
- * The value for the gray parameter must be less than or equal to the current
- * maximum value as specified by colorMode(). The default maximum value
- * is 255.
- *
- * The tint() function is also used to control the coloring of textures
- * in 3D.
- *
- *
- * @webref image:loading_displaying
- * @webBrief Sets the fill value for displaying images.
- * @usage web_application
- * @param rgb color value in hexadecimal notation
- * @see PGraphics#noTint()
- * @see PGraphics#image(PImage, float, float, float, float)
- */
+ /**
+ *
+ * Sets the fill value for displaying images. Images can be tinted to specified
+ * colors or made transparent by including an alpha value.
+ *
+ * To apply transparency to an image without affecting its color, use white as
+ * the tint color and specify an alpha value. For instance, tint(255,
+ * 128) will make an image 50% transparent (assuming the default alpha range
+ * of 0-255, which can be changed with colorMode()).
+ *
+ * When using hexadecimal notation to specify a color, use "#" or
+ * "0x" before the values (e.g., #CCFFAA or 0xFFCCFFAA).
+ * The # syntax uses six digits to specify a color (just as colors are
+ * typically 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 define the red, green, and blue components.
+ *
+ * The value for the gray parameter must be less than or equal to the current
+ * maximum value as specified by colorMode(). The default maximum value
+ * is 255.
+ *
+ * The tint() function is also used to control the coloring of textures
+ * in 3D.
+ *
+ *
+ * @webref image:loading_displaying
+ * @webBrief Sets the fill value for displaying images.
+ * @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);
g.tint(rgb);
@@ -14944,30 +14944,30 @@ public class PApplet implements PConstants {
}
- /**
- *
- * Adds an ambient light. Ambient light doesn't come from a specific direction,
- * the rays of 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 v1, v2, and v3 parameters are
- * interpreted as either RGB or HSB values, depending on the current color mode.
- *
- *
- * @webref lights_camera:lights
- * @webBrief Adds an ambient light.
- * @usage web_application
- * @param v1 red or hue value (depending on current color mode)
- * @param v2 green or saturation value (depending on current color mode)
- * @param v3 blue or brightness value (depending on current color mode)
- * @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)
- */
+ /**
+ *
+ * Adds an ambient light. Ambient light doesn't come from a specific direction,
+ * the rays of 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 v1, v2, and v3 parameters are
+ * interpreted as either RGB or HSB values, depending on the current color mode.
+ *
+ *
+ * @webref lights_camera:lights
+ * @webBrief Adds an ambient light.
+ * @usage web_application
+ * @param v1 red or hue value (depending on current color mode)
+ * @param v2 green or saturation value (depending on current color mode)
+ * @param v3 blue or brightness value (depending on current color mode)
+ * @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 v1, float v2, float v3) {
if (recorder != null) recorder.ambientLight(v1, v2, v3);
g.ambientLight(v1, v2, v3);
@@ -15022,31 +15022,31 @@ public class PApplet implements PConstants {
}
- /**
- *
- * Adds a point light. 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 v1, v2, and v3 parameters are interpreted
- * as either RGB or HSB values, depending on the current color mode. The
- * x, y, and z parameters set the position of the light.
- *
- *
- * @webref lights_camera:lights
- * @webBrief Adds a point light.
- * @usage web_application
- * @param v1 red or hue value (depending on current color mode)
- * @param v2 green or saturation value (depending on current color mode)
- * @param v3 blue or brightness value (depending on current color mode)
- * @param x x-coordinate of the light
- * @param y y-coordinate of the light
- * @param z z-coordinate of the light
- * @see PGraphics#lights()
- * @see PGraphics#directionalLight(float, float, float, float, float, float)
- * @see PGraphics#ambientLight(float, float, float, float, float, float)
- * @see PGraphics#spotLight(float, float, float, float, float, float, float,
- * float, float, float, float)
- */
+ /**
+ *
+ * Adds a point light. 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 v1, v2, and v3 parameters are interpreted
+ * as either RGB or HSB values, depending on the current color mode. The
+ * x, y, and z parameters set the position of the light.
+ *
+ *
+ * @webref lights_camera:lights
+ * @webBrief Adds a point light.
+ * @usage web_application
+ * @param v1 red or hue value (depending on current color mode)
+ * @param v2 green or saturation value (depending on current color mode)
+ * @param v3 blue or brightness value (depending on current color mode)
+ * @param x x-coordinate of the light
+ * @param y y-coordinate of the light
+ * @param z z-coordinate of the light
+ * @see PGraphics#lights()
+ * @see PGraphics#directionalLight(float, float, float, float, float, float)
+ * @see PGraphics#ambientLight(float, float, float, float, float, float)
+ * @see PGraphics#spotLight(float, float, float, float, float, float, float,
+ * float, float, float, float)
+ */
public void pointLight(float v1, float v2, float v3,
float x, float y, float z) {
if (recorder != null) recorder.pointLight(v1, v2, v3, x, y, z);
@@ -15054,40 +15054,40 @@ public class PApplet implements PConstants {
}
- /**
- *
- * Adds a spot light. 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 v1, v2, and v3 parameters are interpreted
- * as either RGB or HSB values, depending on the current color mode. The
- * x, y, and z parameters specify the position of the light
- * and nx, ny, nz specify the direction of light. The
- * angle parameter affects angle of the spotlight cone, while
- * concentration sets the bias of light focusing toward the center of
- * that cone.
- *
- * @webref lights_camera:lights
- * @webBrief Adds a spot light.
- * @usage web_application
- * @param v1 red or hue value (depending on current color mode)
- * @param v2 green or saturation value (depending on current color
- * mode)
- * @param v3 blue or brightness value (depending on current color
- * mode)
- * @param x x-coordinate of the light
- * @param y y-coordinate of the light
- * @param z z-coordinate of the light
- * @param nx direction along the x axis
- * @param ny direction along the y axis
- * @param nz direction along the z axis
- * @param angle angle of the spotlight cone
- * @param concentration exponent determining the center bias of the cone
- * @see PGraphics#lights()
- * @see PGraphics#directionalLight(float, float, float, float, float, float)
- * @see PGraphics#pointLight(float, float, float, float, float, float)
- * @see PGraphics#ambientLight(float, float, float, float, float, float)
- */
+ /**
+ *
+ * Adds a spot light. 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 v1, v2, and v3 parameters are interpreted
+ * as either RGB or HSB values, depending on the current color mode. The
+ * x, y, and z parameters specify the position of the light
+ * and nx, ny, nz specify the direction of light. The
+ * angle parameter affects angle of the spotlight cone, while
+ * concentration sets the bias of light focusing toward the center of
+ * that cone.
+ *
+ * @webref lights_camera:lights
+ * @webBrief Adds a spot light.
+ * @usage web_application
+ * @param v1 red or hue value (depending on current color mode)
+ * @param v2 green or saturation value (depending on current color
+ * mode)
+ * @param v3 blue or brightness value (depending on current color
+ * mode)
+ * @param x x-coordinate of the light
+ * @param y y-coordinate of the light
+ * @param z z-coordinate of the light
+ * @param nx direction along the x axis
+ * @param ny direction along the y axis
+ * @param nz direction along the z axis
+ * @param angle angle of the spotlight cone
+ * @param concentration exponent determining the center bias of the cone
+ * @see PGraphics#lights()
+ * @see PGraphics#directionalLight(float, float, float, float, float, float)
+ * @see PGraphics#pointLight(float, float, float, float, float, float)
+ * @see PGraphics#ambientLight(float, float, float, float, float, float)
+ */
public void spotLight(float v1, float v2, float v3,
float x, float y, float z,
float nx, float ny, float nz,
@@ -15097,38 +15097,38 @@ public class PApplet implements PConstants {
}
- /**
- *
- * Sets the falloff rates for point lights, spot lights, and ambient lights.
- * Like fill(), it affects only the elements which are created after it
- * in the code. The default value is lightFalloff(1.0, 0.0, 0.0), and the
- * parameters are used to calculate the falloff with the following
- * equation:
- *
- * d = distance from light position to vertex position
- * falloff = 1 / (CONSTANT + d * LINEAR + (d*d) * QUADRATIC)
- *
- * Thinking about an ambient light with a falloff can be tricky. If you want a
- * region of your scene to be lit ambiently with one color and another region to
- * be lit ambiently with another color, you could use an ambient light with
- * location and falloff. You can think of it as a point light that doesn't care
- * which direction a surface is facing.
- *
- *
- * @webref lights_camera:lights
- * @webBrief Sets the falloff rates for point lights, spot lights, and ambient
- * lights.
- * @usage web_application
- * @param constant constant value or determining falloff
- * @param linear linear value for determining falloff
- * @param quadratic quadratic value for determining falloff
- * @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)
- * @see PGraphics#lightSpecular(float, float, float)
- */
+ /**
+ *
+ * Sets the falloff rates for point lights, spot lights, and ambient lights.
+ * Like fill(), it affects only the elements which are created after it
+ * in the code. The default value is lightFalloff(1.0, 0.0, 0.0), and the
+ * parameters are used to calculate the falloff with the following
+ * equation:
+ *
+ * d = distance from light position to vertex position
+ * falloff = 1 / (CONSTANT + d * LINEAR + (d*d) * QUADRATIC)
+ *
+ * Thinking about an ambient light with a falloff can be tricky. If you want a
+ * region of your scene to be lit ambiently with one color and another region to
+ * be lit ambiently with another color, you could use an ambient light with
+ * location and falloff. You can think of it as a point light that doesn't care
+ * which direction a surface is facing.
+ *
+ *
+ * @webref lights_camera:lights
+ * @webBrief Sets the falloff rates for point lights, spot lights, and ambient
+ * lights.
+ * @usage web_application
+ * @param constant constant value or determining falloff
+ * @param linear linear value for determining falloff
+ * @param quadratic quadratic value for determining falloff
+ * @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)
+ * @see PGraphics#lightSpecular(float, float, float)
+ */
public void lightFalloff(float constant, float linear, float quadratic) {
if (recorder != null) recorder.lightFalloff(constant, linear, quadratic);
g.lightFalloff(constant, linear, quadratic);
@@ -15164,49 +15164,49 @@ public class PApplet implements PConstants {
}
- /**
- *
- * The background() function sets the color used for the background of
- * the Processing window. The default background is light gray. This function is
- * typically used within draw() to clear the display window at the
- * beginning of each frame, but it can be used inside setup() to set the
- * background on the first frame of animation or if the backgound need only be
- * set once.
- *
- * An image can also be used as the background for a sketch, although the
- * image's width and height must match that of the sketch window. Images used
- * with background() will ignore the current tint() setting. To
- * resize an image to the size of the sketch window, use image.resize(width,
- * height).
- *
- * It is not possible to use the transparency alpha parameter with
- * background colors on the main drawing surface. It can only be used along with
- * a PGraphics object and createGraphics().
- *
- *
- *
Advanced
- *
- * Clear the background with a color that includes an alpha value. This can only
- * be used with objects created by createGraphics(), because the main drawing
- * surface cannot be set transparent.
- *
- *
- * It might be tempting to use this function to partially clear the screen on
- * each frame, however that's not how this function works. When calling
- * background(), the pixels will be replaced with pixels that have that level of
- * transparency. To do a semi-transparent overlay, use fill() with alpha and
- * draw a rectangle.
- *
- *
- * @webref color:setting
- * @webBrief Sets the color used for the background of the Processing window.
- * @usage web_application
- * @param rgb any value of the color datatype
- * @see PGraphics#stroke(float)
- * @see PGraphics#fill(float)
- * @see PGraphics#tint(float)
- * @see PGraphics#colorMode(int)
- */
+ /**
+ *
+ * The background() function sets the color used for the background of
+ * the Processing window. The default background is light gray. This function is
+ * typically used within draw() to clear the display window at the
+ * beginning of each frame, but it can be used inside setup() to set the
+ * background on the first frame of animation or if the backgound need only be
+ * set once.
+ *
+ * An image can also be used as the background for a sketch, although the
+ * image's width and height must match that of the sketch window. Images used
+ * with background() will ignore the current tint() setting. To
+ * resize an image to the size of the sketch window, use image.resize(width,
+ * height).
+ *
+ * It is not possible to use the transparency alpha parameter with
+ * background colors on the main drawing surface. It can only be used along with
+ * a PGraphics object and createGraphics().
+ *
+ *
+ *
Advanced
+ *
+ * Clear the background with a color that includes an alpha value. This can only
+ * be used with objects created by createGraphics(), because the main drawing
+ * surface cannot be set transparent.
+ *
+ *
+ * It might be tempting to use this function to partially clear the screen on
+ * each frame, however that's not how this function works. When calling
+ * background(), the pixels will be replaced with pixels that have that level of
+ * transparency. To do a semi-transparent overlay, use fill() with alpha and
+ * draw a rectangle.
+ *
+ *
+ * @webref color:setting
+ * @webBrief Sets the color used for the background of the Processing window.
+ * @usage web_application
+ * @param rgb 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);
@@ -15292,36 +15292,36 @@ public class PApplet implements PConstants {
}
- /**
- *
- * 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
- * max, max1, max2, max3, and maxA.
- *
- * After changing the range of values for colors with code like
- * colorMode(HSB, 360, 100, 100), those ranges remain in use until they
- * are explicitly changed again. For example, after running colorMode(HSB,
- * 360, 100, 100) and then changing back to colorMode(RGB), the range
- * for R will be 0 to 360 and the range for G and B will be 0 to 100. To avoid
- * this, be explicit about the ranges when changing the color mode. For
- * instance, instead of colorMode(RGB), write colorMode(RGB, 255, 255,
- * 255).
- *
- *
- * @webref color:setting
- * @webBrief Changes the way Processing interprets color data.
- * @usage web_application
- * @param mode Either RGB or HSB, corresponding to Red/Green/Blue and
- * Hue/Saturation/Brightness
- * @see PGraphics#background(float)
- * @see PGraphics#fill(float)
- * @see PGraphics#stroke(float)
- */
+ /**
+ *
+ * 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
+ * max, max1, max2, max3, and maxA.
+ *
+ * After changing the range of values for colors with code like
+ * colorMode(HSB, 360, 100, 100), those ranges remain in use until they
+ * are explicitly changed again. For example, after running colorMode(HSB,
+ * 360, 100, 100) and then changing back to colorMode(RGB), the range
+ * for R will be 0 to 360 and the range for G and B will be 0 to 100. To avoid
+ * this, be explicit about the ranges when changing the color mode. For
+ * instance, instead of colorMode(RGB), write colorMode(RGB, 255, 255,
+ * 255).
+ *
+ *
+ * @webref color:setting
+ * @webBrief Changes the way Processing interprets color data.
+ * @usage web_application
+ * @param mode Either RGB or HSB, corresponding to Red/Green/Blue and
+ * Hue/Saturation/Brightness
+ * @see PGraphics#background(float)
+ * @see PGraphics#fill(float)
+ * @see PGraphics#stroke(float)
+ */
public void colorMode(int mode) {
if (recorder != null) recorder.colorMode(mode);
g.colorMode(mode);
@@ -15378,115 +15378,115 @@ public class PApplet implements PConstants {
}
- /**
- *
- * Extracts the red value from a color, scaled to match current
- * colorMode(). The 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 understand, but it is slower
- * than a technique called bit shifting. When working in colorMode(RGB,
- * 255), you can acheive the same results as red() but with greater
- * speed by using the right shift operator (>>) with a bit mask. For
- * example, the following two lines of code are equivalent means of getting the
- * red value of the color value c:
- *
- *
- *
- * float r1 = red(c); // Simpler, but slower to calculate
- * float r2 = c >> 16 & 0xFF; // Very fast to calculate
- *
- *
- *
- * @webref color:creating_reading
- * @webBrief Extracts the red value from a color, scaled to match current
- * colorMode().
- * @usage web_application
- * @param rgb any value of the color datatype
- * @see PGraphics#green(int)
- * @see PGraphics#blue(int)
- * @see PGraphics#alpha(int)
- * @see PGraphics#hue(int)
- * @see PGraphics#saturation(int)
- * @see PGraphics#brightness(int)
- * @see_external rightshift
- */
+ /**
+ *
+ * Extracts the red value from a color, scaled to match current
+ * colorMode(). The 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 understand, but it is slower
+ * than a technique called bit shifting. When working in colorMode(RGB,
+ * 255), you can acheive the same results as red() but with greater
+ * speed by using the right shift operator (>>) with a bit mask. For
+ * example, the following two lines of code are equivalent means of getting the
+ * red value of the color value c:
+ *
+ *
+ *
+ * float r1 = red(c); // Simpler, but slower to calculate
+ * float r2 = c >> 16 & 0xFF; // Very fast to calculate
+ *
+ *
+ *
+ * @webref color:creating_reading
+ * @webBrief Extracts the red value from a color, scaled to match current
+ * colorMode().
+ * @usage web_application
+ * @param rgb any value of the color datatype
+ * @see PGraphics#green(int)
+ * @see PGraphics#blue(int)
+ * @see PGraphics#alpha(int)
+ * @see PGraphics#hue(int)
+ * @see PGraphics#saturation(int)
+ * @see PGraphics#brightness(int)
+ * @see_external rightshift
+ */
public final float red(int rgb) {
return g.red(rgb);
}
- /**
- *
- * Extracts the green value from a color, scaled to match current
- * colorMode(). The value is always returned as a float, so be careful
- * not to assign it to an int value.
- *
- * The green() function is easy to use and understand, but it is slower
- * than a technique called bit shifting. When working in colorMode(RGB,
- * 255), you can acheive the same results as green() but with greater
- * speed by using the right shift operator (>>) with a bit mask. For
- * example, the following two lines of code are equivalent means of getting the
- * green value of the color value c:
- *
- *
- *
- * float g1 = green(c); // Simpler, but slower to calculate
- * float g2 = c >> 8 & 0xFF; // Very fast to calculate
- *
- *
- *
- * @webref color:creating_reading
- * @webBrief Extracts the green value from a color, scaled to match current
- * colorMode().
- * @usage web_application
- * @param rgb any value of the color datatype
- * @see PGraphics#red(int)
- * @see PGraphics#blue(int)
- * @see PGraphics#alpha(int)
- * @see PGraphics#hue(int)
- * @see PGraphics#saturation(int)
- * @see PGraphics#brightness(int)
- * @see_external rightshift
- */
+ /**
+ *
+ * Extracts the green value from a color, scaled to match current
+ * colorMode(). The value is always returned as a float, so be careful
+ * not to assign it to an int value.
+ *
+ * The green() function is easy to use and understand, but it is slower
+ * than a technique called bit shifting. When working in colorMode(RGB,
+ * 255), you can acheive the same results as green() but with greater
+ * speed by using the right shift operator (>>) with a bit mask. For
+ * example, the following two lines of code are equivalent means of getting the
+ * green value of the color value c:
+ *
+ *
+ *
+ * float g1 = green(c); // Simpler, but slower to calculate
+ * float g2 = c >> 8 & 0xFF; // Very fast to calculate
+ *
+ *
+ *
+ * @webref color:creating_reading
+ * @webBrief Extracts the green value from a color, scaled to match current
+ * colorMode().
+ * @usage web_application
+ * @param rgb any value of the color datatype
+ * @see PGraphics#red(int)
+ * @see PGraphics#blue(int)
+ * @see PGraphics#alpha(int)
+ * @see PGraphics#hue(int)
+ * @see PGraphics#saturation(int)
+ * @see PGraphics#brightness(int)
+ * @see_external rightshift
+ */
public final float green(int rgb) {
return g.green(rgb);
}
- /**
- *
- * Extracts the blue value from a color, scaled to match current
- * colorMode(). The value is always returned as a float, so be careful
- * not to assign it to an int value.
- *
- * The blue() function is easy to use and understand, but it is slower
- * than a technique called bit masking. When working in colorMode(RGB,
- * 255), you can acheive the same results as blue() but with greater
- * speed by using a bit mask to remove the other color components. For example,
- * the following two lines of code are equivalent means of getting the blue
- * value of the color value c:
- *
- *
- *
- * float b1 = blue(c); // Simpler, but slower to calculate
- * float b2 = c & 0xFF; // Very fast to calculate
- *
- *
- *
- * @webref color:creating_reading
- * @webBrief Extracts the blue value from a color, scaled to match current
- * colorMode().
- * @usage web_application
- * @param rgb any value of the color datatype
- * @see PGraphics#red(int)
- * @see PGraphics#green(int)
- * @see PGraphics#alpha(int)
- * @see PGraphics#hue(int)
- * @see PGraphics#saturation(int)
- * @see PGraphics#brightness(int)
- * @see_external rightshift
- */
+ /**
+ *
+ * Extracts the blue value from a color, scaled to match current
+ * colorMode(). The value is always returned as a float, so be careful
+ * not to assign it to an int value.
+ *
+ * The blue() function is easy to use and understand, but it is slower
+ * than a technique called bit masking. When working in colorMode(RGB,
+ * 255), you can acheive the same results as blue() but with greater
+ * speed by using a bit mask to remove the other color components. For example,
+ * the following two lines of code are equivalent means of getting the blue
+ * value of the color value c:
+ *
+ *
+ *
+ * float b1 = blue(c); // Simpler, but slower to calculate
+ * float b2 = c & 0xFF; // Very fast to calculate
+ *
+ *
+ *
+ * @webref color:creating_reading
+ * @webBrief Extracts the blue value from a color, scaled to match current
+ * colorMode().
+ * @usage web_application
+ * @param rgb any value of the color datatype
+ * @see PGraphics#red(int)
+ * @see PGraphics#green(int)
+ * @see PGraphics#alpha(int)
+ * @see PGraphics#hue(int)
+ * @see PGraphics#saturation(int)
+ * @see PGraphics#brightness(int)
+ * @see_external rightshift
+ */
public final float blue(int rgb) {
return g.blue(rgb);
}
@@ -15790,67 +15790,67 @@ public class PApplet implements PConstants {
}
- /**
- *
- * Filters the 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 parameter 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. No parameter is
- * used.
- *
- * OPAQUE
- * Sets the alpha channel to entirely opaque. No parameter is used.
- *
- * INVERT
- * Sets each pixel to its inverse value. No parameter is used.
- *
- * POSTERIZE
- * Limits each channel of the image to the number of colors specified as the
- * parameter. The parameter can be set to values between 2 and 255, but results
- * are most noticeable in the lower ranges.
- *
- * BLUR
- * Executes a Gaussian blur with the level parameter specifying the extent of
- * the blurring. If no parameter is used, the blur is equivalent to Gaussian
- * blur of radius 1. Larger values increase the blur.
- *
- * ERODE
- * Reduces the light areas. No parameter is used.
- *
- * DILATE
- * Increases the light areas. No parameter is used.
- *
- *
- *
Advanced
Method to apply a variety of basic filters to this image.
- *
- *
- *
filter(BLUR) provides a basic blur.
- *
filter(GRAY) converts the image to grayscale based on luminance.
- *
filter(INVERT) will invert the color components in the image.
- *
filter(OPAQUE) set all the high bits in the image to opaque
- *
filter(THRESHOLD) converts the image to black and white.
- *
filter(DILATE) grow white/light areas
- *
filter(ERODE) shrink white/light areas
- *
- * Luminance conversion code contributed by
- * toxi
- *
- * Gaussian blur code contributed by
- * Mario Klingemann
- *
- * @webref image:pixels
- * @webBrief Converts the image to grayscale or black and white
- * @usage web_application
- * @param kind Either THRESHOLD, GRAY, OPAQUE, INVERT, POSTERIZE, BLUR, ERODE,
- * or DILATE
- * @param param unique for each, see above
- */
+ /**
+ *
+ * Filters the 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 parameter 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. No parameter is
+ * used.
+ *
+ * OPAQUE
+ * Sets the alpha channel to entirely opaque. No parameter is used.
+ *
+ * INVERT
+ * Sets each pixel to its inverse value. No parameter is used.
+ *
+ * POSTERIZE
+ * Limits each channel of the image to the number of colors specified as the
+ * parameter. The parameter can be set to values between 2 and 255, but results
+ * are most noticeable in the lower ranges.
+ *
+ * BLUR
+ * Executes a Gaussian blur with the level parameter specifying the extent of
+ * the blurring. If no parameter is used, the blur is equivalent to Gaussian
+ * blur of radius 1. Larger values increase the blur.
+ *
+ * ERODE
+ * Reduces the light areas. No parameter is used.
+ *
+ * DILATE
+ * Increases the light areas. No parameter is used.
+ *
+ *
+ *
Advanced
Method to apply a variety of basic filters to this image.
+ *
+ *
+ *
filter(BLUR) provides a basic blur.
+ *
filter(GRAY) converts the image to grayscale based on luminance.
+ *
filter(INVERT) will invert the color components in the image.
+ *
filter(OPAQUE) set all the high bits in the image to opaque
+ *
filter(THRESHOLD) converts the image to black and white.
+ *
filter(DILATE) grow white/light areas
+ *
filter(ERODE) shrink white/light areas
+ *
+ * Luminance conversion code contributed by
+ * toxi
+ *
+ * Gaussian blur code contributed by
+ * Mario Klingemann
+ *
+ * @webref image:pixels
+ * @webBrief Converts the image to grayscale or black and white
+ * @usage web_application
+ * @param kind Either THRESHOLD, GRAY, OPAQUE, INVERT, POSTERIZE, BLUR, ERODE,
+ * or DILATE
+ * @param param unique for each, see above
+ */
public void filter(int kind, float param) {
if (recorder != null) recorder.filter(kind, param);
g.filter(kind, param);
diff --git a/core/src/processing/core/PConstants.java b/core/src/processing/core/PConstants.java
index 026c66319..3f267f9fa 100644
--- a/core/src/processing/core/PConstants.java
+++ b/core/src/processing/core/PConstants.java
@@ -127,37 +127,37 @@ public interface PConstants {
// useful goodness
- /**
- *
- * PI is a mathematical constant with the value 3.1415927. It is the
- * ratio of the circumference of a circle to its diameter. It is useful in
- * combination with the trigonometric functions sin() and cos().
- *
- * @webref constants
- * @webBrief PI is a mathematical constant with the value
- * 3.14159265358979323846.
- * @see PConstants#TWO_PI
- * @see PConstants#TAU
- * @see PConstants#HALF_PI
- * @see PConstants#QUARTER_PI
- *
- */
+ /**
+ *
+ * PI is a mathematical constant with the value 3.1415927. It is the
+ * ratio of the circumference of a circle to its diameter. It is useful in
+ * combination with the trigonometric functions sin() and cos().
+ *
+ * @webref constants
+ * @webBrief PI is a mathematical constant with the value
+ * 3.14159265358979323846.
+ * @see PConstants#TWO_PI
+ * @see PConstants#TAU
+ * @see PConstants#HALF_PI
+ * @see PConstants#QUARTER_PI
+ *
+ */
static final float PI = (float) Math.PI;
- /**
- *
- * HALF_PI is a mathematical constant with the value 1.5707964. It is
- * half the ratio of the circumference of a circle to its diameter. It is useful
- * in combination with the trigonometric functions sin() and
- * cos().
- *
- * @webref constants
- * @webBrief HALF_PI is a mathematical constant with the value
- * 1.57079632679489661923.
- * @see PConstants#PI
- * @see PConstants#TWO_PI
- * @see PConstants#TAU
- * @see PConstants#QUARTER_PI
- */
+ /**
+ *
+ * HALF_PI is a mathematical constant with the value 1.5707964. It is
+ * half the ratio of the circumference of a circle to its diameter. It is useful
+ * in combination with the trigonometric functions sin() and
+ * cos().
+ *
+ * @webref constants
+ * @webBrief HALF_PI is a mathematical constant with the value
+ * 1.57079632679489661923.
+ * @see PConstants#PI
+ * @see PConstants#TWO_PI
+ * @see PConstants#TAU
+ * @see PConstants#QUARTER_PI
+ */
static final float HALF_PI = (float) (Math.PI / 2.0);
static final float THIRD_PI = (float) (Math.PI / 3.0);
/**
@@ -190,21 +190,21 @@ public interface PConstants {
* @see PConstants#QUARTER_PI
*/
static final float TWO_PI = (float) (2.0 * Math.PI);
- /**
- *
- * TAU is a mathematical constant with the value 6.2831855. It is the
- * circle constant relating the circumference of a circle to its linear
- * dimension, the ratio of the circumference of a circle to its radius. It is
- * useful in combination with trigonometric functions such as sin() and
- * cos().
- *
- * @webref constants
- * @webBrief An alias for TWO_PI
- * @see PConstants#PI
- * @see PConstants#TWO_PI
- * @see PConstants#HALF_PI
- * @see PConstants#QUARTER_PI
- */
+ /**
+ *
+ * TAU is a mathematical constant with the value 6.2831855. It is the
+ * circle constant relating the circumference of a circle to its linear
+ * dimension, the ratio of the circumference of a circle to its radius. It is
+ * useful in combination with trigonometric functions such as sin() and
+ * cos().
+ *
+ * @webref constants
+ * @webBrief An alias for TWO_PI
+ * @see PConstants#PI
+ * @see PConstants#TWO_PI
+ * @see PConstants#HALF_PI
+ * @see PConstants#QUARTER_PI
+ */
static final float TAU = (float) (2.0 * Math.PI);
static final float DEG_TO_RAD = PI/180.0f;
diff --git a/core/src/processing/core/PFont.java b/core/src/processing/core/PFont.java
index 8a7df97f6..563c1fe63 100644
--- a/core/src/processing/core/PFont.java
+++ b/core/src/processing/core/PFont.java
@@ -884,18 +884,18 @@ public class PFont implements PConstants {
}
- /**
- *
- * Gets a list of the fonts installed on the system. The data is returned as a
- * String array. This list provides the names of each font for input into
- * createFont(), which allows Processing to dynamically format fonts.
- *
- *
- * @webref pfont
- * @webBrief Gets a list of the fonts installed on the system.
- * @usage application
- * @brief Gets a list of the fonts installed on the system
- */
+ /**
+ *
+ * Gets a list of the fonts installed on the system. The data is returned as a
+ * String array. This list provides the names of each font for input into
+ * createFont(), which allows Processing to dynamically format fonts.
+ *
+ *
+ * @webref pfont
+ * @webBrief Gets a list of the fonts installed on the system.
+ * @usage application
+ * @brief Gets a list of the fonts installed on the system
+ */
static public String[] list() {
loadFonts();
String[] list = new String[fonts.length];
diff --git a/core/src/processing/core/PGraphics.java b/core/src/processing/core/PGraphics.java
index 452241aac..b53cb0268 100644
--- a/core/src/processing/core/PGraphics.java
+++ b/core/src/processing/core/PGraphics.java
@@ -49,108 +49,108 @@ import java.util.concurrent.TimeUnit;
import processing.opengl.PGL;
import processing.opengl.PShader;
- /**
- *
- * Main graphics and rendering context, as well as the base API implementation
- * for processing "core". Use this class if you need to draw into an off-screen
- * graphics buffer. A PGraphics object can be constructed with the
- * createGraphics() function. The beginDraw() and endDraw()
- * methods (see above example) are necessary to set up the buffer and to
- * finalize it. The fields and methods for this class are extensive. For a
- * complete list, visit the
- * developer's
- * reference.
- *
- * To create a new graphics context, use the createGraphics() function.
- * Do not use the syntax new PGraphics().
- *
- *
Advanced
Main graphics and rendering context, as well as the base
- * API implementation.
- *
- *
Subclassing and initializing PGraphics objects
Starting in release
- * 0149, subclasses of PGraphics are handled differently. The constructor for
- * subclasses takes no parameters, instead a series of functions are called by
- * the hosting PApplet to specify its attributes.
- *
- *
setParent(PApplet) - is called to specify the parent PApplet.
- *
setPrimary(boolean) - called with true if this PGraphics will be the
- * primary drawing surface used by the sketch, or false if not.
- *
setPath(String) - called when the renderer needs a filename or output
- * path, such as with the PDF or DXF renderers.
- *
setSize(int, int) - this is called last, at which point it's safe for the
- * renderer to complete its initialization routine.
- *
- * The functions were broken out because of the growing number of parameters
- * such as these that might be used by a renderer, yet with the exception of
- * setSize(), it's not clear which will be necessary. So while the size could be
- * passed in to the constructor instead of a setSize() function, a function
- * would still be needed that would notify the renderer that it was time to
- * finish its initialization. Thus, setSize() simply does both.
- *
- *
Know your rights: public vs. private methods
Methods that are
- * protected are often subclassed by other renderers, however they are not set
- * 'public' because they shouldn't be part of the user-facing public API
- * accessible from PApplet. That is, we don't want sketches calling
- * textModeCheck() or vertexTexture() directly.
- *
- *
Handling warnings and exceptions
Methods that are unavailable
- * generally show a warning, unless their lack of availability will soon cause
- * another exception. For instance, if a method like getMatrix() returns null
- * because it is unavailable, an exception will be thrown stating that the
- * method is unavailable, rather than waiting for the NullPointerException that
- * will occur when the sketch tries to use that method. As of release 0149,
- * warnings will only be shown once, and exceptions have been changed to
- * warnings where possible.
- *
- *
Using xxxxImpl() for subclassing smoothness
The xxxImpl() methods
- * are generally renderer-specific handling for some subset if tasks for a
- * particular function (vague enough for you?) For instance, imageImpl() handles
- * drawing an image whose x/y/w/h and u/v coords have been specified, and screen
- * placement (independent of imageMode) has been determined. There's no point in
- * all renderers implementing the if (imageMode == BLAH)
- * placement/sizing logic, so that's handled by PGraphics, which then calls
- * imageImpl() once all that is figured out.
- *
- *
His brother PImage
PGraphics subclasses PImage so that it can be
- * drawn and manipulated in a similar fashion. As such, many methods are
- * inherited from PGraphics, though many are unavailable: for instance, resize()
- * is not likely to be implemented; the same goes for mask(), depending on the
- * situation.
- *
- *
What's in PGraphics, what ain't
For the benefit of subclasses, as
- * much as possible has been placed inside PGraphics. For instance, bezier
- * interpolation code and implementations of the strokeCap() method (that simply
- * sets the strokeCap variable) are handled here. Features that will vary widely
- * between renderers are located inside the subclasses themselves. For instance,
- * all matrix handling code is per-renderer: Java 2D uses its own
- * AffineTransform, P2D uses a PMatrix2D, and PGraphics3D needs to keep
- * continually update forward and reverse transformations. A proper (future)
- * OpenGL implementation will have all its matrix madness handled by the card.
- * Lighting also falls under this category, however the base material property
- * settings (emissive, specular, et al.) are handled in PGraphics because they
- * use the standard colorMode() logic. Subclasses should override methods like
- * emissiveFromCalc(), which is a point where a valid color has been defined
- * internally, and can be applied in some manner based on the calcXxxx values.
- *
- *
What's in the PGraphics documentation, what ain't
Some things are
- * noted here, some things are not. For public API, always refer to the
- * reference on Processing.org for
- * proper explanations. No attempt has been made to keep the javadoc up to
- * date or complete. It's an enormous task for which we simply do not have
- * the time. That is, it's not something that to be done once—it's a
- * matter of keeping the multiple references synchronized (to say nothing of the
- * translation issues), while targeting them for their separate audiences. Ouch.
- *
- * We're working right now on synchronizing the two references, so the website
- * reference is generated from the javadoc comments. Yay.
- *
- * @webref rendering
- * @webBrief Main graphics and rendering context, as well as the base API
- * implementation for processing "core".
- * @instanceName graphics any object of the type PGraphics
- * @usage Web & Application
- * @see PApplet#createGraphics(int, int, String)
- */
+/**
+ *
+ * Main graphics and rendering context, as well as the base API implementation
+ * for processing "core". Use this class if you need to draw into an off-screen
+ * graphics buffer. A PGraphics object can be constructed with the
+ * createGraphics() function. The beginDraw() and endDraw()
+ * methods (see above example) are necessary to set up the buffer and to
+ * finalize it. The fields and methods for this class are extensive. For a
+ * complete list, visit the
+ * developer's
+ * reference.
+ *
+ * To create a new graphics context, use the createGraphics() function.
+ * Do not use the syntax new PGraphics().
+ *
+ *
Advanced
Main graphics and rendering context, as well as the base
+ * API implementation.
+ *
+ *
Subclassing and initializing PGraphics objects
Starting in release
+ * 0149, subclasses of PGraphics are handled differently. The constructor for
+ * subclasses takes no parameters, instead a series of functions are called by
+ * the hosting PApplet to specify its attributes.
+ *
+ *
setParent(PApplet) - is called to specify the parent PApplet.
+ *
setPrimary(boolean) - called with true if this PGraphics will be the
+ * primary drawing surface used by the sketch, or false if not.
+ *
setPath(String) - called when the renderer needs a filename or output
+ * path, such as with the PDF or DXF renderers.
+ *
setSize(int, int) - this is called last, at which point it's safe for the
+ * renderer to complete its initialization routine.
+ *
+ * The functions were broken out because of the growing number of parameters
+ * such as these that might be used by a renderer, yet with the exception of
+ * setSize(), it's not clear which will be necessary. So while the size could be
+ * passed in to the constructor instead of a setSize() function, a function
+ * would still be needed that would notify the renderer that it was time to
+ * finish its initialization. Thus, setSize() simply does both.
+ *
+ *
Know your rights: public vs. private methods
Methods that are
+ * protected are often subclassed by other renderers, however they are not set
+ * 'public' because they shouldn't be part of the user-facing public API
+ * accessible from PApplet. That is, we don't want sketches calling
+ * textModeCheck() or vertexTexture() directly.
+ *
+ *
Handling warnings and exceptions
Methods that are unavailable
+ * generally show a warning, unless their lack of availability will soon cause
+ * another exception. For instance, if a method like getMatrix() returns null
+ * because it is unavailable, an exception will be thrown stating that the
+ * method is unavailable, rather than waiting for the NullPointerException that
+ * will occur when the sketch tries to use that method. As of release 0149,
+ * warnings will only be shown once, and exceptions have been changed to
+ * warnings where possible.
+ *
+ *
Using xxxxImpl() for subclassing smoothness
The xxxImpl() methods
+ * are generally renderer-specific handling for some subset if tasks for a
+ * particular function (vague enough for you?) For instance, imageImpl() handles
+ * drawing an image whose x/y/w/h and u/v coords have been specified, and screen
+ * placement (independent of imageMode) has been determined. There's no point in
+ * all renderers implementing the if (imageMode == BLAH)
+ * placement/sizing logic, so that's handled by PGraphics, which then calls
+ * imageImpl() once all that is figured out.
+ *
+ *
His brother PImage
PGraphics subclasses PImage so that it can be
+ * drawn and manipulated in a similar fashion. As such, many methods are
+ * inherited from PGraphics, though many are unavailable: for instance, resize()
+ * is not likely to be implemented; the same goes for mask(), depending on the
+ * situation.
+ *
+ *
What's in PGraphics, what ain't
For the benefit of subclasses, as
+ * much as possible has been placed inside PGraphics. For instance, bezier
+ * interpolation code and implementations of the strokeCap() method (that simply
+ * sets the strokeCap variable) are handled here. Features that will vary widely
+ * between renderers are located inside the subclasses themselves. For instance,
+ * all matrix handling code is per-renderer: Java 2D uses its own
+ * AffineTransform, P2D uses a PMatrix2D, and PGraphics3D needs to keep
+ * continually update forward and reverse transformations. A proper (future)
+ * OpenGL implementation will have all its matrix madness handled by the card.
+ * Lighting also falls under this category, however the base material property
+ * settings (emissive, specular, et al.) are handled in PGraphics because they
+ * use the standard colorMode() logic. Subclasses should override methods like
+ * emissiveFromCalc(), which is a point where a valid color has been defined
+ * internally, and can be applied in some manner based on the calcXxxx values.
+ *
+ *
What's in the PGraphics documentation, what ain't
Some things are
+ * noted here, some things are not. For public API, always refer to the
+ * reference on Processing.org for
+ * proper explanations. No attempt has been made to keep the javadoc up to
+ * date or complete. It's an enormous task for which we simply do not have
+ * the time. That is, it's not something that to be done once—it's a
+ * matter of keeping the multiple references synchronized (to say nothing of the
+ * translation issues), while targeting them for their separate audiences. Ouch.
+ *
+ * We're working right now on synchronizing the two references, so the website
+ * reference is generated from the javadoc comments. Yay.
+ *
+ * @webref rendering
+ * @webBrief Main graphics and rendering context, as well as the base API
+ * implementation for processing "core".
+ * @instanceName graphics any object of the type PGraphics
+ * @usage Web & Application
+ * @see PApplet#createGraphics(int, int, String)
+ */
public class PGraphics extends PImage implements PConstants {
// /// Canvas object that covers rendering this graphics on screen.
@@ -1191,44 +1191,44 @@ public class PGraphics extends PImage implements PConstants {
}
- /**
- *
- * 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 kind 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.
- *
- * 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 and P3D renderers allow stroke() and fill() to be
- * altered on a per-vertex basis, but the default renderer does not. Settings
- * such as strokeWeight(), strokeCap(), and strokeJoin()
- * cannot be changed while inside a beginShape()/endShape() block
- * with any renderer.
- *
- * @webref shape:vertex
- * @webBrief Using the beginShape() and endShape() functions allow
- * creating more complex forms.
- * @param kind Either POINTS, LINES, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP,
- * QUADS, or QUAD_STRIP
- * @see PShape
- * @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)
- */
+ /**
+ *
+ * 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 kind 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.
+ *
+ * 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 and P3D renderers allow stroke() and fill() to be
+ * altered on a per-vertex basis, but the default renderer does not. Settings
+ * such as strokeWeight(), strokeCap(), and strokeJoin()
+ * cannot be changed while inside a beginShape()/endShape() block
+ * with any renderer.
+ *
+ * @webref shape:vertex
+ * @webBrief Using the beginShape() and endShape() functions allow
+ * creating more complex forms.
+ * @param kind Either POINTS, LINES, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP,
+ * QUADS, or QUAD_STRIP
+ * @see PShape
+ * @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) {
shape = kind;
}
@@ -1243,24 +1243,24 @@ public class PGraphics extends PImage implements PConstants {
}
- /**
- *
- * Sets the current normal vector. Used for drawing three dimensional shapes and
- * surfaces, normal() specifies a vector perpendicular to a shape's
- * surface which, in turn, determines how lighting affects it. Processing
- * attempts to automatically assign normals to shapes, but since that's
- * imperfect, this is a better option when you want more control. This function
- * is identical to glNormal3f() in OpenGL.
- *
- * @webref lights_camera:lights
- * @webBrief Sets the current normal vector.
- * @param nx x direction
- * @param ny y direction
- * @param nz z direction
- * @see PGraphics#beginShape(int)
- * @see PGraphics#endShape(int)
- * @see PGraphics#lights()
- */
+ /**
+ *
+ * Sets the current normal vector. Used for drawing three dimensional shapes and
+ * surfaces, normal() specifies a vector perpendicular to a shape's
+ * surface which, in turn, determines how lighting affects it. Processing
+ * attempts to automatically assign normals to shapes, but since that's
+ * imperfect, this is a better option when you want more control. This function
+ * is identical to glNormal3f() in OpenGL.
+ *
+ * @webref lights_camera:lights
+ * @webBrief Sets the current normal vector.
+ * @param nx x direction
+ * @param ny y direction
+ * @param nz z direction
+ * @see PGraphics#beginShape(int)
+ * @see PGraphics#endShape(int)
+ * @see PGraphics#lights()
+ */
public void normal(float nx, float ny, float nz) {
normalX = nx;
normalY = ny;
@@ -1310,23 +1310,23 @@ public class PGraphics extends PImage implements PConstants {
}
- /**
- *
- * Sets the coordinate space for texture mapping. The default mode is
- * IMAGE, which refers to the actual coordinates of the image.
- * NORMAL refers to a normalized space of values ranging from 0 to 1.
- * This function only works with the P2D and P3D renderers.
- *
- * With IMAGE, if an image is 100 x 200 pixels, mapping the image onto
- * the entire size of a quad would require the points (0,0) (100, 0) (100,200)
- * (0,200). The same mapping in NORMAL is (0,0) (1,0) (1,1) (0,1).
- *
- * @webref image:textures
- * @webBrief Sets the coordinate space for texture mapping.
- * @param mode either IMAGE or NORMAL
- * @see PGraphics#texture(PImage)
- * @see PGraphics#textureWrap(int)
- */
+ /**
+ *
+ * Sets the coordinate space for texture mapping. The default mode is
+ * IMAGE, which refers to the actual coordinates of the image.
+ * NORMAL refers to a normalized space of values ranging from 0 to 1.
+ * This function only works with the P2D and P3D renderers.
+ *
+ * With IMAGE, if an image is 100 x 200 pixels, mapping the image onto
+ * the entire size of a quad would require the points (0,0) (100, 0) (100,200)
+ * (0,200). The same mapping in NORMAL is (0,0) (1,0) (1,1) (0,1).
+ *
+ * @webref image:textures
+ * @webBrief Sets the coordinate space for texture mapping.
+ * @param mode either IMAGE or NORMAL
+ * @see PGraphics#texture(PImage)
+ * @see PGraphics#textureWrap(int)
+ */
public void textureMode(int mode) {
if (mode != IMAGE && mode != NORMAL) {
throw new RuntimeException("textureMode() only supports IMAGE and NORMAL");
@@ -1352,26 +1352,26 @@ public class PGraphics extends PImage implements PConstants {
}
- /**
- *
- * Sets a texture to be applied to vertex points. The texture() function
- * must be called between beginShape() and endShape() and before
- * any calls to vertex(). This function only works with the P2D and P3D
- * renderers.
- *
- * 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.
- *
- * @webref image:textures
- * @webBrief Sets a texture to be applied to vertex points.
- * @param image reference to a PImage object
- * @see PGraphics#textureMode(int)
- * @see PGraphics#textureWrap(int)
- * @see PGraphics#beginShape(int)
- * @see PGraphics#endShape(int)
- * @see PGraphics#vertex(float, float, float, float, float)
- */
+ /**
+ *
+ * Sets a texture to be applied to vertex points. The texture() function
+ * must be called between beginShape() and endShape() and before
+ * any calls to vertex(). This function only works with the P2D and P3D
+ * renderers.
+ *
+ * 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.
+ *
+ * @webref image:textures
+ * @webBrief Sets a texture to be applied to vertex points.
+ * @param image reference to a PImage object
+ * @see PGraphics#textureMode(int)
+ * @see PGraphics#textureWrap(int)
+ * @see PGraphics#beginShape(int)
+ * @see PGraphics#endShape(int)
+ * @see PGraphics#vertex(float, float, float, float, float)
+ */
public void texture(PImage image) {
textureImage = image;
}
@@ -2524,33 +2524,33 @@ public class PGraphics extends PImage implements PConstants {
// SIMPLE SHAPES WITH ANALOGUES IN beginShape()
- /**
- *
- * 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 with the z parameter requires the P3D
- * parameter in combination with size() as shown in the above example.
- *
- *
- * Use stroke() to set the color of a point().
- *
- * Point appears round with the default strokeCap(ROUND) and square with
- * strokeCap(PROJECT). Points are invisible with strokeCap(SQUARE)
- * (no cap).
- *
- * Using point() with strokeWeight(1) or smaller may draw nothing to the screen,
- * depending on the graphics settings of the computer. Workarounds include
- * setting the pixel using set() or drawing the point using either
- * circle() or square().
- *
- *
- * @webref shape:2d_primitives
- * @webBrief Draws a point, a coordinate in space at the dimension of one pixel.
- * @param x x-coordinate of the point
- * @param y y-coordinate of the point
- * @see PGraphics#stroke(int)
- */
+ /**
+ *
+ * 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 with the z parameter requires the P3D
+ * parameter in combination with size() as shown in the above example.
+ *
+ *
+ * Use stroke() to set the color of a point().
+ *
+ * Point appears round with the default strokeCap(ROUND) and square with
+ * strokeCap(PROJECT). Points are invisible with strokeCap(SQUARE)
+ * (no cap).
+ *
+ * Using point() with strokeWeight(1) or smaller may draw nothing to the screen,
+ * depending on the graphics settings of the computer. Workarounds include
+ * setting the pixel using set() or drawing the point using either
+ * circle() or square().
+ *
+ *
+ * @webref shape:2d_primitives
+ * @webBrief Draws a point, a coordinate in space at the dimension of one pixel.
+ * @param x x-coordinate of the point
+ * @param y y-coordinate of the point
+ * @see PGraphics#stroke(int)
+ */
public void point(float x, float y) {
beginShape(POINTS);
vertex(x, y);
@@ -2669,66 +2669,66 @@ public class PGraphics extends PImage implements PConstants {
// RECT
- /**
- *
- * Modifies the location from which rectangles are drawn by changing the way in
- * which parameters given to rect() are intepreted.
- *
- * The default mode is rectMode(CORNER), which interprets the first two
- * parameters of rect() as the upper-left corner of the shape, while the
- * third and fourth parameters are its width and height.
- *
- * rectMode(CORNERS) interprets the first two parameters of rect()
- * as the location of one corner, and the third and fourth parameters as the
- * location of the opposite corner.
- *
- * rectMode(CENTER) interprets the first two parameters of rect()
- * as the shape's center point, while the third and fourth parameters are its
- * width and height.
- *
- * rectMode(RADIUS) also uses the first two parameters of rect()
- * as the shape's center point, but uses the third and fourth parameters to
- * specify half of the shapes's width and height.
- *
- * The parameter must be written in ALL CAPS because Processing is a
- * case-sensitive language.
- *
- * @webref shape:attributes
- * @webBrief Modifies the location from which rectangles draw.
- * @param mode either CORNER, CORNERS, CENTER, or RADIUS
- * @see PGraphics#rect(float, float, float, float)
- */
+ /**
+ *
+ * Modifies the location from which rectangles are drawn by changing the way in
+ * which parameters given to rect() are intepreted.
+ *
+ * The default mode is rectMode(CORNER), which interprets the first two
+ * parameters of rect() as the upper-left corner of the shape, while the
+ * third and fourth parameters are its width and height.
+ *
+ * rectMode(CORNERS) interprets the first two parameters of rect()
+ * as the location of one corner, and the third and fourth parameters as the
+ * location of the opposite corner.
+ *
+ * rectMode(CENTER) interprets the first two parameters of rect()
+ * as the shape's center point, while the third and fourth parameters are its
+ * width and height.
+ *
+ * rectMode(RADIUS) also uses the first two parameters of rect()
+ * as the shape's center point, but uses the third and fourth parameters to
+ * specify half of the shapes's width and height.
+ *
+ * The parameter must be written in ALL CAPS because Processing is a
+ * case-sensitive language.
+ *
+ * @webref shape:attributes
+ * @webBrief Modifies the location from which rectangles draw.
+ * @param mode either CORNER, CORNERS, CENTER, or RADIUS
+ * @see PGraphics#rect(float, float, float, float)
+ */
public void rectMode(int mode) {
rectMode = mode;
}
- /**
- *
- * 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. The way these parameters are interpreted, however, may be
- * changed with the rectMode() function.
- *
- * To draw a rounded rectangle, add a fifth parameter, which is used as the
- * radius value for all four corners.
- *
- * To use a different radius value for each corner, include eight parameters.
- * When using eight parameters, the latter four set the radius of the arc at
- * each corner separately, starting with the top-left corner and moving
- * clockwise around the rectangle.
- *
- *
- * @webref shape:2d_primitives
- * @webBrief Draws a rectangle to the screen.
- * @param a x-coordinate of the rectangle by default
- * @param b y-coordinate of the rectangle by default
- * @param c width of the rectangle by default
- * @param d height of the rectangle by default
- * @see PGraphics#rectMode(int)
- * @see PGraphics#quad(float, float, float, float, float, float, float, float)
- */
+ /**
+ *
+ * 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. The way these parameters are interpreted, however, may be
+ * changed with the rectMode() function.
+ *
+ * To draw a rounded rectangle, add a fifth parameter, which is used as the
+ * radius value for all four corners.
+ *
+ * To use a different radius value for each corner, include eight parameters.
+ * When using eight parameters, the latter four set the radius of the arc at
+ * each corner separately, starting with the top-left corner and moving
+ * clockwise around the rectangle.
+ *
+ *
+ * @webref shape:2d_primitives
+ * @webBrief Draws a rectangle to the screen.
+ * @param a x-coordinate of the rectangle by default
+ * @param b y-coordinate of the rectangle by default
+ * @param c width of the rectangle by default
+ * @param d height of the rectangle by default
+ * @see PGraphics#rectMode(int)
+ * @see PGraphics#quad(float, float, float, float, float, float, float, float)
+ */
public void rect(float a, float b, float c, float d) {
float hradius, vradius;
switch (rectMode) {
@@ -2904,59 +2904,59 @@ public class PGraphics extends PImage implements PConstants {
// ELLIPSE AND ARC
- /**
- *
- * Modifies the location from which ellipses are drawn by changing the way in
- * which parameters given to ellipse() are intepreted.
- *
- * The default mode is ellipseMode(CENTER), which interprets the first
- * two parameters of ellipse() as the shape's center point, while the
- * third and fourth parameters are its width and height.
- *
- * ellipseMode(RADIUS) also uses the first two parameters of
- * ellipse() as the shape's center point, but uses the third and fourth
- * parameters to specify half of the shapes's width and height.
- *
- * ellipseMode(CORNER) interprets the first two parameters of
- * ellipse() as the upper-left corner of the shape, while the third and
- * fourth parameters are its width and height.
- *
- * ellipseMode(CORNERS) interprets the first two parameters of
- * ellipse() as the location of one corner of the ellipse's bounding box,
- * and the third and fourth parameters as the location of the opposite
- * corner.
- *
- * The parameter must be written in ALL CAPS because Processing is a
- * case-sensitive language.
- *
- * @webref shape:attributes
- * @webBrief The origin of the ellipse is modified by the ellipseMode()
- * function.
- * @param mode either CENTER, RADIUS, CORNER, or CORNERS
- * @see PApplet#ellipse(float, float, float, float)
- * @see PApplet#arc(float, float, float, float, float, float)
- */
+ /**
+ *
+ * Modifies the location from which ellipses are drawn by changing the way in
+ * which parameters given to ellipse() are intepreted.
+ *
+ * The default mode is ellipseMode(CENTER), which interprets the first
+ * two parameters of ellipse() as the shape's center point, while the
+ * third and fourth parameters are its width and height.
+ *
+ * ellipseMode(RADIUS) also uses the first two parameters of
+ * ellipse() as the shape's center point, but uses the third and fourth
+ * parameters to specify half of the shapes's width and height.
+ *
+ * ellipseMode(CORNER) interprets the first two parameters of
+ * ellipse() as the upper-left corner of the shape, while the third and
+ * fourth parameters are its width and height.
+ *
+ * ellipseMode(CORNERS) interprets the first two parameters of
+ * ellipse() as the location of one corner of the ellipse's bounding box,
+ * and the third and fourth parameters as the location of the opposite
+ * corner.
+ *
+ * The parameter must be written in ALL CAPS because Processing is a
+ * case-sensitive language.
+ *
+ * @webref shape:attributes
+ * @webBrief The origin of the ellipse is modified by the ellipseMode()
+ * function.
+ * @param mode either CENTER, RADIUS, CORNER, or CORNERS
+ * @see PApplet#ellipse(float, float, float, float)
+ * @see PApplet#arc(float, float, float, float, float, float)
+ */
public void ellipseMode(int mode) {
ellipseMode = mode;
}
- /**
- *
- * Draws an ellipse (oval) to the screen. An ellipse with equal width and height
- * is a circle. By default, the first two parameters set the location, and the
- * third and fourth parameters set the shape's width and height. The origin may
- * be changed with the ellipseMode() function.
- *
- * @webref shape:2d_primitives
- * @webBrief Draws an ellipse (oval) in the display window.
- * @param a x-coordinate of the ellipse
- * @param b y-coordinate of the ellipse
- * @param c width of the ellipse by default
- * @param d height of the ellipse by default
- * @see PApplet#ellipseMode(int)
- * @see PApplet#arc(float, float, float, float, float, float)
- */
+ /**
+ *
+ * Draws an ellipse (oval) to the screen. An ellipse with equal width and height
+ * is a circle. By default, the first two parameters set the location, and the
+ * third and fourth parameters set the shape's width and height. The origin may
+ * be changed with the ellipseMode() function.
+ *
+ * @webref shape:2d_primitives
+ * @webBrief Draws an ellipse (oval) in the display window.
+ * @param a x-coordinate of the ellipse
+ * @param b y-coordinate of the ellipse
+ * @param c width of the ellipse by default
+ * @param d height of the ellipse by default
+ * @see PApplet#ellipseMode(int)
+ * @see PApplet#arc(float, float, float, float, float, float)
+ */
public void ellipse(float a, float b, float c, float d) {
float x = a;
float y = b;
@@ -2996,38 +2996,38 @@ public class PGraphics extends PImage implements PConstants {
}
- /**
- *
- * Draws an arc to the screen. Arcs are drawn along the outer edge of an ellipse
- * defined by the a, b, c, and d parameters. The
- * origin of the arc's ellipse may be changed with the ellipseMode()
- * function. Use the start and stop parameters to specify the
- * angles (in radians) at which to draw the arc. The start/stop values must be
- * in clockwise order.
- *
- * There are three ways to draw an arc; the rendering technique used is defined
- * by the optional seventh parameter. The three options, depicted in the above
- * examples, are PIE, OPEN, and CHORD. The default mode is the OPEN stroke with
- * a PIE fill.
- *
- * In some cases, the arc() function isn't accurate enough for smooth
- * drawing. For example, the shape may jitter on screen when rotating slowly. If
- * you're having an issue with how arcs are rendered, you'll need to draw the
- * arc yourself with beginShape()/endShape() or a PShape.
- *
- * @webref shape:2d_primitives
- * @webBrief Draws an arc in the display window.
- * @param a x-coordinate of the arc's ellipse
- * @param b y-coordinate of the arc's ellipse
- * @param c width of the arc's ellipse by default
- * @param d height of the arc's ellipse by default
- * @param start angle to start the arc, specified in radians
- * @param stop angle to stop the arc, specified in radians
- * @see PApplet#ellipse(float, float, float, float)
- * @see PApplet#ellipseMode(int)
- * @see PApplet#radians(float)
- * @see PApplet#degrees(float)
- */
+ /**
+ *
+ * Draws an arc to the screen. Arcs are drawn along the outer edge of an ellipse
+ * defined by the a, b, c, and d parameters. The
+ * origin of the arc's ellipse may be changed with the ellipseMode()
+ * function. Use the start and stop parameters to specify the
+ * angles (in radians) at which to draw the arc. The start/stop values must be
+ * in clockwise order.
+ *
+ * There are three ways to draw an arc; the rendering technique used is defined
+ * by the optional seventh parameter. The three options, depicted in the above
+ * examples, are PIE, OPEN, and CHORD. The default mode is the OPEN stroke with
+ * a PIE fill.
+ *
+ * In some cases, the arc() function isn't accurate enough for smooth
+ * drawing. For example, the shape may jitter on screen when rotating slowly. If
+ * you're having an issue with how arcs are rendered, you'll need to draw the
+ * arc yourself with beginShape()/endShape() or a PShape.
+ *
+ * @webref shape:2d_primitives
+ * @webBrief Draws an arc in the display window.
+ * @param a x-coordinate of the arc's ellipse
+ * @param b y-coordinate of the arc's ellipse
+ * @param c width of the arc's ellipse by default
+ * @param d height of the arc's ellipse by default
+ * @param start angle to start the arc, specified in radians
+ * @param stop angle to stop the arc, specified in radians
+ * @see PApplet#ellipse(float, float, float, float)
+ * @see PApplet#ellipseMode(int)
+ * @see PApplet#radians(float)
+ * @see PApplet#degrees(float)
+ */
public void arc(float a, float b, float c, float d,
float start, float stop) {
arc(a, b, c, d, start, stop, 0);
@@ -3466,21 +3466,21 @@ public class PGraphics extends PImage implements PConstants {
}
- /**
- *
- * Sets the resolution at which Beziers display. The default value is 20. This
- * function is only useful when using the P3D renderer; the default
- * P2D renderer does not use this information.
- *
- *
- * @webref shape:curves
- * @webBrief Sets the resolution at which Beziers display.
- * @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, float)
- * @see PGraphics#curveTightness(float)
- */
+ /**
+ *
+ * Sets the resolution at which Beziers display. The default value is 20. This
+ * function is only useful when using the P3D renderer; the default
+ * P2D renderer does not use this information.
+ *
+ *
+ * @webref shape:curves
+ * @webBrief Sets the resolution at which Beziers display.
+ * @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, float)
+ * @see PGraphics#curveTightness(float)
+ */
public void bezierDetail(int detail) {
bezierDetail = detail;
@@ -3580,29 +3580,29 @@ public class PGraphics extends PImage implements PConstants {
// CATMULL-ROM CURVE
- /**
- *
- * Evaluates the curve at point t for points a, b,
- * c, d. The parameter t may range from 0 (the start of the
- * curve) and 1 (the end of the curve). a and d are the control
- * points, and b and c are points on the curve. As seen in the
- * example above, this can be used once with the x coordinates and a
- * second time with the y coordinates to get the location of a curve at
- * t.
- *
- *
- * @webref shape:curves
- * @webBrief Evalutes the curve at point t for points a, b, c, d.
- * @param a coordinate of first control point
- * @param b coordinate of first point on the curve
- * @param c coordinate of second point on the curve
- * @param d coordinate of second control point
- * @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)
- */
+ /**
+ *
+ * Evaluates the curve at point t for points a, b,
+ * c, d. The parameter t may range from 0 (the start of the
+ * curve) and 1 (the end of the curve). a and d are the control
+ * points, and b and c are points on the curve. As seen in the
+ * example above, this can be used once with the x coordinates and a
+ * second time with the y coordinates to get the location of a curve at
+ * t.
+ *
+ *
+ * @webref shape:curves
+ * @webBrief Evalutes the curve at point t for points a, b, c, d.
+ * @param a coordinate of first control point
+ * @param b coordinate of first point on the curve
+ * @param c coordinate of second point on the curve
+ * @param d coordinate of second control point
+ * @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)
+ */
public float curvePoint(float a, float b, float c, float d, float t) {
curveInitCheck();
@@ -3675,25 +3675,25 @@ public class PGraphics extends PImage implements PConstants {
}
- /**
- *
- * Modifies the quality of forms created with curve() and
- * curveVertex(). The parameter tightness determines how the curve
- * fits to the vertex points. The value 0.0 is the default value for
- * tightness (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.
- *
- * @webref shape:curves
- * @webBrief Modifies the quality of forms created with curve() and
- * curveVertex().
- * @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)
- */
+ /**
+ *
+ * Modifies the quality of forms created with curve() and
+ * curveVertex(). The parameter tightness determines how the curve
+ * fits to the vertex points. The value 0.0 is the default value for
+ * tightness (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.
+ *
+ * @webref shape:curves
+ * @webBrief Modifies the quality of forms created with curve() and
+ * curveVertex().
+ * @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) {
curveTightness = tightness;
curveInit();
@@ -3896,36 +3896,36 @@ public class PGraphics extends PImage implements PConstants {
// IMAGE
- /**
- *
- * Modifies the location from which images are drawn by changing the way in
- * which parameters given to image() are intepreted.
- *
- * The default mode is imageMode(CORNER), which interprets the second and
- * third parameters of image() as the upper-left corner of the image. If
- * two additional parameters are specified, they are used to set the image's
- * width and height.
- *
- * imageMode(CORNERS) interprets the second and third parameters of
- * image() as the location of one corner, and the fourth and fifth
- * parameters as the opposite corner.
- *
- * imageMode(CENTER) interprets the second and third parameters of
- * image() as the image's center point. If two additional parameters are
- * specified, they are used to set the image's width and height.
- *
- * The parameter must be written in ALL CAPS because Processing is a
- * case-sensitive language.
- *
- *
- * @webref image:loading_displaying
- * @webBrief Modifies the location from which images draw.
- * @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)
- */
+ /**
+ *
+ * Modifies the location from which images are drawn by changing the way in
+ * which parameters given to image() are intepreted.
+ *
+ * The default mode is imageMode(CORNER), which interprets the second and
+ * third parameters of image() as the upper-left corner of the image. If
+ * two additional parameters are specified, they are used to set the image's
+ * width and height.
+ *
+ * imageMode(CORNERS) interprets the second and third parameters of
+ * image() as the location of one corner, and the fourth and fifth
+ * parameters as the opposite corner.
+ *
+ * imageMode(CENTER) interprets the second and third parameters of
+ * image() as the image's center point. If two additional parameters are
+ * specified, they are used to set the image's width and height.
+ *
+ * The parameter must be written in ALL CAPS because Processing is a
+ * case-sensitive language.
+ *
+ *
+ * @webref image:loading_displaying
+ * @webBrief Modifies the location from which images draw.
+ * @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 ((mode == CORNER) || (mode == CORNERS) || (mode == CENTER)) {
imageMode = mode;
@@ -3937,38 +3937,38 @@ public class PGraphics extends PImage implements PConstants {
}
- /**
- *
- * The image() function draws an image to the display window. Images must
- * be in the sketch's "data" directory to load correctly. Select "Add file..."
- * from the "Sketch" menu to add the image to the data directory, or just drag
- * the image file onto the sketch window. Processing currently works with GIF,
- * JPEG, and PNG images.
- *
- * The img parameter specifies the image to display and by default the
- * a and b parameters define the location of its upper-left
- * corner. The image is displayed at its original size unless the c and
- * d parameters specify a different size. The imageMode() function
- * can be used to change the way these parameters draw the image.
- *
- * The color of an image may be modified with the tint() function. This
- * function will maintain transparency for GIF and PNG images.
- *
- *
Advanced
Starting with release 0124, when using the default (JAVA2D)
- * renderer, smooth() will also improve image quality of resized images.
- *
- * @webref image:loading_displaying
- * @webBrief Displays images to the screen.
- * @param img the image to display
- * @param a x-coordinate of the image by default
- * @param b y-coordinate of the image by default
- * @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)
- */
+ /**
+ *
+ * The image() function draws an image to the display window. Images must
+ * be in the sketch's "data" directory to load correctly. Select "Add file..."
+ * from the "Sketch" menu to add the image to the data directory, or just drag
+ * the image file onto the sketch window. Processing currently works with GIF,
+ * JPEG, and PNG images.
+ *
+ * The img parameter specifies the image to display and by default the
+ * a and b parameters define the location of its upper-left
+ * corner. The image is displayed at its original size unless the c and
+ * d parameters specify a different size. The imageMode() function
+ * can be used to change the way these parameters draw the image.
+ *
+ * The color of an image may be modified with the tint() function. This
+ * function will maintain transparency for GIF and PNG images.
+ *
+ *
Advanced
Starting with release 0124, when using the default (JAVA2D)
+ * renderer, smooth() will also improve image quality of resized images.
+ *
+ * @webref image:loading_displaying
+ * @webBrief Displays images to the screen.
+ * @param img the image to display
+ * @param a x-coordinate of the image by default
+ * @param b y-coordinate of the image by default
+ * @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 img, float a, float b) {
// Starting in release 0144, image errors are simply ignored.
// loadImageAsync() sets width and height to -1 when loading fails.
@@ -4162,29 +4162,29 @@ public class PGraphics extends PImage implements PConstants {
}
- /**
- *
- * Draws shapes to the display window. 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, OBJ, and custom-created
- * shapes. The shape parameter specifies the shape to display and the
- * coordinate parameters define the location of the shape from its upper-left
- * corner. The shape is displayed at its original size unless the c and
- * d parameters specify a different size. The shapeMode() function
- * can be used to change the way these parameters are interpreted.
- *
- *
- * @webref shape:loading_displaying
- * @webBrief Displays shapes to the screen.
- * @param shape the shape to display
- * @param x x-coordinate of the shape
- * @param y y-coordinate of the shape
- * @see PShape
- * @see PApplet#loadShape(String)
- * @see PGraphics#shapeMode(int)
- *
- * Convenience method to draw at a particular location.
- */
+ /**
+ *
+ * Draws shapes to the display window. 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, OBJ, and custom-created
+ * shapes. The shape parameter specifies the shape to display and the
+ * coordinate parameters define the location of the shape from its upper-left
+ * corner. The shape is displayed at its original size unless the c and
+ * d parameters specify a different size. The shapeMode() function
+ * can be used to change the way these parameters are interpreted.
+ *
+ *
+ * @webref shape:loading_displaying
+ * @webBrief Displays shapes to the screen.
+ * @param shape the shape to display
+ * @param x x-coordinate of the shape
+ * @param y y-coordinate of the shape
+ * @see PShape
+ * @see PApplet#loadShape(String)
+ * @see PGraphics#shapeMode(int)
+ *
+ * Convenience method to draw at a particular location.
+ */
public void shape(PShape shape, float x, float y) {
if (shape.isVisible()) { // don't do expensive matrix ops if invisible
flush();
@@ -4311,61 +4311,61 @@ public class PGraphics extends PImage implements PConstants {
}
- /**
- *
- * 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.
- *
- * 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.
- *
- *
- *
- * @webref typography:attributes
- * @webBrief Sets the current alignment for drawing text.
- * @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)
- * @see PGraphics#textSize(float)
- * @see PGraphics#textAscent()
- * @see PGraphics#textDescent()
- */
+ /**
+ *
+ * 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.
+ *
+ * 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.
+ *
+ *
+ *
+ * @webref typography:attributes
+ * @webBrief Sets the current alignment for drawing text.
+ * @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)
+ * @see PGraphics#textSize(float)
+ * @see PGraphics#textAscent()
+ * @see PGraphics#textDescent()
+ */
public void textAlign(int alignX, int alignY) {
textAlign = alignX;
textAlignY = alignY;
}
- /**
- *
- * Returns ascent of the current font at its current size. This information is
- * useful for determining the height of the font above the baseline.
- *
- *
- * @webref typography:metrics
- * @webBrief Returns ascent of the current font at its current size.
- * @see PGraphics#textDescent()
- */
+ /**
+ *
+ * Returns ascent of the current font at its current size. This information is
+ * useful for determining the height of the font above the baseline.
+ *
+ *
+ * @webref typography:metrics
+ * @webBrief Returns ascent of the current font at its current size.
+ * @see PGraphics#textDescent()
+ */
public float textAscent() {
if (textFont == null) {
defaultFontOrDeath("textAscent");
@@ -4374,15 +4374,15 @@ public class PGraphics extends PImage implements PConstants {
}
- /**
- *
- * Returns descent of the current font at its current size. This information is
- * useful for determining the height of the font below the baseline.
- *
- * @webref typography:metrics
- * @webBrief Returns descent of the current font at its current size.
- * @see PGraphics#textAscent()
- */
+ /**
+ *
+ * Returns descent of the current font at its current size. This information is
+ * useful for determining the height of the font below the baseline.
+ *
+ * @webref typography:metrics
+ * @webBrief Returns descent of the current font at its current size.
+ * @see PGraphics#textAscent()
+ */
public float textDescent() {
if (textFont == null) {
defaultFontOrDeath("textDescent");
@@ -4391,35 +4391,35 @@ public class PGraphics extends PImage implements PConstants {
}
- /**
- *
- * Sets the current font that will be drawn with the text() function.
- * Fonts must be created for Processing with createFont() or loaded with
- * loadFont() before they can be used. The font set through
- * textFont() will be used in all subsequent calls to the text()
- * function. If no size parameter is specified, the font size defaults to
- * the original size (the size in which it was created with the "Create Font..."
- * tool) overriding any previous calls to textFont() or
- * textSize().
- *
- * When fonts are rendered as an image texture (as is the case with the P2D and
- * P3D renderers as well as with loadFont() and vlw files), you should
- * create fonts at the sizes that will be used most commonly. Using
- * textFont() without the size parameter will result in the cleanest
- * type.
- *
- *
- *
- * @webref typography:loading_displaying
- * @webBrief Sets the current font that will be drawn with the text()
- * function.
- * @param which any variable of the type PFont
- * @see PApplet#createFont(String, float, boolean)
- * @see PApplet#loadFont(String)
- * @see PFont
- * @see PGraphics#text(String, float, float)
- * @see PGraphics#textSize(float)
- */
+ /**
+ *
+ * Sets the current font that will be drawn with the text() function.
+ * Fonts must be created for Processing with createFont() or loaded with
+ * loadFont() before they can be used. The font set through
+ * textFont() will be used in all subsequent calls to the text()
+ * function. If no size parameter is specified, the font size defaults to
+ * the original size (the size in which it was created with the "Create Font..."
+ * tool) overriding any previous calls to textFont() or
+ * textSize().
+ *
+ * When fonts are rendered as an image texture (as is the case with the P2D and
+ * P3D renderers as well as with loadFont() and vlw files), you should
+ * create fonts at the sizes that will be used most commonly. Using
+ * textFont() without the size parameter will result in the cleanest
+ * type.
+ *
+ *
+ *
+ * @webref typography:loading_displaying
+ * @webBrief Sets the current font that will be drawn with the text()
+ * function.
+ * @param which any variable of the type PFont
+ * @see PApplet#createFont(String, float, boolean)
+ * @see PApplet#loadFont(String)
+ * @see PFont
+ * @see PGraphics#text(String, float, float)
+ * @see PGraphics#textSize(float)
+ */
public void textFont(PFont which) {
if (which == null) {
throw new RuntimeException(ERROR_TEXTFONT_NULL_PFONT);
@@ -4491,58 +4491,58 @@ public class PGraphics extends PImage implements PConstants {
}
- /**
- *
- * Sets the spacing between lines of text in units of pixels. This setting will
- * be used in all subsequent calls to the text() function. Note, however,
- * that the leading is reset by textSize(). For example, if the leading
- * is set to 20 with textLeading(20), then if textSize(48) is run
- * at a later point, the leading will be reset to the default for the text size
- * of 48.
- *
- *
- * @webref typography:attributes
- * @webBrief Sets the spacing between lines of text in units of pixels.
- * @param leading the size in pixels for spacing between lines
- * @see PApplet#loadFont(String)
- * @see PFont#PFont
- * @see PGraphics#text(String, float, float)
- * @see PGraphics#textFont(PFont)
- * @see PGraphics#textSize(float)
- */
+ /**
+ *
+ * Sets the spacing between lines of text in units of pixels. This setting will
+ * be used in all subsequent calls to the text() function. Note, however,
+ * that the leading is reset by textSize(). For example, if the leading
+ * is set to 20 with textLeading(20), then if textSize(48) is run
+ * at a later point, the leading will be reset to the default for the text size
+ * of 48.
+ *
+ *
+ * @webref typography:attributes
+ * @webBrief Sets the spacing between lines of text in units of pixels.
+ * @param leading the size in pixels for spacing between lines
+ * @see PApplet#loadFont(String)
+ * @see PFont#PFont
+ * @see PGraphics#text(String, float, float)
+ * @see PGraphics#textFont(PFont)
+ * @see PGraphics#textSize(float)
+ */
public void textLeading(float leading) {
textLeading = leading;
}
- /**
- *
- * Sets the way text draws to the screen, either as texture maps or as vector
- * geometry. The default textMode(MODEL), uses textures to render the
- * fonts. The textMode(SHAPE) mode draws text using the glyph outlines of
- * individual characters rather than as textures. This mode is only supported
- * with the PDF and P3D 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 P3D can be combined with
- * beginRaw() to write vector-accurate text to 2D and 3D output files,
- * for instance DXF or PDF. The SHAPE mode is not currently
- * optimized for P3D, so if recording shape data, use
- * textMode(MODEL) until you're ready to capture the geometry with
- * beginRaw().
- *
- * @webref typography:attributes
- * @webBrief Sets the way text draws to the screen.
- * @param mode either MODEL or SHAPE
- * @see PApplet#loadFont(String)
- * @see PFont#PFont
- * @see PGraphics#text(String, float, float)
- * @see PGraphics#textFont(PFont)
- * @see PGraphics#beginRaw(PGraphics)
- * @see PApplet#createFont(String, float, boolean)
- */
+ /**
+ *
+ * Sets the way text draws to the screen, either as texture maps or as vector
+ * geometry. The default textMode(MODEL), uses textures to render the
+ * fonts. The textMode(SHAPE) mode draws text using the glyph outlines of
+ * individual characters rather than as textures. This mode is only supported
+ * with the PDF and P3D 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 P3D can be combined with
+ * beginRaw() to write vector-accurate text to 2D and 3D output files,
+ * for instance DXF or PDF. The SHAPE mode is not currently
+ * optimized for P3D, so if recording shape data, use
+ * textMode(MODEL) until you're ready to capture the geometry with
+ * beginRaw().
+ *
+ * @webref typography:attributes
+ * @webBrief Sets the way text draws to the screen.
+ * @param mode either MODEL or SHAPE
+ * @see PApplet#loadFont(String)
+ * @see PFont#PFont
+ * @see PGraphics#text(String, float, float)
+ * @see PGraphics#textFont(PFont)
+ * @see PGraphics#beginRaw(PGraphics)
+ * @see PApplet#createFont(String, float, boolean)
+ */
public void textMode(int mode) {
// CENTER and MODEL overlap (they're both 3)
if ((mode == LEFT) || (mode == RIGHT)) {
@@ -4706,45 +4706,45 @@ public class PGraphics extends PImage implements PConstants {
// ........................................................
- /**
- *
- * Draws text to the screen. Displays the information specified in the first
- * parameter on the screen in the position specified by the additional
- * parameters. A default font will be used unless a font is set with the
- * textFont() function and a default size will be used unless a font is
- * set with textSize(). 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 x2 and y2 parameters define a rectangular area to display
- * within and may only be used with string data. When these parameters are
- * specified, they are interpreted based on the current rectMode()
- * setting. Text that does not fit completely within the rectangle specified
- * will not be drawn to the screen.
- *
- * Note that Processing now lets you call text() without first specifying
- * a PFont with textFont(). In that case, a generic sans-serif font will
- * be used instead. (See the third example above.)
- *
- *
- * @webref typography:loading_displaying
- * @webBrief Draws text to the screen.
- * @param c the alphanumeric character to be displayed
- * @param x x-coordinate of text
- * @param y y-coordinate of text
- * @see PGraphics#textAlign(int, int)
- * @see PGraphics#textFont(PFont)
- * @see PGraphics#textMode(int)
- * @see PGraphics#textSize(float)
- * @see PGraphics#textLeading(float)
- * @see PGraphics#textWidth(String)
- * @see PGraphics#textAscent()
- * @see PGraphics#textDescent()
- * @see PGraphics#rectMode(int)
- * @see PGraphics#fill(int, float)
- * @see_external String
- */
+ /**
+ *
+ * Draws text to the screen. Displays the information specified in the first
+ * parameter on the screen in the position specified by the additional
+ * parameters. A default font will be used unless a font is set with the
+ * textFont() function and a default size will be used unless a font is
+ * set with textSize(). 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 x2 and y2 parameters define a rectangular area to display
+ * within and may only be used with string data. When these parameters are
+ * specified, they are interpreted based on the current rectMode()
+ * setting. Text that does not fit completely within the rectangle specified
+ * will not be drawn to the screen.
+ *
+ * Note that Processing now lets you call text() without first specifying
+ * a PFont with textFont(). In that case, a generic sans-serif font will
+ * be used instead. (See the third example above.)
+ *
+ *
+ * @webref typography:loading_displaying
+ * @webBrief Draws text to the screen.
+ * @param c the alphanumeric character to be displayed
+ * @param x x-coordinate of text
+ * @param y y-coordinate of text
+ * @see PGraphics#textAlign(int, int)
+ * @see PGraphics#textFont(PFont)
+ * @see PGraphics#textMode(int)
+ * @see PGraphics#textSize(float)
+ * @see PGraphics#textLeading(float)
+ * @see PGraphics#textWidth(String)
+ * @see PGraphics#textAscent()
+ * @see PGraphics#textDescent()
+ * @see PGraphics#rectMode(int)
+ * @see PGraphics#fill(int, float)
+ * @see_external String
+ */
public void text(char c, float x, float y) {
if (textFont == null) {
defaultFontOrDeath("text");
@@ -5445,36 +5445,36 @@ public class PGraphics extends PImage implements PConstants {
// MATRIX TRANSFORMATIONS
- /**
- *
- * 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 P3D as a parameter in combination with size
- * as shown in the above example.
- *
- * Transformations are cumulative and 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 using pushMatrix() and
- * popMatrix().
- *
- *
- * @webref transform
- * @webBrief Specifies an amount to displace objects within the display window.
- * @param x left/right translation
- * @param y 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)
- */
+ /**
+ *
+ * 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 P3D as a parameter in combination with size
+ * as shown in the above example.
+ *
+ * Transformations are cumulative and 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 using pushMatrix() and
+ * popMatrix().
+ *
+ *
+ * @webref transform
+ * @webBrief Specifies an amount to displace objects within the display window.
+ * @param x left/right translation
+ * @param y 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 x, float y) {
showMissingWarning("translate");
}
@@ -5635,36 +5635,36 @@ public class PGraphics extends PImage implements PConstants {
}
- /**
- *
- * 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 function with the z parameter
- * requires using P3D as a parameter for size(), as shown in the third
- * example above. This function can be further controlled with
- * pushMatrix() and popMatrix().
- *
- *
- * @webref transform
- * @webBrief Increases or decreases the size of a shape by expanding and
- * contracting vertices.
- * @param s percentage to scale the object
- * @see PGraphics#pushMatrix()
- * @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)
- */
+ /**
+ *
+ * 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 function with the z parameter
+ * requires using P3D as a parameter for size(), as shown in the third
+ * example above. This function can be further controlled with
+ * pushMatrix() and popMatrix().
+ *
+ *
+ * @webref transform
+ * @webBrief Increases or decreases the size of a shape by expanding and
+ * contracting vertices.
+ * @param s percentage to scale the object
+ * @see PGraphics#pushMatrix()
+ * @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 scale(float s) {
showMissingWarning("scale");
}
@@ -5766,19 +5766,19 @@ public class PGraphics extends PImage implements PConstants {
// MATRIX FULL MONTY
- /**
- *
- * Replaces the current matrix with the identity matrix. The equivalent function
- * in OpenGL is glLoadIdentity().
- *
- *
- * @webref transform
- * @webBrief Replaces the current matrix with the identity matrix.
- * @see PGraphics#pushMatrix()
- * @see PGraphics#popMatrix()
- * @see PGraphics#applyMatrix(PMatrix)
- * @see PGraphics#printMatrix()
- */
+ /**
+ *
+ * Replaces the current matrix with the identity matrix. The equivalent function
+ * in OpenGL is glLoadIdentity().
+ *
+ *
+ * @webref transform
+ * @webBrief Replaces the current matrix with the identity matrix.
+ * @see PGraphics#pushMatrix()
+ * @see PGraphics#popMatrix()
+ * @see PGraphics#applyMatrix(PMatrix)
+ * @see PGraphics#printMatrix()
+ */
public void resetMatrix() {
showMethodWarning("resetMatrix");
}
@@ -6050,21 +6050,21 @@ public class PGraphics extends PImage implements PConstants {
// PROJECTION
- /**
- *
- * 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(-width/2, width/2, -height/2, height/2).
- *
- *
- * @webref lights_camera:camera
- * @webBrief Sets an orthographic projection and defines a parallel clipping
- * volume.
- */
+ /**
+ *
+ * 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(-width/2, width/2, -height/2, height/2).
+ *
+ *
+ * @webref lights_camera:camera
+ * @webBrief Sets an orthographic projection and defines a parallel clipping
+ * volume.
+ */
public void ortho() {
showMissingWarning("ortho");
}
@@ -6122,44 +6122,44 @@ public class PGraphics extends PImage implements PConstants {
showMissingWarning("perspective");
}
- /**
- *
- * Sets a perspective matrix as defined by the parameters.
- *
- * A frustum is a geometric form: a pyramid with its top cut off. With the
- * viewer's eye at the imaginary top of the pyramid, the six planes of the
- * frustum act as clipping planes when rendering a 3D view. Thus, any form
- * inside the clipping planes is rendered and visible; anything outside those
- * planes is not visible.
- *
- * Setting the frustum has the effect of changing the perspective with
- * which the scene is rendered. This can be achieved more simply in many cases
- * by using perspective().
- *
- * Note that the near value must be greater than zero (as the point of the
- * frustum "pyramid" cannot converge "behind" the viewer). Similarly, the far
- * value must be greater than the near value (as the "far" plane of the frustum
- * must be "farther away" from the viewer than the near plane).
- *
- * Works like glFrustum, except it wipes out the current perspective matrix
- * rather than multiplying itself with it.
- *
- *
- * @webref lights_camera:camera
- * @webBrief Sets a perspective matrix defined through the parameters.
- * @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; must be greater than zero
- * @param far far component of the clipping plane; must be greater than the
- * near value
- * @see PGraphics#camera(float, float, float, float, float, float, float, float,
- * float)
- * @see PGraphics#beginCamera()
- * @see PGraphics#endCamera()
- * @see PGraphics#perspective(float, float, float, float)
- */
+ /**
+ *
+ * Sets a perspective matrix as defined by the parameters.
+ *
+ * A frustum is a geometric form: a pyramid with its top cut off. With the
+ * viewer's eye at the imaginary top of the pyramid, the six planes of the
+ * frustum act as clipping planes when rendering a 3D view. Thus, any form
+ * inside the clipping planes is rendered and visible; anything outside those
+ * planes is not visible.
+ *
+ * Setting the frustum has the effect of changing the perspective with
+ * which the scene is rendered. This can be achieved more simply in many cases
+ * by using perspective().
+ *
+ * Note that the near value must be greater than zero (as the point of the
+ * frustum "pyramid" cannot converge "behind" the viewer). Similarly, the far
+ * value must be greater than the near value (as the "far" plane of the frustum
+ * must be "farther away" from the viewer than the near plane).
+ *
+ * Works like glFrustum, except it wipes out the current perspective matrix
+ * rather than multiplying itself with it.
+ *
+ *
+ * @webref lights_camera:camera
+ * @webBrief Sets a perspective matrix defined through the parameters.
+ * @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; must be greater than zero
+ * @param far far component of the clipping plane; must be greater than the
+ * near value
+ * @see PGraphics#camera(float, float, float, float, float, float, float, float,
+ * float)
+ * @see PGraphics#beginCamera()
+ * @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) {
@@ -6558,64 +6558,64 @@ public class PGraphics extends PImage implements PConstants {
// STROKE CAP/JOIN/WEIGHT
- /**
- *
- * Sets the width of the stroke used for lines, points, and the border around
- * shapes. All widths are set in units of pixels.
- *
- * Using point() with strokeWeight(1) or smaller may draw nothing to the screen,
- * depending on the graphics settings of the computer. Workarounds include
- * setting the pixel using set() or drawing the point using either
- * circle() or square().
- *
- *
- * @webref shape:attributes
- * @webBrief Sets the width of the stroke used for lines, points, and the border
- * around shapes.
- * @param weight the weight (in pixels) of the stroke
- * @see PGraphics#stroke(int, float)
- * @see PGraphics#strokeJoin(int)
- * @see PGraphics#strokeCap(int)
- */
+ /**
+ *
+ * Sets the width of the stroke used for lines, points, and the border around
+ * shapes. All widths are set in units of pixels.
+ *
+ * Using point() with strokeWeight(1) or smaller may draw nothing to the screen,
+ * depending on the graphics settings of the computer. Workarounds include
+ * setting the pixel using set() or drawing the point using either
+ * circle() or square().
+ *
+ *
+ * @webref shape:attributes
+ * @webBrief Sets the width of the stroke used for lines, points, and the border
+ * around shapes.
+ * @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) {
strokeWeight = weight;
}
- /**
- *
- * 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.
- *
- *
- * @webref shape:attributes
- * @webBrief Sets the style of the joints which connect line segments.
- * @param join either MITER, BEVEL, ROUND
- * @see PGraphics#stroke(int, float)
- * @see PGraphics#strokeWeight(float)
- * @see PGraphics#strokeCap(int)
- */
+ /**
+ *
+ * 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.
+ *
+ *
+ * @webref shape:attributes
+ * @webBrief Sets the style of the joints which connect line segments.
+ * @param join either MITER, BEVEL, ROUND
+ * @see PGraphics#stroke(int, float)
+ * @see PGraphics#strokeWeight(float)
+ * @see PGraphics#strokeCap(int)
+ */
public void strokeJoin(int join) {
strokeJoin = join;
}
- /**
- *
- * Sets the style for rendering line endings. These ends are either squared,
- * extended, or rounded, each of which specified with the corresponding
- * parameters: SQUARE, PROJECT, and ROUND. The default cap is ROUND.
- *
- * To make point() appear square, use strokeCap(PROJECT). Using
- * strokeCap(SQUARE) (no cap) causes points to become invisible.
- *
- * @webref shape:attributes
- * @webBrief Sets the style for rendering line endings.
- * @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)
- */
+ /**
+ *
+ * Sets the style for rendering line endings. These ends are either squared,
+ * extended, or rounded, each of which specified with the corresponding
+ * parameters: SQUARE, PROJECT, and ROUND. The default cap is ROUND.
+ *
+ * To make point() appear square, use strokeCap(PROJECT). Using
+ * strokeCap(SQUARE) (no cap) causes points to become invisible.
+ *
+ * @webref shape:attributes
+ * @webBrief Sets the style for rendering line endings.
+ * @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) {
strokeCap = cap;
}
@@ -6644,42 +6644,42 @@ public class PGraphics extends PImage implements PConstants {
}
- /**
- *
- * 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 or 0xFFCCFFAA).
- * The # syntax uses six digits to specify a color (just as colors are
- * typically 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 define the red, green, and blue components.
- *
- * The value for the gray parameter must be less than or equal to the current
- * maximum value as specified by colorMode(). The default maximum value
- * is 255.
- *
- * When drawing in 2D with the default renderer, you may need
- * hint(ENABLE_STROKE_PURE) to improve drawing quality (at the expense of
- * performance). See the hint() documentation for more details.
- *
- * @webref color:setting
- * @webBrief Sets the color used to draw lines and borders around shapes.
- * @param rgb color value in hexadecimal notation
- * @see PGraphics#noStroke()
- * @see PGraphics#strokeWeight(float)
- * @see PGraphics#strokeJoin(int)
- * @see PGraphics#strokeCap(int)
- * @see PGraphics#fill(int, float)
- * @see PGraphics#noFill()
- * @see PGraphics#tint(int, float)
- * @see PGraphics#background(float, float, float, float)
- * @see PGraphics#colorMode(int, float, float, float, float)
- */
+ /**
+ *
+ * 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 or 0xFFCCFFAA).
+ * The # syntax uses six digits to specify a color (just as colors are
+ * typically 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 define the red, green, and blue components.
+ *
+ * The value for the gray parameter must be less than or equal to the current
+ * maximum value as specified by colorMode(). The default maximum value
+ * is 255.
+ *
+ * When drawing in 2D with the default renderer, you may need
+ * hint(ENABLE_STROKE_PURE) to improve drawing quality (at the expense of
+ * performance). See the hint() documentation for more details.
+ *
+ * @webref color:setting
+ * @webBrief Sets the color used to draw lines and borders around shapes.
+ * @param rgb color value in hexadecimal notation
+ * @see PGraphics#noStroke()
+ * @see PGraphics#strokeWeight(float)
+ * @see PGraphics#strokeJoin(int)
+ * @see PGraphics#strokeCap(int)
+ * @see PGraphics#fill(int, float)
+ * @see PGraphics#noFill()
+ * @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) {
colorCalc(rgb);
strokeFromCalc();
@@ -6766,39 +6766,39 @@ public class PGraphics extends PImage implements PConstants {
}
- /**
- *
- * Sets the fill value for displaying images. Images can be tinted to specified
- * colors or made transparent by including an alpha value.
- *
- * To apply transparency to an image without affecting its color, use white as
- * the tint color and specify an alpha value. For instance, tint(255,
- * 128) will make an image 50% transparent (assuming the default alpha range
- * of 0-255, which can be changed with colorMode()).
- *
- * When using hexadecimal notation to specify a color, use "#" or
- * "0x" before the values (e.g., #CCFFAA or 0xFFCCFFAA).
- * The # syntax uses six digits to specify a color (just as colors are
- * typically 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 define the red, green, and blue components.
- *
- * The value for the gray parameter must be less than or equal to the current
- * maximum value as specified by colorMode(). The default maximum value
- * is 255.
- *
- * The tint() function is also used to control the coloring of textures
- * in 3D.
- *
- *
- * @webref image:loading_displaying
- * @webBrief Sets the fill value for displaying images.
- * @usage web_application
- * @param rgb color value in hexadecimal notation
- * @see PGraphics#noTint()
- * @see PGraphics#image(PImage, float, float, float, float)
- */
+ /**
+ *
+ * Sets the fill value for displaying images. Images can be tinted to specified
+ * colors or made transparent by including an alpha value.
+ *
+ * To apply transparency to an image without affecting its color, use white as
+ * the tint color and specify an alpha value. For instance, tint(255,
+ * 128) will make an image 50% transparent (assuming the default alpha range
+ * of 0-255, which can be changed with colorMode()).
+ *
+ * When using hexadecimal notation to specify a color, use "#" or
+ * "0x" before the values (e.g., #CCFFAA or 0xFFCCFFAA).
+ * The # syntax uses six digits to specify a color (just as colors are
+ * typically 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 define the red, green, and blue components.
+ *
+ * The value for the gray parameter must be less than or equal to the current
+ * maximum value as specified by colorMode(). The default maximum value
+ * is 255.
+ *
+ * The tint() function is also used to control the coloring of textures
+ * in 3D.
+ *
+ *
+ * @webref image:loading_displaying
+ * @webBrief Sets the fill value for displaying images.
+ * @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) {
colorCalc(rgb);
tintFromCalc();
@@ -7233,30 +7233,30 @@ public class PGraphics extends PImage implements PConstants {
showMethodWarning("noLights");
}
- /**
- *
- * Adds an ambient light. Ambient light doesn't come from a specific direction,
- * the rays of 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 v1, v2, and v3 parameters are
- * interpreted as either RGB or HSB values, depending on the current color mode.
- *
- *
- * @webref lights_camera:lights
- * @webBrief Adds an ambient light.
- * @usage web_application
- * @param v1 red or hue value (depending on current color mode)
- * @param v2 green or saturation value (depending on current color mode)
- * @param v3 blue or brightness value (depending on current color mode)
- * @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)
- */
+ /**
+ *
+ * Adds an ambient light. Ambient light doesn't come from a specific direction,
+ * the rays of 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 v1, v2, and v3 parameters are
+ * interpreted as either RGB or HSB values, depending on the current color mode.
+ *
+ *
+ * @webref lights_camera:lights
+ * @webBrief Adds an ambient light.
+ * @usage web_application
+ * @param v1 red or hue value (depending on current color mode)
+ * @param v2 green or saturation value (depending on current color mode)
+ * @param v3 blue or brightness value (depending on current color mode)
+ * @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 v1, float v2, float v3) {
showMethodWarning("ambientLight");
}
@@ -7305,70 +7305,70 @@ public class PGraphics extends PImage implements PConstants {
showMethodWarning("directionalLight");
}
- /**
- *
- * Adds a point light. 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 v1, v2, and v3 parameters are interpreted
- * as either RGB or HSB values, depending on the current color mode. The
- * x, y, and z parameters set the position of the light.
- *
- *
- * @webref lights_camera:lights
- * @webBrief Adds a point light.
- * @usage web_application
- * @param v1 red or hue value (depending on current color mode)
- * @param v2 green or saturation value (depending on current color mode)
- * @param v3 blue or brightness value (depending on current color mode)
- * @param x x-coordinate of the light
- * @param y y-coordinate of the light
- * @param z z-coordinate of the light
- * @see PGraphics#lights()
- * @see PGraphics#directionalLight(float, float, float, float, float, float)
- * @see PGraphics#ambientLight(float, float, float, float, float, float)
- * @see PGraphics#spotLight(float, float, float, float, float, float, float,
- * float, float, float, float)
- */
+ /**
+ *
+ * Adds a point light. 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 v1, v2, and v3 parameters are interpreted
+ * as either RGB or HSB values, depending on the current color mode. The
+ * x, y, and z parameters set the position of the light.
+ *
+ *
+ * @webref lights_camera:lights
+ * @webBrief Adds a point light.
+ * @usage web_application
+ * @param v1 red or hue value (depending on current color mode)
+ * @param v2 green or saturation value (depending on current color mode)
+ * @param v3 blue or brightness value (depending on current color mode)
+ * @param x x-coordinate of the light
+ * @param y y-coordinate of the light
+ * @param z z-coordinate of the light
+ * @see PGraphics#lights()
+ * @see PGraphics#directionalLight(float, float, float, float, float, float)
+ * @see PGraphics#ambientLight(float, float, float, float, float, float)
+ * @see PGraphics#spotLight(float, float, float, float, float, float, float,
+ * float, float, float, float)
+ */
public void pointLight(float v1, float v2, float v3,
float x, float y, float z) {
showMethodWarning("pointLight");
}
- /**
- *
- * Adds a spot light. 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 v1, v2, and v3 parameters are interpreted
- * as either RGB or HSB values, depending on the current color mode. The
- * x, y, and z parameters specify the position of the light
- * and nx, ny, nz specify the direction of light. The
- * angle parameter affects angle of the spotlight cone, while
- * concentration sets the bias of light focusing toward the center of
- * that cone.
- *
- * @webref lights_camera:lights
- * @webBrief Adds a spot light.
- * @usage web_application
- * @param v1 red or hue value (depending on current color mode)
- * @param v2 green or saturation value (depending on current color
- * mode)
- * @param v3 blue or brightness value (depending on current color
- * mode)
- * @param x x-coordinate of the light
- * @param y y-coordinate of the light
- * @param z z-coordinate of the light
- * @param nx direction along the x axis
- * @param ny direction along the y axis
- * @param nz direction along the z axis
- * @param angle angle of the spotlight cone
- * @param concentration exponent determining the center bias of the cone
- * @see PGraphics#lights()
- * @see PGraphics#directionalLight(float, float, float, float, float, float)
- * @see PGraphics#pointLight(float, float, float, float, float, float)
- * @see PGraphics#ambientLight(float, float, float, float, float, float)
- */
+ /**
+ *
+ * Adds a spot light. 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 v1, v2, and v3 parameters are interpreted
+ * as either RGB or HSB values, depending on the current color mode. The
+ * x, y, and z parameters specify the position of the light
+ * and nx, ny, nz specify the direction of light. The
+ * angle parameter affects angle of the spotlight cone, while
+ * concentration sets the bias of light focusing toward the center of
+ * that cone.
+ *
+ * @webref lights_camera:lights
+ * @webBrief Adds a spot light.
+ * @usage web_application
+ * @param v1 red or hue value (depending on current color mode)
+ * @param v2 green or saturation value (depending on current color
+ * mode)
+ * @param v3 blue or brightness value (depending on current color
+ * mode)
+ * @param x x-coordinate of the light
+ * @param y y-coordinate of the light
+ * @param z z-coordinate of the light
+ * @param nx direction along the x axis
+ * @param ny direction along the y axis
+ * @param nz direction along the z axis
+ * @param angle angle of the spotlight cone
+ * @param concentration exponent determining the center bias of the cone
+ * @see PGraphics#lights()
+ * @see PGraphics#directionalLight(float, float, float, float, float, float)
+ * @see PGraphics#pointLight(float, float, float, float, float, float)
+ * @see PGraphics#ambientLight(float, float, float, float, float, float)
+ */
public void spotLight(float v1, float v2, float v3,
float x, float y, float z,
float nx, float ny, float nz,
@@ -7376,38 +7376,38 @@ public class PGraphics extends PImage implements PConstants {
showMethodWarning("spotLight");
}
- /**
- *
- * Sets the falloff rates for point lights, spot lights, and ambient lights.
- * Like fill(), it affects only the elements which are created after it
- * in the code. The default value is lightFalloff(1.0, 0.0, 0.0), and the
- * parameters are used to calculate the falloff with the following
- * equation:
- *
- * d = distance from light position to vertex position
- * falloff = 1 / (CONSTANT + d * LINEAR + (d*d) * QUADRATIC)
- *
- * Thinking about an ambient light with a falloff can be tricky. If you want a
- * region of your scene to be lit ambiently with one color and another region to
- * be lit ambiently with another color, you could use an ambient light with
- * location and falloff. You can think of it as a point light that doesn't care
- * which direction a surface is facing.
- *
- *
- * @webref lights_camera:lights
- * @webBrief Sets the falloff rates for point lights, spot lights, and ambient
- * lights.
- * @usage web_application
- * @param constant constant value or determining falloff
- * @param linear linear value for determining falloff
- * @param quadratic quadratic value for determining falloff
- * @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)
- * @see PGraphics#lightSpecular(float, float, float)
- */
+ /**
+ *
+ * Sets the falloff rates for point lights, spot lights, and ambient lights.
+ * Like fill(), it affects only the elements which are created after it
+ * in the code. The default value is lightFalloff(1.0, 0.0, 0.0), and the
+ * parameters are used to calculate the falloff with the following
+ * equation:
+ *
+ * d = distance from light position to vertex position
+ * falloff = 1 / (CONSTANT + d * LINEAR + (d*d) * QUADRATIC)
+ *
+ * Thinking about an ambient light with a falloff can be tricky. If you want a
+ * region of your scene to be lit ambiently with one color and another region to
+ * be lit ambiently with another color, you could use an ambient light with
+ * location and falloff. You can think of it as a point light that doesn't care
+ * which direction a surface is facing.
+ *
+ *
+ * @webref lights_camera:lights
+ * @webBrief Sets the falloff rates for point lights, spot lights, and ambient
+ * lights.
+ * @usage web_application
+ * @param constant constant value or determining falloff
+ * @param linear linear value for determining falloff
+ * @param quadratic quadratic value for determining falloff
+ * @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)
+ * @see PGraphics#lightSpecular(float, float, float)
+ */
public void lightFalloff(float constant, float linear, float quadratic) {
showMethodWarning("lightFalloff");
}
@@ -7446,49 +7446,49 @@ public class PGraphics extends PImage implements PConstants {
// BACKGROUND
- /**
- *
- * The background() function sets the color used for the background of
- * the Processing window. The default background is light gray. This function is
- * typically used within draw() to clear the display window at the
- * beginning of each frame, but it can be used inside setup() to set the
- * background on the first frame of animation or if the backgound need only be
- * set once.
- *
- * An image can also be used as the background for a sketch, although the
- * image's width and height must match that of the sketch window. Images used
- * with background() will ignore the current tint() setting. To
- * resize an image to the size of the sketch window, use image.resize(width,
- * height).
- *
- * It is not possible to use the transparency alpha parameter with
- * background colors on the main drawing surface. It can only be used along with
- * a PGraphics object and createGraphics().
- *
- *
- *
Advanced
- *
- * Clear the background with a color that includes an alpha value. This can only
- * be used with objects created by createGraphics(), because the main drawing
- * surface cannot be set transparent.
- *
- *
- * It might be tempting to use this function to partially clear the screen on
- * each frame, however that's not how this function works. When calling
- * background(), the pixels will be replaced with pixels that have that level of
- * transparency. To do a semi-transparent overlay, use fill() with alpha and
- * draw a rectangle.
- *
- *
- * @webref color:setting
- * @webBrief Sets the color used for the background of the Processing window.
- * @usage web_application
- * @param rgb any value of the color datatype
- * @see PGraphics#stroke(float)
- * @see PGraphics#fill(float)
- * @see PGraphics#tint(float)
- * @see PGraphics#colorMode(int)
- */
+ /**
+ *
+ * The background() function sets the color used for the background of
+ * the Processing window. The default background is light gray. This function is
+ * typically used within draw() to clear the display window at the
+ * beginning of each frame, but it can be used inside setup() to set the
+ * background on the first frame of animation or if the backgound need only be
+ * set once.
+ *
+ * An image can also be used as the background for a sketch, although the
+ * image's width and height must match that of the sketch window. Images used
+ * with background() will ignore the current tint() setting. To
+ * resize an image to the size of the sketch window, use image.resize(width,
+ * height).
+ *
+ * It is not possible to use the transparency alpha parameter with
+ * background colors on the main drawing surface. It can only be used along with
+ * a PGraphics object and createGraphics().
+ *
+ *
+ *
Advanced
+ *
+ * Clear the background with a color that includes an alpha value. This can only
+ * be used with objects created by createGraphics(), because the main drawing
+ * surface cannot be set transparent.
+ *
+ *
+ * It might be tempting to use this function to partially clear the screen on
+ * each frame, however that's not how this function works. When calling
+ * background(), the pixels will be replaced with pixels that have that level of
+ * transparency. To do a semi-transparent overlay, use fill() with alpha and
+ * draw a rectangle.
+ *
+ *
+ * @webref color:setting
+ * @webBrief Sets the color used for the background of the Processing window.
+ * @usage web_application
+ * @param rgb 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 (((rgb & 0xff000000) == 0) && (rgb <= colorModeX)) {
// background((float) rgb);
@@ -7686,36 +7686,36 @@ public class PGraphics extends PImage implements PConstants {
// COLOR MODE
- /**
- *
- * 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
- * max, max1, max2, max3, and maxA.
- *
- * After changing the range of values for colors with code like
- * colorMode(HSB, 360, 100, 100), those ranges remain in use until they
- * are explicitly changed again. For example, after running colorMode(HSB,
- * 360, 100, 100) and then changing back to colorMode(RGB), the range
- * for R will be 0 to 360 and the range for G and B will be 0 to 100. To avoid
- * this, be explicit about the ranges when changing the color mode. For
- * instance, instead of colorMode(RGB), write colorMode(RGB, 255, 255,
- * 255).
- *
- *
- * @webref color:setting
- * @webBrief Changes the way Processing interprets color data.
- * @usage web_application
- * @param mode Either RGB or HSB, corresponding to Red/Green/Blue and
- * Hue/Saturation/Brightness
- * @see PGraphics#background(float)
- * @see PGraphics#fill(float)
- * @see PGraphics#stroke(float)
- */
+ /**
+ *
+ * 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
+ * max, max1, max2, max3, and maxA.
+ *
+ * After changing the range of values for colors with code like
+ * colorMode(HSB, 360, 100, 100), those ranges remain in use until they
+ * are explicitly changed again. For example, after running colorMode(HSB,
+ * 360, 100, 100) and then changing back to colorMode(RGB), the range
+ * for R will be 0 to 360 and the range for G and B will be 0 to 100. To avoid
+ * this, be explicit about the ranges when changing the color mode. For
+ * instance, instead of colorMode(RGB), write colorMode(RGB, 255, 255,
+ * 255).
+ *
+ *
+ * @webref color:setting
+ * @webBrief Changes the way Processing interprets color data.
+ * @usage web_application
+ * @param mode Either RGB or HSB, corresponding to Red/Green/Blue and
+ * Hue/Saturation/Brightness
+ * @see PGraphics#background(float)
+ * @see PGraphics#fill(float)
+ * @see PGraphics#stroke(float)
+ */
public void colorMode(int mode) {
colorMode(mode, colorModeX, colorModeY, colorModeZ, colorModeA);
}
@@ -8062,39 +8062,39 @@ public class PGraphics extends PImage implements PConstants {
}
- /**
- *
- * Extracts the red value from a color, scaled to match current
- * colorMode(). The 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 understand, but it is slower
- * than a technique called bit shifting. When working in colorMode(RGB,
- * 255), you can acheive the same results as red() but with greater
- * speed by using the right shift operator (>>) with a bit mask. For
- * example, the following two lines of code are equivalent means of getting the
- * red value of the color value c:
- *
- *
- *
- * float r1 = red(c); // Simpler, but slower to calculate
- * float r2 = c >> 16 & 0xFF; // Very fast to calculate
- *
- *
- *
- * @webref color:creating_reading
- * @webBrief Extracts the red value from a color, scaled to match current
- * colorMode().
- * @usage web_application
- * @param rgb any value of the color datatype
- * @see PGraphics#green(int)
- * @see PGraphics#blue(int)
- * @see PGraphics#alpha(int)
- * @see PGraphics#hue(int)
- * @see PGraphics#saturation(int)
- * @see PGraphics#brightness(int)
- * @see_external rightshift
- */
+ /**
+ *
+ * Extracts the red value from a color, scaled to match current
+ * colorMode(). The 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 understand, but it is slower
+ * than a technique called bit shifting. When working in colorMode(RGB,
+ * 255), you can acheive the same results as red() but with greater
+ * speed by using the right shift operator (>>) with a bit mask. For
+ * example, the following two lines of code are equivalent means of getting the
+ * red value of the color value c:
+ *
+ *
+ *
+ * float r1 = red(c); // Simpler, but slower to calculate
+ * float r2 = c >> 16 & 0xFF; // Very fast to calculate
+ *
+ *
+ *
+ * @webref color:creating_reading
+ * @webBrief Extracts the red value from a color, scaled to match current
+ * colorMode().
+ * @usage web_application
+ * @param rgb any value of the color datatype
+ * @see PGraphics#green(int)
+ * @see PGraphics#blue(int)
+ * @see PGraphics#alpha(int)
+ * @see PGraphics#hue(int)
+ * @see PGraphics#saturation(int)
+ * @see PGraphics#brightness(int)
+ * @see_external rightshift
+ */
public final float red(int rgb) {
float c = (rgb >> 16) & 0xff;
if (colorModeDefault) return c;
@@ -8102,39 +8102,39 @@ public class PGraphics extends PImage implements PConstants {
}
- /**
- *
- * Extracts the green value from a color, scaled to match current
- * colorMode(). The value is always returned as a float, so be careful
- * not to assign it to an int value.
- *
- * The green() function is easy to use and understand, but it is slower
- * than a technique called bit shifting. When working in colorMode(RGB,
- * 255), you can acheive the same results as green() but with greater
- * speed by using the right shift operator (>>) with a bit mask. For
- * example, the following two lines of code are equivalent means of getting the
- * green value of the color value c:
- *
- *
- *
- * float g1 = green(c); // Simpler, but slower to calculate
- * float g2 = c >> 8 & 0xFF; // Very fast to calculate
- *
- *
- *
- * @webref color:creating_reading
- * @webBrief Extracts the green value from a color, scaled to match current
- * colorMode().
- * @usage web_application
- * @param rgb any value of the color datatype
- * @see PGraphics#red(int)
- * @see PGraphics#blue(int)
- * @see PGraphics#alpha(int)
- * @see PGraphics#hue(int)
- * @see PGraphics#saturation(int)
- * @see PGraphics#brightness(int)
- * @see_external rightshift
- */
+ /**
+ *
+ * Extracts the green value from a color, scaled to match current
+ * colorMode(). The value is always returned as a float, so be careful
+ * not to assign it to an int value.
+ *
+ * The green() function is easy to use and understand, but it is slower
+ * than a technique called bit shifting. When working in colorMode(RGB,
+ * 255), you can acheive the same results as green() but with greater
+ * speed by using the right shift operator (>>) with a bit mask. For
+ * example, the following two lines of code are equivalent means of getting the
+ * green value of the color value c:
+ *
+ *
+ *
+ * float g1 = green(c); // Simpler, but slower to calculate
+ * float g2 = c >> 8 & 0xFF; // Very fast to calculate
+ *
+ *
+ *
+ * @webref color:creating_reading
+ * @webBrief Extracts the green value from a color, scaled to match current
+ * colorMode().
+ * @usage web_application
+ * @param rgb any value of the color datatype
+ * @see PGraphics#red(int)
+ * @see PGraphics#blue(int)
+ * @see PGraphics#alpha(int)
+ * @see PGraphics#hue(int)
+ * @see PGraphics#saturation(int)
+ * @see PGraphics#brightness(int)
+ * @see_external rightshift
+ */
public final float green(int rgb) {
float c = (rgb >> 8) & 0xff;
if (colorModeDefault) return c;
@@ -8142,39 +8142,39 @@ public class PGraphics extends PImage implements PConstants {
}
- /**
- *
- * Extracts the blue value from a color, scaled to match current
- * colorMode(). The value is always returned as a float, so be careful
- * not to assign it to an int value.
- *
- * The blue() function is easy to use and understand, but it is slower
- * than a technique called bit masking. When working in colorMode(RGB,
- * 255), you can acheive the same results as blue() but with greater
- * speed by using a bit mask to remove the other color components. For example,
- * the following two lines of code are equivalent means of getting the blue
- * value of the color value c:
- *
- *
- *
- * float b1 = blue(c); // Simpler, but slower to calculate
- * float b2 = c & 0xFF; // Very fast to calculate
- *
- *
- *
- * @webref color:creating_reading
- * @webBrief Extracts the blue value from a color, scaled to match current
- * colorMode().
- * @usage web_application
- * @param rgb any value of the color datatype
- * @see PGraphics#red(int)
- * @see PGraphics#green(int)
- * @see PGraphics#alpha(int)
- * @see PGraphics#hue(int)
- * @see PGraphics#saturation(int)
- * @see PGraphics#brightness(int)
- * @see_external rightshift
- */
+ /**
+ *
+ * Extracts the blue value from a color, scaled to match current
+ * colorMode(). The value is always returned as a float, so be careful
+ * not to assign it to an int value.
+ *
+ * The blue() function is easy to use and understand, but it is slower
+ * than a technique called bit masking. When working in colorMode(RGB,
+ * 255), you can acheive the same results as blue() but with greater
+ * speed by using a bit mask to remove the other color components. For example,
+ * the following two lines of code are equivalent means of getting the blue
+ * value of the color value c:
+ *
+ *
+ *
+ * float b1 = blue(c); // Simpler, but slower to calculate
+ * float b2 = c & 0xFF; // Very fast to calculate
+ *
+ *
+ *
+ * @webref color:creating_reading
+ * @webBrief Extracts the blue value from a color, scaled to match current
+ * colorMode().
+ * @usage web_application
+ * @param rgb any value of the color datatype
+ * @see PGraphics#red(int)
+ * @see PGraphics#green(int)
+ * @see PGraphics#alpha(int)
+ * @see PGraphics#hue(int)
+ * @see PGraphics#saturation(int)
+ * @see PGraphics#brightness(int)
+ * @see_external rightshift
+ */
public final float blue(int rgb) {
float c = (rgb) & 0xff;
if (colorModeDefault) return c;
@@ -8266,29 +8266,29 @@ public class PGraphics extends PImage implements PConstants {
// Against our better judgement.
- /**
- *
- * Calculates a color between two colors at a specific increment. The amt
- * parameter is the amount to interpolate between the two values where 0.0 is
- * equal to the first point, 0.1 is very near the first point, 0.5 is halfway in
- * between, etc.
- * An amount below 0 will be treated as 0. Likewise, amounts above 1 will be
- * capped at 1. This is different from the behavior of lerp(), but necessary
- * because otherwise numbers outside the range will produce strange and
- * unexpected colors.
- *
- *
- * @webref color:creating_reading
- * @webBrief Calculates a color or colors between two color at a specific
- * increment.
- * @usage web_application
- * @param c1 interpolate from this color
- * @param c2 interpolate to this color
- * @param amt between 0.0 and 1.0
- * @see PImage#blendColor(int, int, int)
- * @see PGraphics#color(float, float, float, float)
- * @see PApplet#lerp(float, float, float)
- */
+ /**
+ *
+ * Calculates a color between two colors at a specific increment. The amt
+ * parameter is the amount to interpolate between the two values where 0.0 is
+ * equal to the first point, 0.1 is very near the first point, 0.5 is halfway in
+ * between, etc.
+ * An amount below 0 will be treated as 0. Likewise, amounts above 1 will be
+ * capped at 1. This is different from the behavior of lerp(), but necessary
+ * because otherwise numbers outside the range will produce strange and
+ * unexpected colors.
+ *
+ *
+ * @webref color:creating_reading
+ * @webBrief Calculates a color or colors between two color at a specific
+ * increment.
+ * @usage web_application
+ * @param c1 interpolate from this color
+ * @param c2 interpolate to this color
+ * @param amt between 0.0 and 1.0
+ * @see PImage#blendColor(int, int, int)
+ * @see PGraphics#color(float, float, float, float)
+ * @see PApplet#lerp(float, float, float)
+ */
public int lerpColor(int c1, int c2, float amt) { // ignore
return lerpColor(c1, c2, amt, colorMode);
}
diff --git a/core/src/processing/core/PImage.java b/core/src/processing/core/PImage.java
index bc84d44cd..34cb6c146 100644
--- a/core/src/processing/core/PImage.java
+++ b/core/src/processing/core/PImage.java
@@ -81,24 +81,24 @@ public class PImage implements PConstants, Cloneable {
*/
public int format;
- /**
- *
- * The pixels[] array contains the values for all the pixels in the image. These
- * values are of the color datatype. This array is the size of the image,
- * meaning if the image is 100 x 100 pixels, there will be 10,000 values and if
- * the window is 200 x 300 pixels, there will be 60,000 values.
- *
- * Before accessing this array, the data must loaded with the
- * loadPixels() method. Failure to do so may result in a
- * NullPointerException. After the array data has been modified, the
- * updatePixels() method must be run to update the content of the display
- * window.
- *
- *
- * @webref image:pixels
- * @webBrief Array containing the color of every pixel in the image.
- * @usage web_application
- */
+ /**
+ *
+ * The pixels[] array contains the values for all the pixels in the image. These
+ * values are of the color datatype. This array is the size of the image,
+ * meaning if the image is 100 x 100 pixels, there will be 10,000 values and if
+ * the window is 200 x 300 pixels, there will be 60,000 values.
+ *
+ * Before accessing this array, the data must loaded with the
+ * loadPixels() method. Failure to do so may result in a
+ * NullPointerException. After the array data has been modified, the
+ * updatePixels() method must be run to update the content of the display
+ * window.
+ *
+ *
+ * @webref image:pixels
+ * @webBrief Array containing the color of every pixel in the image.
+ * @usage web_application
+ */
public int[] pixels;
/** 1 for most images, 2 for hi-dpi/retina */
@@ -373,23 +373,23 @@ public class PImage implements PConstants, Cloneable {
}
- /**
- *
- * Loads the pixel data of the current display window into the pixels[]
- * array. This function must always be called before reading from or writing to
- * pixels[]. Subsequent changes to the display window will not be
- * reflected in pixels until loadPixels() is called again.
- *
- *
- *
Advanced
Call this when you want to mess with the pixels[] array.
- *
- * For subclasses where the pixels[] buffer isn't set by default, this should
- * copy all data into the pixels[] array
- *
- * @webref pimage:pixels
- * @webBrief Loads the pixel data for the image into its pixels[] array.
- * @usage web_application
- */
+ /**
+ *
+ * Loads the pixel data of the current display window into the pixels[]
+ * array. This function must always be called before reading from or writing to
+ * pixels[]. Subsequent changes to the display window will not be
+ * reflected in pixels until loadPixels() is called again.
+ *
+ *
+ *
Advanced
Call this when you want to mess with the pixels[] array.
+ *
+ * For subclasses where the pixels[] buffer isn't set by default, this should
+ * copy all data into the pixels[] array
+ *
+ * @webref pimage:pixels
+ * @webBrief Loads the pixel data for the image into its pixels[] array.
+ * @usage web_application
+ */
public void loadPixels() { // ignore
if (pixels == null || pixels.length != pixelWidth*pixelHeight) {
pixels = new int[pixelWidth*pixelHeight];
@@ -403,26 +403,26 @@ public class PImage implements PConstants, Cloneable {
}
- /**
- *
- * Updates the display window with the data in the pixels[] array. Use in
- * conjunction with loadPixels(). If you're only reading pixels from the
- * array, there's no need to call updatePixels() — updating is only
- * necessary to apply changes.
- *
- *
Advanced
Mark the pixels in this region as needing an update. This
- * is not currently used by any of the renderers, however the api is structured
- * this way in the hope of being able to use this to speed things up in the
- * future.
- *
- * @webref pimage:pixels
- * @webBrief Updates the image with the data in its pixels[] array.
- * @usage web_application
- * @param x x-coordinate of the upper-left corner
- * @param y y-coordinate of the upper-left corner
- * @param w width
- * @param h height
- */
+ /**
+ *
+ * Updates the display window with the data in the pixels[] array. Use in
+ * conjunction with loadPixels(). If you're only reading pixels from the
+ * array, there's no need to call updatePixels() — updating is only
+ * necessary to apply changes.
+ *
+ *
Advanced
Mark the pixels in this region as needing an update. This
+ * is not currently used by any of the renderers, however the api is structured
+ * this way in the hope of being able to use this to speed things up in the
+ * future.
+ *
+ * @webref pimage:pixels
+ * @webBrief Updates the image with the data in its pixels[] array.
+ * @usage web_application
+ * @param x x-coordinate of the upper-left corner
+ * @param y y-coordinate of the upper-left corner
+ * @param w width
+ * @param h height
+ */
public void updatePixels(int x, int y, int w, int h) { // ignore
int x2 = x + w;
int y2 = y + h;
@@ -911,67 +911,67 @@ public class PImage implements PConstants, Cloneable {
}
- /**
- *
- * Filters the 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 parameter 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. No parameter is
- * used.
- *
- * OPAQUE
- * Sets the alpha channel to entirely opaque. No parameter is used.
- *
- * INVERT
- * Sets each pixel to its inverse value. No parameter is used.
- *
- * POSTERIZE
- * Limits each channel of the image to the number of colors specified as the
- * parameter. The parameter can be set to values between 2 and 255, but results
- * are most noticeable in the lower ranges.
- *
- * BLUR
- * Executes a Gaussian blur with the level parameter specifying the extent of
- * the blurring. If no parameter is used, the blur is equivalent to Gaussian
- * blur of radius 1. Larger values increase the blur.
- *
- * ERODE
- * Reduces the light areas. No parameter is used.
- *
- * DILATE
- * Increases the light areas. No parameter is used.
- *
- *
- *
Advanced
Method to apply a variety of basic filters to this image.
- *
- *
- *
filter(BLUR) provides a basic blur.
- *
filter(GRAY) converts the image to grayscale based on luminance.
- *
filter(INVERT) will invert the color components in the image.
- *
filter(OPAQUE) set all the high bits in the image to opaque
- *
filter(THRESHOLD) converts the image to black and white.
- *
filter(DILATE) grow white/light areas
- *
filter(ERODE) shrink white/light areas
- *
- * Luminance conversion code contributed by
- * toxi
- *
- * Gaussian blur code contributed by
- * Mario Klingemann
- *
- * @webref image:pixels
- * @webBrief Converts the image to grayscale or black and white
- * @usage web_application
- * @param kind Either THRESHOLD, GRAY, OPAQUE, INVERT, POSTERIZE, BLUR, ERODE,
- * or DILATE
- * @param param unique for each, see above
- */
+ /**
+ *
+ * Filters the 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 parameter 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. No parameter is
+ * used.
+ *
+ * OPAQUE
+ * Sets the alpha channel to entirely opaque. No parameter is used.
+ *
+ * INVERT
+ * Sets each pixel to its inverse value. No parameter is used.
+ *
+ * POSTERIZE
+ * Limits each channel of the image to the number of colors specified as the
+ * parameter. The parameter can be set to values between 2 and 255, but results
+ * are most noticeable in the lower ranges.
+ *
+ * BLUR
+ * Executes a Gaussian blur with the level parameter specifying the extent of
+ * the blurring. If no parameter is used, the blur is equivalent to Gaussian
+ * blur of radius 1. Larger values increase the blur.
+ *
+ * ERODE
+ * Reduces the light areas. No parameter is used.
+ *
+ * DILATE
+ * Increases the light areas. No parameter is used.
+ *
+ *
+ *
Advanced
Method to apply a variety of basic filters to this image.
+ *
+ *
+ *
filter(BLUR) provides a basic blur.
+ *
filter(GRAY) converts the image to grayscale based on luminance.
+ *
filter(INVERT) will invert the color components in the image.
+ *
filter(OPAQUE) set all the high bits in the image to opaque
+ *
filter(THRESHOLD) converts the image to black and white.
+ *
filter(DILATE) grow white/light areas
+ *
filter(ERODE) shrink white/light areas
+ *
+ * Luminance conversion code contributed by
+ * toxi
+ *
+ * Gaussian blur code contributed by
+ * Mario Klingemann
+ *
+ * @webref image:pixels
+ * @webBrief Converts the image to grayscale or black and white
+ * @usage web_application
+ * @param kind Either THRESHOLD, GRAY, OPAQUE, INVERT, POSTERIZE, BLUR, ERODE,
+ * or DILATE
+ * @param param unique for each, see above
+ */
public void filter(int kind, float param) {
loadPixels();
diff --git a/core/src/processing/core/PShape.java b/core/src/processing/core/PShape.java
index 568f9a863..98329f92f 100644
--- a/core/src/processing/core/PShape.java
+++ b/core/src/processing/core/PShape.java
@@ -398,41 +398,41 @@ public class PShape implements PConstants {
return name;
}
- /**
- *
- * Returns a boolean value "true" if the image is set to be visible, "false" if
- * not. This value can be modified with the setVisible() method.
- *
- * The default visibility of a shape is usually controlled by whatever program
- * created the SVG file. For instance, this parameter is controlled by showing
- * or hiding the shape in the layers palette in Adobe Illustrator.
- *
- * @webref pshape:method
- * @usage web_application
- * @webBrief Returns a boolean value "true" if the image is set to be visible,
- * "false" if not
- * @see PShape#setVisible(boolean)
- */
+ /**
+ *
+ * Returns a boolean value "true" if the image is set to be visible, "false" if
+ * not. This value can be modified with the setVisible() method.
+ *
+ * The default visibility of a shape is usually controlled by whatever program
+ * created the SVG file. For instance, this parameter is controlled by showing
+ * or hiding the shape in the layers palette in Adobe Illustrator.
+ *
+ * @webref pshape:method
+ * @usage web_application
+ * @webBrief Returns a boolean value "true" if the image is set to be visible,
+ * "false" if not
+ * @see PShape#setVisible(boolean)
+ */
public boolean isVisible() {
return visible;
}
- /**
- *
- * Sets the shape to be visible or invisible. This is determined by the value of
- * the visible parameter.
- *
- * The default visibility of a shape is usually controlled by whatever program
- * created the SVG file. For instance, this parameter is controlled by showing
- * or hiding the shape in the layers palette in Adobe Illustrator.
- *
- * @webref pshape:mathod
- * @usage web_application
- * @webBrief Sets the shape to be visible or invisible
- * @param visible "false" makes the shape invisible and "true" makes it visible
- * @see PShape#isVisible()
- */
+ /**
+ *
+ * Sets the shape to be visible or invisible. This is determined by the value of
+ * the visible parameter.
+ *
+ * The default visibility of a shape is usually controlled by whatever program
+ * created the SVG file. For instance, this parameter is controlled by showing
+ * or hiding the shape in the layers palette in Adobe Illustrator.
+ *
+ * @webref pshape:method
+ * @usage web_application
+ * @webBrief Sets the shape to be visible or invisible
+ * @param visible "false" makes the shape invisible and "true" makes it visible
+ * @see PShape#isVisible()
+ */
public void setVisible(boolean visible) {
this.visible = visible;
}
diff --git a/core/src/processing/core/PVector.java b/core/src/processing/core/PVector.java
index 8d3d5f180..08555966d 100644
--- a/core/src/processing/core/PVector.java
+++ b/core/src/processing/core/PVector.java
@@ -196,18 +196,18 @@ public class PVector implements Serializable {
}
- /**
- *
- * Returns a new 2D unit vector with a random direction. If you pass in
- * this as an argument, it will use the PApplet's random number
- * generator.
- *
- * @webref pvector:method
- * @usage web_application
- * @return the random PVector
- * @webBrief Make a new 2D unit vector with a random direction.
- * @see PVector#random3D()
- */
+ /**
+ *
+ * Returns a new 2D unit vector with a random direction. If you pass in
+ * this as an argument, it will use the PApplet's random number
+ * generator.
+ *
+ * @webref pvector:method
+ * @usage web_application
+ * @return the random PVector
+ * @webBrief Make a new 2D unit vector with a random direction.
+ * @see PVector#random3D()
+ */
static public PVector random2D() {
return random2D(null, null);
}
@@ -246,18 +246,18 @@ public class PVector implements Serializable {
}
- /**
- *
- * Returns a new 3D unit vector with a random direction. If you pass in
- * this as an argument, it will use the PApplet's random number
- * generator.
- *
- * @webref pvector:method
- * @usage web_application
- * @return the random PVector
- * @webBrief Make a new 3D unit vector with a random direction.
- * @see PVector#random2D()
- */
+ /**
+ *
+ * Returns a new 3D unit vector with a random direction. If you pass in
+ * this as an argument, it will use the PApplet's random number
+ * generator.
+ *
+ * @webref pvector:method
+ * @usage web_application
+ * @return the random PVector
+ * @webBrief Make a new 3D unit vector with a random direction.
+ * @see PVector#random2D()
+ */
static public PVector random3D() {
return random3D(null, null);
}
@@ -887,32 +887,32 @@ public class PVector implements Serializable {
}
- /**
- *
- * Calculates linear interpolation from one vector to another vector. (Just like
- * regular lerp(), but for vectors.)
- *
- * Note that there is one static version of this method, and two
- * non-static versions. The static version, lerp(v1, v2, amt) is
- * given the two vectors to interpolate and returns a new PVector object. The
- * static version is used by referencing the PVector class directly. (See the
- * middle example above.) The non-static versions, lerp(v, amt) and
- * lerp(x, y, z, amt), do not create a new PVector, but transform the
- * values of the PVector on which they are called. These non-static versions
- * perform the same operation, but the former takes another vector as input,
- * while the latter takes three float values. (See the top and bottom examples
- * above, respectively.)
- *
- *
- * @webref pvector:method
- * @usage web_application
- * @webBrief Linear interpolate the vector to another vector
- * @param v the vector to lerp to
- * @param amt The amount of interpolation; some value between 0.0 (old vector)
- * and 1.0 (new vector). 0.1 is very near the old vector; 0.5 is
- * halfway in between.
- * @see PApplet#lerp(float, float, float)
- */
+ /**
+ *
+ * Calculates linear interpolation from one vector to another vector. (Just like
+ * regular lerp(), but for vectors.)
+ *
+ * Note that there is one static version of this method, and two
+ * non-static versions. The static version, lerp(v1, v2, amt) is
+ * given the two vectors to interpolate and returns a new PVector object. The
+ * static version is used by referencing the PVector class directly. (See the
+ * middle example above.) The non-static versions, lerp(v, amt) and
+ * lerp(x, y, z, amt), do not create a new PVector, but transform the
+ * values of the PVector on which they are called. These non-static versions
+ * perform the same operation, but the former takes another vector as input,
+ * while the latter takes three float values. (See the top and bottom examples
+ * above, respectively.)
+ *
+ *
+ * @webref pvector:method
+ * @usage web_application
+ * @webBrief Linear interpolate the vector to another vector
+ * @param v the vector to lerp to
+ * @param amt The amount of interpolation; some value between 0.0 (old vector)
+ * and 1.0 (new vector). 0.1 is very near the old vector; 0.5 is
+ * halfway in between.
+ * @see PApplet#lerp(float, float, float)
+ */
public PVector lerp(PVector v, float amt) {
x = PApplet.lerp(x, v.x, amt);
y = PApplet.lerp(y, v.y, amt);
diff --git a/core/src/processing/data/FloatDict.java b/core/src/processing/data/FloatDict.java
index 4362c01e8..3dbd639a7 100644
--- a/core/src/processing/data/FloatDict.java
+++ b/core/src/processing/data/FloatDict.java
@@ -260,13 +260,13 @@ public class FloatDict {
}
- /**
- * Return a copy of the internal keys array. In contrast to the keys()
- * method, this array can be modified.
- *
- * @webref floatdict:method
- * @webBrief Return a copy of the internal keys array
- */
+ /**
+ * Return a copy of the internal keys array. In contrast to the keys()
+ * method, this array can be modified.
+ *
+ * @webref floatdict:method
+ * @webBrief Return a copy of the internal keys array
+ */
public String[] keyArray() {
crop();
return keyArray(null);
@@ -324,16 +324,16 @@ public class FloatDict {
}
- /**
- * The version of this method without a parameter creates a new array and copies
- * each of the values into it. The version with the float[] parameters
- * fills an already-allocated array with the values (more efficient than
- * creating a new array each time). If 'array' is null, or not the same size as
- * the number of values, a new array will be allocated and returned.
- *
- * @webref floatdict:method
- * @webBrief Create a new array and copy each of the values into it
- */
+ /**
+ * The version of this method without a parameter creates a new array and copies
+ * each of the values into it. The version with the float[] parameters
+ * fills an already-allocated array with the values (more efficient than
+ * creating a new array each time). If 'array' is null, or not the same size as
+ * the number of values, a new array will be allocated and returned.
+ *
+ * @webref floatdict:method
+ * @webBrief Create a new array and copy each of the values into it
+ */
public float[] valueArray() {
crop();
return valueArray(null);
@@ -414,13 +414,13 @@ public class FloatDict {
}
- /**
- * Add to a value. If the key does not exist, an new pair is initialized with
- * the value supplied.
- *
- * @webref floatdict:method
- * @webBrief Add to a value
- */
+ /**
+ * Add to a value. If the key does not exist, an new pair is initialized with
+ * the value supplied.
+ *
+ * @webref floatdict:method
+ * @webBrief Add to a value
+ */
public void add(String key, float amount) {
int index = index(key);
if (index == -1) {
@@ -693,13 +693,13 @@ public class FloatDict {
}
- /**
- * Sort the keys alphabetically in reverse (ignoring case). Uses the value as a
- * tie-breaker (only really possible with a key that has a case change).
- *
- * @webref floatdict:method
- * @webBrief Sort the keys alphabetically in reverse
- */
+ /**
+ * Sort the keys alphabetically in reverse (ignoring case). Uses the value as a
+ * tie-breaker (only really possible with a key that has a case change).
+ *
+ * @webref floatdict:method
+ * @webBrief Sort the keys alphabetically in reverse
+ */
public void sortKeysReverse() {
sortImpl(true, true, true);
}
diff --git a/core/src/processing/data/IntDict.java b/core/src/processing/data/IntDict.java
index 76d5911c1..78e594f5b 100644
--- a/core/src/processing/data/IntDict.java
+++ b/core/src/processing/data/IntDict.java
@@ -320,16 +320,16 @@ public class IntDict {
}
- /**
- * The version of this method without a parameter creates a new array and copies
- * each of the values into it. The version with the int[] parameters
- * fills an already-allocated array with the values (more efficient than
- * creating a new array each time). If 'array' is null, or not the same size as
- * the number of values, a new array will be allocated and returned.
- *
- * @webref intdict:method
- * @webBrief Create a new array and copy each of the values into it
- */
+ /**
+ * The version of this method without a parameter creates a new array and copies
+ * each of the values into it. The version with the int[] parameters
+ * fills an already-allocated array with the values (more efficient than
+ * creating a new array each time). If 'array' is null, or not the same size as
+ * the number of values, a new array will be allocated and returned.
+ *
+ * @webref intdict:method
+ * @webBrief Create a new array and copy each of the values into it
+ */
public int[] valueArray() {
crop();
return valueArray(null);
diff --git a/core/src/processing/data/Table.java b/core/src/processing/data/Table.java
index 9c2abae02..9686851c2 100644
--- a/core/src/processing/data/Table.java
+++ b/core/src/processing/data/Table.java
@@ -1808,18 +1808,18 @@ public class Table {
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
- /**
- * Use addColumn() to add a new column to a Table object.
- * Typically, you will want to specify a title, so the column may be easily
- * referenced later by name. (If no title is specified, the new column's title
- * will be null.) A column type may also be specified, in which case all values
- * stored in this column must be of the same type (e.g., Table.INT or
- * Table.FLOAT). If no type is specified, the default type of STRING is used.
- *
- * @webref table:method
- * @webBrief Adds a new column to a table
- * @see Table#removeColumn(String)
- */
+ /**
+ * Use addColumn() to add a new column to a Table object.
+ * Typically, you will want to specify a title, so the column may be easily
+ * referenced later by name. (If no title is specified, the new column's title
+ * will be null.) A column type may also be specified, in which case all values
+ * stored in this column must be of the same type (e.g., Table.INT or
+ * Table.FLOAT). If no type is specified, the default type of STRING is used.
+ *
+ * @webref table:method
+ * @webBrief Adds a new column to a table
+ * @see Table#removeColumn(String)
+ */
public void addColumn() {
addColumn(null, STRING);
}
@@ -1889,18 +1889,18 @@ public class Table {
}
}
- /**
- * Use removeColumn() to remove an existing column from a Table
- * object. The column to be removed may be identified by either its title (a
- * String) or its index value (an int). removeColumn(0) would remove the
- * first column, removeColumn(1) would remove the second column, and so
- * on.
- *
- * @webref table:method
- * @webBrief Removes a column from a table
- * @param columnName the title of the column to be removed
- * @see Table#addColumn()
- */
+ /**
+ * Use removeColumn() to remove an existing column from a Table
+ * object. The column to be removed may be identified by either its title (a
+ * String) or its index value (an int). removeColumn(0) would remove the
+ * first column, removeColumn(1) would remove the second column, and so
+ * on.
+ *
+ * @webref table:method
+ * @webBrief Removes a column from a table
+ * @param columnName the title of the column to be removed
+ * @see Table#addColumn()
+ */
public void removeColumn(String columnName) {
removeColumn(getColumnIndex(columnName));
}
@@ -2353,19 +2353,19 @@ public class Table {
}
- /**
- * Use addRow() to add a new row of data to a Table object. By
- * default, an empty row is created. Typically, you would store a reference to
- * the new row in a TableRow object (see newRow in the example
- * above), and then set individual values using setInt(),
- * setFloat(), or setString(). If a TableRow object is
- * included as a parameter, then that row is duplicated and added to the table.
- *
- * @webref table:method
- * @webBrief Adds a new row of data to a Table object
- * @see Table#removeRow(int)
- * @see Table#clearRows()
- */
+ /**
+ * Use addRow() to add a new row of data to a Table object. By
+ * default, an empty row is created. Typically, you would store a reference to
+ * the new row in a TableRow object (see newRow in the example
+ * above), and then set individual values using setInt(),
+ * setFloat(), or setString(). If a TableRow object is
+ * included as a parameter, then that row is duplicated and added to the table.
+ *
+ * @webref table:method
+ * @webBrief Adds a new row of data to a Table object
+ * @see Table#removeRow(int)
+ * @see Table#clearRows()
+ */
public TableRow addRow() {
//if (rowIncrement == 0) {
setRowCount(rowCount + 1);
@@ -4092,18 +4092,18 @@ public class Table {
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
- /**
- * Removes any of the specified characters (or "tokens"). The example above
- * removes all commas, dollar signs, and spaces from the table.
- *
- * If no column is specified, then the values in all columns and rows are
- * processed. A specific column may be referenced by either its ID or title.
- *
- * @webref table:method
- * @webBrief Removes characters from the table
- * @param tokens a list of individual characters to be removed
- * @see Table#trim()
- */
+ /**
+ * Removes any of the specified characters (or "tokens"). The example above
+ * removes all commas, dollar signs, and spaces from the table.
+ *
+ * If no column is specified, then the values in all columns and rows are
+ * processed. A specific column may be referenced by either its ID or title.
+ *
+ * @webref table:method
+ * @webBrief Removes characters from the table
+ * @param tokens a list of individual characters to be removed
+ * @see Table#trim()
+ */
public void removeTokens(String tokens) {
for (int col = 0; col < getColumnCount(); col++) {
removeTokens(tokens, col);
diff --git a/core/src/processing/data/XML.java b/core/src/processing/data/XML.java
index 409f6ac01..f83451594 100644
--- a/core/src/processing/data/XML.java
+++ b/core/src/processing/data/XML.java
@@ -570,16 +570,16 @@ public class XML implements Serializable {
}
- /**
- * Appends a new child to the element. The child can be specified with either a
- * String, which will be used as the new tag's name, or as a reference to an
- * existing XML object.
- *
- * A reference to the newly created child is returned as an XML object.
- *
- * @webref xml:method
- * @webBrief Appends a new child to the element
- */
+ /**
+ * Appends a new child to the element. The child can be specified with either a
+ * String, which will be used as the new tag's name, or as a reference to an
+ * existing XML object.
+ *
+ * A reference to the newly created child is returned as an XML object.
+ *
+ * @webref xml:method
+ * @webBrief Appends a new child to the element
+ */
public XML addChild(String tag) {
Document document = node.getOwnerDocument();
Node newChild = document.createElement(tag);
@@ -857,15 +857,15 @@ public class XML implements Serializable {
}
- /**
- * Returns an attribute value of the element as a float. If the
- * defaultValue parameter is specified and the attribute doesn't exist,
- * then defaultValue is returned. If no defaultValue is specified
- * and the attribute doesn't exist, the value 0.0 is returned.
- *
- * @webref xml:method
- * @webBrief Gets the content of an attribute as a float
- */
+ /**
+ * Returns an attribute value of the element as a float. If the
+ * defaultValue parameter is specified and the attribute doesn't exist,
+ * then defaultValue is returned. If no defaultValue is specified
+ * and the attribute doesn't exist, the value 0.0 is returned.
+ *
+ * @webref xml:method
+ * @webBrief Gets the content of an attribute as a float
+ */
public float getFloat(String name) {
return getFloat(name, 0);
}
@@ -1049,25 +1049,25 @@ public class XML implements Serializable {
}
- /**
- * Takes an XML object and converts it to a String, formatting its content as
- * specified with the indent parameter.
- *
- * If indent is set to -1, then the String is returned with no line breaks, no
- * indentation, and no XML declaration.
- *
- * If indent is set to 0 or greater, then the String is returned with line
- * breaks, and the specified number of spaces as indent values. Meaning, there
- * will be no indentation if 0 is specified, or each indent will be replaced
- * with the corresponding number of spaces: 1, 2, 3, and so on.
- *
- * @webref xml:method
- * @webBrief Formats XML data as a String
- * @param indent -1 for a single line (and no declaration), >= 0 for indents and
- * newlines
- * @return the content
- * @see XML#toString()
- */
+ /**
+ * Takes an XML object and converts it to a String, formatting its content as
+ * specified with the indent parameter.
+ *
+ * If indent is set to -1, then the String is returned with no line breaks, no
+ * indentation, and no XML declaration.
+ *
+ * If indent is set to 0 or greater, then the String is returned with line
+ * breaks, and the specified number of spaces as indent values. Meaning, there
+ * will be no indentation if 0 is specified, or each indent will be replaced
+ * with the corresponding number of spaces: 1, 2, 3, and so on.
+ *
+ * @webref xml:method
+ * @webBrief Formats XML data as a String
+ * @param indent -1 for a single line (and no declaration), >= 0 for indents and
+ * newlines
+ * @return the content
+ * @see XML#toString()
+ */
public String format(int indent) {
try {
// entities = doctype.getEntities()
@@ -1203,17 +1203,17 @@ public class XML implements Serializable {
}
- /**
- * Takes an XML object and converts it to a String, using default formatting
- * rules (includes an XML declaration, line breaks, and two spaces for indents).
- * These are the same formatting rules used by println() when printing an
- * XML object. This method produces the same results as using format(2).
- *
- * @webref xml:method
- * @webBrief Gets XML data as a String using default formatting
- * @return the content
- * @see XML#format(int)
- */
+ /**
+ * Takes an XML object and converts it to a String, using default formatting
+ * rules (includes an XML declaration, line breaks, and two spaces for indents).
+ * These are the same formatting rules used by println() when printing an
+ * XML object. This method produces the same results as using format(2).
+ *
+ * @webref xml:method
+ * @webBrief Gets XML data as a String using default formatting
+ * @return the content
+ * @see XML#format(int)
+ */
@Override
public String toString() {
//return format(2);
diff --git a/doclet/ReferenceGenerator/bin/ProcessingWeblet.class b/doclet/ReferenceGenerator/bin/ProcessingWeblet.class
index b56b94b31..e06c174b5 100644
Binary files a/doclet/ReferenceGenerator/bin/ProcessingWeblet.class and b/doclet/ReferenceGenerator/bin/ProcessingWeblet.class differ
diff --git a/doclet/ReferenceGenerator/bin/writers/IndexWriter$Alphabetizer.class b/doclet/ReferenceGenerator/bin/writers/IndexWriter$Alphabetizer.class
deleted file mode 100644
index 5622175b9..000000000
Binary files a/doclet/ReferenceGenerator/bin/writers/IndexWriter$Alphabetizer.class and /dev/null differ
diff --git a/doclet/ReferenceGenerator/bin/writers/IndexWriter.class b/doclet/ReferenceGenerator/bin/writers/IndexWriter.class
deleted file mode 100644
index c8f45bf01..000000000
Binary files a/doclet/ReferenceGenerator/bin/writers/IndexWriter.class and /dev/null differ
diff --git a/doclet/ReferenceGenerator/src/ProcessingWeblet.java b/doclet/ReferenceGenerator/src/ProcessingWeblet.java
index 45b809193..c0d10d36b 100644
--- a/doclet/ReferenceGenerator/src/ProcessingWeblet.java
+++ b/doclet/ReferenceGenerator/src/ProcessingWeblet.java
@@ -3,7 +3,6 @@ import java.io.IOException;
import writers.ClassWriter;
import writers.FieldWriter;
import writers.FunctionWriter;
-import writers.IndexWriter;
import writers.LibraryWriter;
import writers.Shared;
@@ -40,14 +39,11 @@ public class ProcessingWeblet extends Standard {
private static String verboseFlag = "-noisy";
private static String rootFlag = "-rootclass";
private static String xmlDescriptionFlag = "-includeXMLTag";
- private static IndexWriter indexWriter;
public static boolean start(RootDoc root)
{
setConfig(root.options());
Shared.i().createBaseDirectories();
-
- indexWriter = new IndexWriter();
try
{
@@ -60,10 +56,6 @@ public class ProcessingWeblet extends Standard {
System.out.println("===Source code @webref files written.===");
- // write out the index file
-
- System.out.println("\n===Telling the index to write itself.===");
- indexWriter.write();
} catch (IOException e) {
// TODO Auto-generated catch block
@@ -134,29 +126,17 @@ public class ProcessingWeblet extends Standard {
for (MethodDoc fn : functions) {
// write out html reference
FunctionWriter.write(fn);
-
- Tag[] tags = fn.tags(Shared.i().getWebrefTagName());
- if (tags.length != 0) {
- // add to the index under the @webref category:sub_category
- indexWriter.addItem(fn, tags[0]);
- }
}
//also need to add fields
for(FieldDoc doc : classDoc.fields()){
if(Shared.i().isWebref(doc)){
FieldWriter.write(doc);
- indexWriter.addItem(doc, doc.tags(Shared.i().getWebrefTagName())[0] );
}
}
} else {
// document a class and its public properties
new ClassWriter().write( classDoc );
- Tag[] classTags = classDoc.tags(Shared.i().getWebrefTagName());
- if (classTags.length != 0) {
- // add to the index under the @webref category:sub_category
- indexWriter.addItem(classDoc, classTags[0]);
- }
}
} else {
// Document the library passed in
diff --git a/doclet/ReferenceGenerator/src/writers/IndexWriter.java b/doclet/ReferenceGenerator/src/writers/IndexWriter.java
deleted file mode 100644
index bf871e8bb..000000000
--- a/doclet/ReferenceGenerator/src/writers/IndexWriter.java
+++ /dev/null
@@ -1,174 +0,0 @@
-package writers;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-
-import com.sun.javadoc.ProgramElementDoc;
-import com.sun.javadoc.Tag;
-
-public class IndexWriter extends BaseWriter {
-
- class Alphabetizer implements Comparator
- {
- public int compare(String o1, String o2) {
- // TODO Auto-generated method stub
- int tagEnd = o1.indexOf(">");
- String inside1 = o1.substring( tagEnd + 1, tagEnd + 2 );
- tagEnd = o2.indexOf(">");
- String inside2 = o2.substring( tagEnd + 1, tagEnd + 2 );
-
- // compare first letter for symbols
- // check alphanumericity of both strings
- if( inside1.matches( "[a-zA-Z0-9 ]+" ) && ! inside2.matches("[a-zA-Z0-9 ]+") )
- {
- // if only the second is a symbol
- return 1;
- }
- else if( inside2.matches( "[a-zA-Z0-9 ]+" ) && ! inside1.matches("[a-zA-Z0-9 ]+") )
- {
- // if only the first is a symbol
- return -1;
- }
-
- // compare whole strings, starting with words
- inside1 = o1.substring( o1.indexOf(">") + 1, o1.length() );
-
- inside2 = o2.substring( o2.indexOf(">") + 1, o2.length() );
- // do a normal string comparison on the insides (not the html tags)
- return String.CASE_INSENSITIVE_ORDER.compare( inside1, inside2 );
- }
-
- }
-
- HashMap> sections;
-
- TemplateWriter templateWriter;
-
- public IndexWriter(){
- sections = new HashMap>();
- templateWriter = new TemplateWriter();
- }
-
- public void write() throws IOException{
- templateWriter.write("index.template.html", getCompressedSections(), "index.html");
- templateWriter.write("index.alphabetical.template.html", getAlphabetical(), "alpha.html");
- }
-
- private HashMap getCompressedSections () {
- HashMap ret = new HashMap();
-
- for (String key : sections.keySet()) {
-
- String value = "";
- //make things alphabetical in their sections
- Collections.sort( sections.get(key), new Alphabetizer() );
-
- for (String s : sections.get(key))
- {
- if ( !value.contains(s) )
- {
- value = value.concat("\n").concat(s);
- }
- }
- ret.put(key, value);
- }
- return ret;
- }
-
- private HashMap getAlphabetical(){
- HashMap ret = new HashMap();
- ArrayList all = new ArrayList();
-
- for(String key : sections.keySet()){
- for( String s : sections.get(key)){
- if( ! all.contains(s) )
- {
- all.add(s);
- }
- }
- }
-
- Collections.sort(all, new Alphabetizer() );
-
- String value = "";
- float numColumns = 3.0f;
- int currentColumn = 0;
- float perColumn = all.size()/numColumns;
-
- float counter = 0.0f;
-
- String startString = all.get(0);
-
- String currentLetterGroup = startString.substring( startString.indexOf(">") + 1, startString.indexOf(">") + 2 );
- // find the stuff inside brackets
-
- for(String s : all){
- counter++;
- int tagEnd = s.indexOf(">");
- String currentLetter = s.substring( tagEnd + 1, tagEnd + 2 );
-
-
- if( currentLetter.matches( "[a-zA-Z0-9]") && ! currentLetter.equalsIgnoreCase( currentLetterGroup ) )
- { // add a break at letter change
- value = value.concat(" ");
- currentLetterGroup = currentLetter;
- }
-
- value = value.concat( s );
-
- if( counter >= perColumn ){
- counter = 0;
- currentColumn++;
- ret.put("c"+currentColumn, value);
- value = "";
- }
- }
- if(counter != 0){
- currentColumn++;
- ret.put("c"+currentColumn, value);
- }
- ret.put("isAlphabetical", "true");
- return ret;
- }
-
- public void addItem ( ProgramElementDoc doc, Tag webref ) throws IOException {
-
- String name = getName(doc);
- String anchor = getAnchorFromName(name);
- String category = getCategory(webref);
- String subcategory = getSubcategory(webref);
- String classes = isModeSupported(doc, MODE_JAVASCRIPT) ? "" : "no-js";
-
- addItem(category, subcategory, name, anchor, classes);
- }
-
- public void addItem (String category, String subcategory, String name, String anchor, String classes ) throws IOException{
- String key = getKey(category, subcategory);
- HashMap vars = new HashMap();
- vars.put("anchor", anchor);
- vars.put("name", name);
- vars.put("classes", classes);
-
- String value = templateWriter.writePartial("index.entry.partial.html", vars);
- if( sections.containsKey(key))
- {
- sections.get(key).add(value);
- } else {
- ArrayList a = new ArrayList();
- a.add(value);
- sections.put(key, a);
- }
- }
-
- private String getKey(String category, String subCategory){
- if( !subCategory.equals("") ){
- String sub = subCategory.replaceAll(" ", "_");
- return category.toLowerCase() + ":" + sub.toLowerCase();
- }
- return category.toLowerCase();
- }
-
-}
diff --git a/doclet/templates/class.template.html b/doclet/templates/class.template.html
deleted file mode 100644
index 96634b4c1..000000000
--- a/doclet/templates/class.template.html
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
- \ Language (API) \ Processing 3+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
This reference is for Processing 3.0+. If you have a previous version, use the reference included with your software in the Help menu. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Core Javadoc and Libraries Javadoc.
This reference is for Processing 3.0+. If you have a previous version, use the reference included with your software in the Help menu. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Core Javadoc and Libraries Javadoc.
\ No newline at end of file
diff --git a/doclet/templates/parameter.partial.html b/doclet/templates/parameter.partial.html
deleted file mode 100644
index b51ed070c..000000000
--- a/doclet/templates/parameter.partial.html
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/doclet/templates/property.partial.html b/doclet/templates/property.partial.html
deleted file mode 100644
index af180b5f5..000000000
--- a/doclet/templates/property.partial.html
+++ /dev/null
@@ -1 +0,0 @@
-()
\ No newline at end of file
diff --git a/doclet/templates/related.partial.html b/doclet/templates/related.partial.html
deleted file mode 100644
index 486623f1f..000000000
--- a/doclet/templates/related.partial.html
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/java/libraries/io/src/processing/io/I2C.java b/java/libraries/io/src/processing/io/I2C.java
index c97eefe58..b977648fd 100644
--- a/java/libraries/io/src/processing/io/I2C.java
+++ b/java/libraries/io/src/processing/io/I2C.java
@@ -86,22 +86,22 @@ public class I2C {
}
- /**
- * Begins a transmission to an attached device.
- *
- * This function expects the address in the lower 7 bits, the same way as in
- * Arduino's Wire library, and as shown in the output of the i2cdetect tool. If
- * the address provided in a datasheet is greater than 127 (hex 0x7f) or there
- * are separate addresses for read and write operations listed, which vary
- * exactly by one, then you want to shift the this number by one bit to the
- * right before passing it as an argument to this function.
- *
- * @see write
- * @see read
- * @see endTransmission
- * @webref
- * @webBrief Begins a transmission to an attached device
- */
+ /**
+ * Begins a transmission to an attached device.
+ *
+ * This function expects the address in the lower 7 bits, the same way as in
+ * Arduino's Wire library, and as shown in the output of the i2cdetect tool. If
+ * the address provided in a datasheet is greater than 127 (hex 0x7f) or there
+ * are separate addresses for read and write operations listed, which vary
+ * exactly by one, then you want to shift the this number by one bit to the
+ * right before passing it as an argument to this function.
+ *
+ * @see write
+ * @see read
+ * @see endTransmission
+ * @webref
+ * @webBrief Begins a transmission to an attached device
+ */
public void beginTransmission(int slave) {
// addresses 120 (0x78) to 127 are additionally reserved
if (0x78 <= slave) {
@@ -114,18 +114,18 @@ public class I2C {
}
- /**
- * Closes the I2C device
- *
- * It is normally not necessary to explicitly close I2C interfaces, as they are
- * closed automatically by the operating system when the sketch exits.
- *
- * Note: It is possible to have two or more object using the same interface at a
- * time.
- *
- * @webref
- * @webBrief Closes the I2C device.
- */
+ /**
+ * Closes the I2C device
+ *
+ * It is normally not necessary to explicitly close I2C interfaces, as they are
+ * closed automatically by the operating system when the sketch exits.
+ *
+ * Note: It is possible to have two or more object using the same interface at a
+ * time.
+ *
+ * @webref
+ * @webBrief Closes the I2C device.
+ */
public void close() {
if (NativeInterface.isSimulated()) {
return;
@@ -145,18 +145,18 @@ public class I2C {
}
- /**
- * Ends the current transmissions
- *
- * This executes any queued writes. Read()
- * implicitly ends the current transmission as well, hence calling
- * endTransmission() afterwards is not necessary.
- *
- * @see beginTransmission
- * @see write
- * @webref
- * @webBrief Ends the current transmissions.
- */
+ /**
+ * Ends the current transmissions
+ *
+ * This executes any queued writes. Read()
+ * implicitly ends the current transmission as well, hence calling
+ * endTransmission() afterwards is not necessary.
+ *
+ * @see beginTransmission
+ * @see write
+ * @webref
+ * @webBrief Ends the current transmissions.
+ */
public void endTransmission() {
if (!transmitting) {
// silently ignore this case
@@ -209,22 +209,22 @@ public class I2C {
}
- /**
- * Read bytes from the attached device
- *
- * You must call beginTransmission() before calling this function. This function
- * also ends the current transmission and sends any data that was queued using
- * write() before. It is not necessary to call
- * endTransmission() after read().
- *
- * @param len number of bytes to read
- * @return bytes read from device
- * @see beginTransmission
- * @see write
- * @see endTransmission
- * @webref
- * @webBrief Read bytes from the attached device.
- */
+ /**
+ * Read bytes from the attached device
+ *
+ * You must call beginTransmission() before calling this function. This function
+ * also ends the current transmission and sends any data that was queued using
+ * write() before. It is not necessary to call
+ * endTransmission() after read().
+ *
+ * @param len number of bytes to read
+ * @return bytes read from device
+ * @see beginTransmission
+ * @see write
+ * @see endTransmission
+ * @webref
+ * @webBrief Read bytes from the attached device.
+ */
public byte[] read(int len) {
if (!transmitting) {
throw new RuntimeException("beginTransmisson has not been called");
@@ -250,19 +250,19 @@ public class I2C {
}
- /**
- * Add bytes to be written to the device
- *
- * You must call beginTransmission() before calling this function. The actual
- * writing takes part when read() or endTransmission() is being called.
- *
- * @param out bytes to be written
- * @see beginTransmission
- * @see read
- * @see endTransmission
- * @webref
- * @webBrief Add bytes to be written to the device.
- */
+ /**
+ * Add bytes to be written to the device
+ *
+ * You must call beginTransmission() before calling this function. The actual
+ * writing takes part when read() or endTransmission() is being called.
+ *
+ * @param out bytes to be written
+ * @see beginTransmission
+ * @see read
+ * @see endTransmission
+ * @webref
+ * @webBrief Add bytes to be written to the device.
+ */
public void write(byte[] out) {
if (!transmitting) {
throw new RuntimeException("beginTransmisson has not been called");
diff --git a/java/libraries/io/src/processing/io/LED.java b/java/libraries/io/src/processing/io/LED.java
index ca436ac83..fe2d3cba5 100644
--- a/java/libraries/io/src/processing/io/LED.java
+++ b/java/libraries/io/src/processing/io/LED.java
@@ -139,15 +139,15 @@ public class LED {
}
- /**
- * Restores the previous state
- *
- * Without calling this function the LED will remain in the current state even
- * after the sketch has been closed.
- *
- * @webref
- * @webBrief Restores the previous state
- */
+ /**
+ * Restores the previous state
+ *
+ * Without calling this function the LED will remain in the current state even
+ * after the sketch has been closed.
+ *
+ * @webref
+ * @webBrief Restores the previous state
+ */
public void close() {
if (NativeInterface.isSimulated()) {
return;
diff --git a/java/libraries/io/src/processing/io/PWM.java b/java/libraries/io/src/processing/io/PWM.java
index 0762add55..2d758ec24 100644
--- a/java/libraries/io/src/processing/io/PWM.java
+++ b/java/libraries/io/src/processing/io/PWM.java
@@ -110,15 +110,15 @@ public class PWM {
}
- /**
- * Gives ownership of a channel back to the operating system
- *
- * Without calling this function the channel will remain in the current state
- * even after the sketch has been closed.
- *
- * @webref
- * @webBrief Gives ownership of a channel back to the operating system
- */
+ /**
+ * Gives ownership of a channel back to the operating system
+ *
+ * Without calling this function the channel will remain in the current state
+ * even after the sketch has been closed.
+ *
+ * @webref
+ * @webBrief Gives ownership of a channel back to the operating system
+ */
public void close() {
if (NativeInterface.isSimulated()) {
return;
@@ -175,16 +175,16 @@ public class PWM {
}
- /**
- * Enables the PWM output
- *
- * When no period is specified, a default 1 kHz (1000 Hz) is used.
- *
- * @param period cycle period in Hz
- * @param duty duty cycle, 0.0 (always off) to 1.0 (always on)
- * @webref
- * @webBrief Enables the PWM output
- */
+ /**
+ * Enables the PWM output
+ *
+ * When no period is specified, a default 1 kHz (1000 Hz) is used.
+ *
+ * @param period cycle period in Hz
+ * @param duty duty cycle, 0.0 (always off) to 1.0 (always on)
+ * @webref
+ * @webBrief Enables the PWM output
+ */
public void set(int period, float duty) {
if (NativeInterface.isSimulated()) {
return;
diff --git a/java/libraries/io/src/processing/io/SPI.java b/java/libraries/io/src/processing/io/SPI.java
index 2bbb2583b..6e447bfd6 100644
--- a/java/libraries/io/src/processing/io/SPI.java
+++ b/java/libraries/io/src/processing/io/SPI.java
@@ -113,18 +113,18 @@ public class SPI {
}
- /**
- * Closes the SPI interface
- *
- * It is normally not necessary to explicitly close SPI interfaces, as they are
- * closed automatically by the operating system when the sketch exits.
- *
- * Note: It is possible to have two or more objects using the same interface at
- * a time.
- *
- * @webref
- * @webBrief Closes the SPI interface
- */
+ /**
+ * Closes the SPI interface
+ *
+ * It is normally not necessary to explicitly close SPI interfaces, as they are
+ * closed automatically by the operating system when the sketch exits.
+ *
+ * Note: It is possible to have two or more objects using the same interface at
+ * a time.
+ *
+ * @webref
+ * @webBrief Closes the SPI interface
+ */
public void close() {
if (NativeInterface.isSimulated()) {
return;
@@ -173,22 +173,22 @@ public class SPI {
}
- /**
- * Configures the SPI interface
- *
- * The default setting is: 500000, SPI.MSBFIRST, SPI.MODE0
- *
- * @param maxSpeed maximum transmission rate in Hz, 500000 (500 kHz) is a
- * resonable default
- * @param dataOrder whether data is send with the first- or least-significant
- * bit first (SPI.MSBFIRST or SPI.LSBFIRST, the former is more
- * common)
- * @param mode SPI.MODE0
- * to SPI.MODE3
- * @webref
- * @webBrief Configures the SPI interface
- */
+ /**
+ * Configures the SPI interface
+ *
+ * The default setting is: 500000, SPI.MSBFIRST, SPI.MODE0
+ *
+ * @param maxSpeed maximum transmission rate in Hz, 500000 (500 kHz) is a
+ * resonable default
+ * @param dataOrder whether data is send with the first- or least-significant
+ * bit first (SPI.MSBFIRST or SPI.LSBFIRST, the former is more
+ * common)
+ * @param mode SPI.MODE0
+ * to SPI.MODE3
+ * @webref
+ * @webBrief Configures the SPI interface
+ */
public void settings(int maxSpeed, int dataOrder, int mode) {
this.maxSpeed = maxSpeed;
this.dataOrder = dataOrder;
@@ -196,17 +196,17 @@ public class SPI {
}
- /**
- * Transfers data over the SPI bus
- *
- * With SPI, data is simultaneously being exchanged between the master device
- * and the slave device. For every byte that is being sent out, there's also one
- * byte being read in.
- *
- * @param out bytes to send
- * @return bytes read in (array is the same length as out)
- * @webref Transfers data over the SPI bus
- */
+ /**
+ * Transfers data over the SPI bus
+ *
+ * With SPI, data is simultaneously being exchanged between the master device
+ * and the slave device. For every byte that is being sent out, there's also one
+ * byte being read in.
+ *
+ * @param out bytes to send
+ * @return bytes read in (array is the same length as out)
+ * @webref Transfers data over the SPI bus
+ */
public byte[] transfer(byte[] out) {
if (NativeInterface.isSimulated()) {
return new byte[out.length];
diff --git a/java/libraries/io/src/processing/io/SoftwareServo.java b/java/libraries/io/src/processing/io/SoftwareServo.java
index a0ff55876..cda338f82 100644
--- a/java/libraries/io/src/processing/io/SoftwareServo.java
+++ b/java/libraries/io/src/processing/io/SoftwareServo.java
@@ -81,20 +81,20 @@ public class SoftwareServo {
}
- /**
- * Attaches a servo motor to a GPIO pin
- *
- * You must call this function before calling write(). Note that the servo motor
- * will only be instructed to move after the first time write() is called.
- *
- * The optional parameters minPulse and maxPulse control the minimum and maximum
- * pulse width durations. The default values, identical to those of Arduino's
- * Servo class, should be compatible with most servo motors.
- *
- * @param pin GPIO pin
- * @webref
- * @webBrief Attaches a servo motor to a GPIO pin
- */
+ /**
+ * Attaches a servo motor to a GPIO pin
+ *
+ * You must call this function before calling write(). Note that the servo motor
+ * will only be instructed to move after the first time write() is called.
+ *
+ * The optional parameters minPulse and maxPulse control the minimum and maximum
+ * pulse width durations. The default values, identical to those of Arduino's
+ * Servo class, should be compatible with most servo motors.
+ *
+ * @param pin GPIO pin
+ * @webref
+ * @webBrief Attaches a servo motor to a GPIO pin
+ */
public void attach(int pin) {
detach();
this.pin = pin;
@@ -117,19 +117,19 @@ public class SoftwareServo {
}
- /**
- * Moves a servo motor to a given orientation
- *
- * If you are using this class in combination with a continuous rotation servo,
- * different angles will result in the servo rotating forward or backward at
- * different speeds. For regular servo motors, this will instruct the servo to
- * rotate to and hold a specific angle.
- *
- * @param angle angle in degrees (controls speed and direction on
- * continuous-rotation servos)
- * @webref
- * @webBrief Moves a servo motor to a given orientation
- */
+ /**
+ * Moves a servo motor to a given orientation
+ *
+ * If you are using this class in combination with a continuous rotation servo,
+ * different angles will result in the servo rotating forward or backward at
+ * different speeds. For regular servo motors, this will instruct the servo to
+ * rotate to and hold a specific angle.
+ *
+ * @param angle angle in degrees (controls speed and direction on
+ * continuous-rotation servos)
+ * @webref
+ * @webBrief Moves a servo motor to a given orientation
+ */
public void write(float angle) {
if (attached() == false) {
System.err.println("You need to call attach(pin) before write(angle).");
@@ -173,15 +173,15 @@ public class SoftwareServo {
}
- /**
- * Detatches a servo motor from a GPIO pin
- *
- * Calling this method will stop the servo from moving or trying to hold the
- * current orientation.
- *
- * @webref
- * @webBrief Detatches a servo motor from a GPIO pin
- */
+ /**
+ * Detatches a servo motor from a GPIO pin
+ *
+ * Calling this method will stop the servo from moving or trying to hold the
+ * current orientation.
+ *
+ * @webref
+ * @webBrief Detatches a servo motor from a GPIO pin
+ */
public void detach() {
if (0 <= handle) {
// stop thread