From c0ef54fee5dce0c796cfec78d1e64400254084bb Mon Sep 17 00:00:00 2001 From: benfry Date: Tue, 1 Nov 2011 14:31:32 +0000 Subject: [PATCH] fix dataPath() and inputPath() et al for final decision --- build/shared/revisions.txt | 17 + core/src/processing/core/PApplet.java | 538 +++++++++++++------------- core/todo.txt | 5 +- todo.txt | 5 +- 4 files changed, 290 insertions(+), 275 deletions(-) diff --git a/build/shared/revisions.txt b/build/shared/revisions.txt index 39a0c72b5..fec886787 100644 --- a/build/shared/revisions.txt +++ b/build/shared/revisions.txt @@ -8,7 +8,24 @@ are exported, and a number of other bug fixes and tweaks. [ about those changes ] ++ Serial on Mac OS X is currently only available for 32-bit. Hoping to have + a 64-bit version sometime soon. ++ Change to how dataPath() and dataFile() work. This is an undocumented + function, but for those using it, here's the skinny: + + dataPath() is only available with applications, not applets or Android. + On Windows and Linux, this is simply the data folder, which is located + in the same directory as the EXE file and lib folders. On Mac OS X, this + is a path to the data folder buried inside Contents/Resources/Java. + For the latter point, that also means that the data folder should not be + considered writable. Use sketchPath() for now, or inputPath() and + outputPath() once they're available in the 2.0 release. + + dataPath() is not supported with applets because applets have their data + folder wrapped into the JAR file. To read data from the data folder that + works with an applet, you should use other methods such as createInput(), + createReader(), or loadStrings(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index d13e103f7..0fed6ec2c 100644 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -998,7 +998,7 @@ public class PApplet extends Applet } //// check for RuntimeException, and allow to bubble up if (t instanceof RuntimeException) { - //// re-throw exception + //// re-throw exception throw (RuntimeException) t; } else { //// trap and print as usual @@ -6532,38 +6532,29 @@ public class PApplet extends Applet /** * Return a full path to an item in the data folder. *

- * In this method, the data path is defined not as the applet's actual - * data path, but a folder titled "data" in the sketch's working - * directory. When running inside the PDE, this will be the sketch's - * "data" folder. However, when exported (as application or applet), - * sketch's data folder is exported as part of the applications jar file, - * and it's not possible to read/write from the jar file in a generic way. - * If you need to read data from the jar file, you should use other methods - * such as createInput(), createReader(), or loadStrings(). + * This is only available with applications, not applets or Android. + * On Windows and Linux, this is simply the data folder, which is located + * in the same directory as the EXE file and lib folders. On Mac OS X, this + * is a path to the data folder buried inside Contents/Resources/Java. + * For the latter point, that also means that the data folder should not be + * considered writable. Use sketchPath() for now, or inputPath() and + * outputPath() once they're available in the 2.0 release. + *

+ * dataPath() is not supported with applets because applets have their data + * folder wrapped into the JAR file. To read data from the data folder that + * works with an applet, you should use other methods such as createInput(), + * createReader(), or loadStrings(). */ public String dataPath(String where) { - // isAbsolute() could throw an access exception, but so will writing - // to the local disk using the sketch path, so this is safe here. - if (new File(where).isAbsolute()) return where; - - return sketchPath + File.separator + "data" + File.separator + where; + return dataFile(where).getAbsolutePath(); } - - + + /** * Return a full path to an item in the data folder as a File object. * See the dataPath() method for more information. */ public File dataFile(String where) { - return new File(dataPath(where)); - } - - - /** - * On Windows and Linux, this is simply the data folder. On Mac OS X, this is - * the path to the data folder buried inside Contents/Resources/Java - */ - public File inputFile(String where) { // isAbsolute() could throw an access exception, but so will writing // to the local disk using the sketch path, so this is safe here. File why = new File(where); @@ -6574,15 +6565,22 @@ public class PApplet extends Applet File containingFolder = new File(jarPath).getParentFile(); File dataFolder = new File(containingFolder, "data"); return new File(dataFolder, where); - } + } // Windows, Linux, or when not using a Mac OS X .app file return new File(sketchPath + File.separator + "data" + File.separator + where); } - - - public String inputPath(String where) { - return inputFile(where).getAbsolutePath(); - } + + + /** + * On Windows and Linux, this is simply the data folder. On Mac OS X, this is + * the path to the data folder buried inside Contents/Resources/Java + */ +// public File inputFile(String where) { +// } + + +// public String inputPath(String where) { +// } /** @@ -10014,15 +10012,15 @@ public class PApplet extends Applet /** * ( begin auto-generated from line.xml ) - * - * Draws a line (a direct path between two points) to the screen. The - * version of line() with four parameters draws the line in 2D. To - * color a line, use the stroke() function. A line cannot be filled, - * therefore the fill() function will not affect the color of a - * line. 2D lines are drawn with a width of one pixel by default, but this - * can be changed with the strokeWeight() function. The version with - * six parameters allows the line to be placed anywhere within XYZ space. - * Drawing this shape in 3D with the z parameter requires the P3D + * + * Draws a line (a direct path between two points) to the screen. The + * version of line() with four parameters draws the line in 2D. To + * color a line, use the stroke() function. A line cannot be filled, + * therefore the fill() function will not affect the color of a + * line. 2D lines are drawn with a width of one pixel by default, but this + * can be changed with the strokeWeight() function. The version with + * six parameters allows the line to be placed anywhere within XYZ space. + * Drawing this shape in 3D with the z parameter requires the P3D * parameter in combination with size() as shown in the above example. * * ( end auto-generated ) @@ -10144,7 +10142,7 @@ public class PApplet extends Applet * rectMode() function. * * ( end auto-generated ) - * + * * @webref shape:2d_primitives * @param a x-coordinate of the rectangle by default * @param b y-coordinate of the rectangle by default @@ -10183,16 +10181,16 @@ public class PApplet extends Applet /** * ( begin auto-generated from ellipseMode.xml ) - * - * The origin of the ellipse is modified by the ellipseMode() - * function. The default configuration is ellipseMode(CENTER), which - * specifies the location of the ellipse as the center of the shape. The - * RADIUS mode is the same, but the width and height parameters to - * ellipse() specify the radius of the ellipse, rather than the - * diameter. The CORNER mode draws the shape from the upper-left - * corner of its bounding box. The CORNERS mode uses the four - * parameters to ellipse() to set two opposing corners of the - * ellipse's bounding box. The parameter must be written in ALL CAPS + * + * The origin of the ellipse is modified by the ellipseMode() + * function. The default configuration is ellipseMode(CENTER), which + * specifies the location of the ellipse as the center of the shape. The + * RADIUS mode is the same, but the width and height parameters to + * ellipse() specify the radius of the ellipse, rather than the + * diameter. The CORNER mode draws the shape from the upper-left + * corner of its bounding box. The CORNERS mode uses the four + * parameters to ellipse() to set two opposing corners of the + * ellipse's bounding box. The parameter must be written in ALL CAPS * because Processing is a case-sensitive language. * * ( end auto-generated ) @@ -10301,7 +10299,7 @@ public class PApplet extends Applet * with two parameters. * * ( end auto-generated ) - * + * *

Advanced

* Code for sphereDetail() submitted by toxi [031031]. * Code for enhanced u/v version from davbol [080801]. @@ -10332,7 +10330,7 @@ public class PApplet extends Applet * A sphere is a hollow ball made from tessellated triangles. * * ( end auto-generated ) - * + * *

Advanced

*

* Implementation notes: @@ -10374,7 +10372,7 @@ public class PApplet extends Applet * at t. * * ( end auto-generated ) - * + * *

Advanced

* For instance, to convert the following example:
    * stroke(255, 102, 0);
@@ -10419,7 +10417,7 @@ public class PApplet extends Applet
    * target="new">tangent on Wikipedia.
    *
    * ( end auto-generated )
-   * 
+   *
    * 

Advanced

* Code submitted by Dave Bollinger (davol) for release 0136. * @@ -10446,7 +10444,7 @@ public class PApplet extends Applet * P2D renderer does not use this information. * * ( end auto-generated ) - * + * * @webref shape:curves * @param detail resolution of the curves * @see PGraphics#curve(float, float, float, float, float, float, float, float, float, float, float, float) @@ -10480,7 +10478,7 @@ public class PApplet extends Applet * Environment reference for more information). * * ( end auto-generated ) - * + * *

Advanced

* Draw a cubic bezier curve. The first and last points are * the on-curve points. The middle two are the 'control' points, @@ -10591,7 +10589,7 @@ public class PApplet extends Applet * P2D renderer does not use this information. * * ( end auto-generated ) - * + * * @webref shape:curves * @param detail resolution of the curves * @see PGraphics#curve(float, float, float, float, float, float, float, float, float, float, float, float) @@ -10616,7 +10614,7 @@ public class PApplet extends Applet * recognizable and as values increase in magnitude, they will continue to deform. * * ( end auto-generated ) - * + * * @webref shape:curves * @param tightness amount of deformation from the original vertices * @see PGraphics#curve(float, float, float, float, float, float, float, float, float, float, float, float) @@ -10704,7 +10702,7 @@ public class PApplet extends Applet * smoothing altogether. * * ( end auto-generated ) - * + * * @webref shape:attributes * @see PGraphics#noSmooth() * @see PGraphics#hint(int) @@ -10748,7 +10746,7 @@ public class PApplet extends Applet * Processing is a case-sensitive language. * * ( end auto-generated ) - * + * * @webref image:loading_displaying * @param mode either CORNER, CORNERS, or CENTER * @see PApplet#loadImage(String, String) @@ -10789,7 +10787,7 @@ public class PApplet extends Applet * This function will maintain transparency for GIF and PNG images. * * ( end auto-generated ) - * + * *

Advanced

* Starting with release 0124, when using the default (JAVA2D) renderer, * smooth() will also improve image quality of resized images. @@ -10844,7 +10842,7 @@ public class PApplet extends Applet * Processing is a case sensitive language. * * ( end auto-generated ) - * + * * @webref shape:loading_displaying * @param mode either CORNER, CORNERS, CENTER * @see PGraphics#shape(PShape) @@ -10890,7 +10888,7 @@ public class PApplet extends Applet * yet support shapes that have holes or complicated breaks. * * ( end auto-generated ) - * + * * @webref shape:loading_displaying * @param shape the shape to display * @param x x-coordinate of the shape @@ -10942,7 +10940,7 @@ public class PApplet extends Applet * if you change the size of the font. * * ( end auto-generated ) - * + * * @webref typography:attributes * @param alignX horizontal alignment, either LEFT, CENTER, or RIGHT * @param alignY vertical alignment, either TOP, BOTTOM, CENTER, or BASELINE @@ -10965,7 +10963,7 @@ public class PApplet extends Applet * will give you the total height of the line. * * ( end auto-generated ) - * + * * @webref typography:metrics * @see PGraphics#textDescent() */ @@ -10983,7 +10981,7 @@ public class PApplet extends Applet * textDescent() values will give you the total height of the line. * * ( end auto-generated ) - * + * * @webref typography:metrics * @see PGraphics#textAscent() */ @@ -11042,7 +11040,7 @@ public class PApplet extends Applet * will be used in all subsequent calls to the text() function. * * ( end auto-generated ) - * + * * @webref typography:attributes * @param leading the size in pixels for spacing between lines * @see PApplet#loadFont(String) @@ -11058,23 +11056,23 @@ public class PApplet extends Applet /** * ( begin auto-generated from textMode.xml ) - * - * Sets the way text draws to the screen. In the default configuration, the - * MODEL mode, it's possible to rotate, scale, and place letters in + * + * Sets the way text draws to the screen. In the default configuration, the + * MODEL mode, it's possible to rotate, scale, and place letters in * two and three dimensional space.
*
- * The SHAPE mode draws text using the 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 + * The SHAPE mode draws text using the 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 + * 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(). * * ( end auto-generated ) @@ -11101,7 +11099,7 @@ public class PApplet extends Applet * calls to the text() function. Font size is measured in units of pixels. * * ( end auto-generated ) - * + * * @webref typography:attributes * @param size the size of the letters in units of pixels * @see PApplet#loadFont(String) @@ -11324,18 +11322,18 @@ public class PApplet extends Applet /** * ( begin auto-generated from pushMatrix.xml ) - * - * Pushes the current transformation matrix onto the matrix stack. - * Understanding pushMatrix() and popMatrix() requires - * understanding the concept of a matrix stack. The pushMatrix() - * function saves the current coordinate system to the stack and - * popMatrix() restores the prior coordinate system. - * pushMatrix() and popMatrix() are used in conjuction with - * the other transformation functions and may be embedded to control the + * + * Pushes the current transformation matrix onto the matrix stack. + * Understanding pushMatrix() and popMatrix() requires + * understanding the concept of a matrix stack. The pushMatrix() + * function saves the current coordinate system to the stack and + * popMatrix() restores the prior coordinate system. + * pushMatrix() and popMatrix() are used in conjuction with + * the other transformation functions and may be embedded to control the * scope of the transformations. * * ( end auto-generated ) - * + * * @webref transform * @see PGraphics#popMatrix() * @see PGraphics#translate(float, float, float) @@ -11352,17 +11350,17 @@ public class PApplet extends Applet /** * ( begin auto-generated from popMatrix.xml ) - * - * Pops the current transformation matrix off the matrix stack. - * Understanding pushing and popping requires understanding the concept of - * a matrix stack. The pushMatrix() function saves the current - * coordinate system to the stack and popMatrix() restores the prior - * coordinate system. pushMatrix() and popMatrix() are used - * in conjuction with the other transformation functions and may be + * + * Pops the current transformation matrix off the matrix stack. + * Understanding pushing and popping requires understanding the concept of + * a matrix stack. The pushMatrix() function saves the current + * coordinate system to the stack and popMatrix() restores the prior + * coordinate system. pushMatrix() and popMatrix() are used + * in conjuction with the other transformation functions and may be * embedded to control the scope of the transformations. * * ( end auto-generated ) - * + * * @webref transform * @see PGraphics#pushMatrix() */ @@ -11389,7 +11387,7 @@ public class PApplet extends Applet * further controlled by the pushMatrix() and popMatrix(). * * ( end auto-generated ) - * + * * @webref transform * @param tx left/right translation * @param ty up/down translation @@ -11436,7 +11434,7 @@ public class PApplet extends Applet * the pushMatrix() and popMatrix(). * * ( end auto-generated ) - * + * * @webref transform * @param angle angle of rotation specified in radians * @see PGraphics#popMatrix() @@ -11470,7 +11468,7 @@ public class PApplet extends Applet * as shown in the example above. * * ( end auto-generated ) - * + * * @webref transform * @param angle angle of rotation specified in radians * @see PGraphics#popMatrix() @@ -11504,7 +11502,7 @@ public class PApplet extends Applet * as shown in the examples above. * * ( end auto-generated ) - * + * * @webref transform * @param angle angle of rotation specified in radians * @see PGraphics#popMatrix() @@ -11538,7 +11536,7 @@ public class PApplet extends Applet * as shown in the examples above. * * ( end auto-generated ) - * + * * @webref transform * @param angle angle of rotation specified in radians * @see PGraphics#popMatrix() @@ -11558,9 +11556,9 @@ public class PApplet extends Applet /** *

Advanced

* Rotate about a vector in space. Same as the glRotatef() function. - * @param vx - * @param vy - * @param vz + * @param vx + * @param vy + * @param vz */ public void rotate(float angle, float vx, float vy, float vz) { if (recorder != null) recorder.rotate(angle, vx, vy, vz); @@ -11585,7 +11583,7 @@ public class PApplet extends Applet * can be further controlled by pushMatrix() and popMatrix(). * * ( end auto-generated ) - * + * * @webref transform * @param s percentage to scale the object * @see PGraphics#popMatrix() @@ -11648,7 +11646,7 @@ public class PApplet extends Applet * the pushMatrix() and popMatrix() functions. * * ( end auto-generated ) - * + * * @webref transform * @param angle angle of shear specified in radians * @see PGraphics#popMatrix() @@ -11683,7 +11681,7 @@ public class PApplet extends Applet * the pushMatrix() and popMatrix() functions. * * ( end auto-generated ) - * + * * @webref transform * @param angle angle of shear specified in radians * @see PGraphics#popMatrix() @@ -11706,7 +11704,7 @@ public class PApplet extends Applet * function in OpenGL is glLoadIdentity(). * * ( end auto-generated ) - * + * * @webref transform * @see PGraphics#pushMatrix() * @see PGraphics#popMatrix() @@ -11728,7 +11726,7 @@ public class PApplet extends Applet * function in OpenGL is glMultMatrix(). * * ( end auto-generated ) - * + * * @webref transform * @source * @see PGraphics#pushMatrix() @@ -11846,7 +11844,7 @@ public class PApplet extends Applet * of Processing). * * ( end auto-generated ) - * + * * @webref transform * @see PGraphics#pushMatrix() * @see PGraphics#popMatrix() @@ -11880,7 +11878,7 @@ public class PApplet extends Applet * endCamera() cannot be nested. * * ( end auto-generated ) - * + * * @webref lights_camera:camera * @see PGraphics#camera() * @see PGraphics#endCamera() @@ -11903,7 +11901,7 @@ public class PApplet extends Applet * beginCamera() for a description of how the functions are used. * * ( end auto-generated ) - * + * * @webref lights_camera:camera * @see PGraphics#camera(float, float, float, float, float, float, float, float, float) */ @@ -11915,19 +11913,19 @@ public class PApplet extends Applet /** * ( begin auto-generated from camera.xml ) - * - * Sets the position of the camera through setting the eye position, the - * center of the scene, and which axis is facing upward. Moving the eye - * position and the direction it is pointing (the center of the scene) - * allows the images to be seen from different angles. The version without - * any parameters sets the camera to the default position, pointing to the - * center of the display window with the Y axis as up. The default values - * are camera(width/2.0, height/2.0, (height/2.0) / tan(PI*30.0 / - * 180.0), width/2.0, height/2.0, 0, 0, 1, 0). This function is similar + * + * Sets the position of the camera through setting the eye position, the + * center of the scene, and which axis is facing upward. Moving the eye + * position and the direction it is pointing (the center of the scene) + * allows the images to be seen from different angles. The version without + * any parameters sets the camera to the default position, pointing to the + * center of the display window with the Y axis as up. The default values + * are camera(width/2.0, height/2.0, (height/2.0) / tan(PI*30.0 / + * 180.0), width/2.0, height/2.0, 0, 0, 1, 0). This function is similar * to gluLookAt() in OpenGL, but it first clears the current camera settings. * * ( end auto-generated ) - * + * * @webref lights_camera:camera * @see PGraphics#endCamera() * @see PGraphics#frustum(float, float, float, float, float, float) @@ -11986,7 +11984,7 @@ public class PApplet extends Applet * -10, 10). * * ( end auto-generated ) - * + * * @webref lights_camera:camera */ public void ortho() { @@ -12035,7 +12033,7 @@ public class PApplet extends Applet * cameraZ*10.0) where cameraZ is ((height/2.0) / tan(PI*60.0/360.0)); * * ( end auto-generated ) - * + * * @webref lights_camera:camera */ public void perspective() { @@ -12064,7 +12062,7 @@ public class PApplet extends Applet * than muliplying itself with it. * * ( end auto-generated ) - * + * * @webref lights_camera:camera * @param left left coordinate of the clipping plane * @param right right coordinate of the clipping plane @@ -12091,7 +12089,7 @@ public class PApplet extends Applet * the bottom of Processing). * * ( end auto-generated ) - * + * * @webref lights_camera:camera * @see PGraphics#camera(float, float, float, float, float, float, float, float, float) */ @@ -12108,7 +12106,7 @@ public class PApplet extends Applet * where it will appear on a (two-dimensional) screen. * * ( end auto-generated ) - * + * * @webref lights_camera:coordinates * @param x 3D x-coordinate to be mapped * @param y 3D y-coordinate to be mapped @@ -12127,7 +12125,7 @@ public class PApplet extends Applet * where it will appear on a (two-dimensional) screen. * * ( end auto-generated ) - * + * * @webref lights_camera:coordinates * @param x 3D x-coordinate to be mapped * @param y 3D y-coordinate to be mapped @@ -12162,7 +12160,7 @@ public class PApplet extends Applet * where it will appear on a (two-dimensional) screen. * * ( end auto-generated ) - * + * * @webref lights_camera:coordinates * @param x 3D x-coordinate to be mapped * @param y 3D y-coordinate to be mapped @@ -12184,15 +12182,15 @@ public class PApplet extends Applet * to place an object in space relative to the location of the original * point once the transformations are no longer in use. *

- * In the example, the modelX(), modelY(), and - * modelZ() functions record the location of a box in space after - * being placed using a series of translate and rotate commands. After - * popMatrix() is called, those transformations no longer apply, but the - * (x, y, z) coordinate returned by the model functions is used to place + * In the example, the modelX(), modelY(), and + * modelZ() functions record the location of a box in space after + * being placed using a series of translate and rotate commands. After + * popMatrix() is called, those transformations no longer apply, but the + * (x, y, z) coordinate returned by the model functions is used to place * another box in the same location. * * ( end auto-generated ) - * + * * @webref lights_camera:coordinates * @param x 3D x-coordinate to be mapped * @param y 3D y-coordinate to be mapped @@ -12207,22 +12205,22 @@ public class PApplet extends Applet /** * ( begin auto-generated from modelY.xml ) - * - * Returns the three-dimensional X, Y, Z position in model space. This - * returns the Y value for a given coordinate based on the current set of - * transformations (scale, rotate, translate, etc.) The Y value can be used - * to place an object in space relative to the location of the original - * point once the transformations are no longer in use.
+ * + * Returns the three-dimensional X, Y, Z position in model space. This + * returns the Y value for a given coordinate based on the current set of + * transformations (scale, rotate, translate, etc.) The Y value can be used + * to place an object in space relative to the location of the original + * point once the transformations are no longer in use.
*
- * In the example, the modelX(), modelY(), and - * modelZ() functions record the location of a box in space after - * being placed using a series of translate and rotate commands. After - * popMatrix() is called, those transformations no longer apply, but the - * (x, y, z) coordinate returned by the model functions is used to place + * In the example, the modelX(), modelY(), and + * modelZ() functions record the location of a box in space after + * being placed using a series of translate and rotate commands. After + * popMatrix() is called, those transformations no longer apply, but the + * (x, y, z) coordinate returned by the model functions is used to place * another box in the same location. * * ( end auto-generated ) - * + * * @webref lights_camera:coordinates * @param x 3D x-coordinate to be mapped * @param y 3D y-coordinate to be mapped @@ -12237,22 +12235,22 @@ public class PApplet extends Applet /** * ( begin auto-generated from modelZ.xml ) - * - * Returns the three-dimensional X, Y, Z position in model space. This - * returns the Z value for a given coordinate based on the current set of - * transformations (scale, rotate, translate, etc.) The Z value can be used - * to place an object in space relative to the location of the original + * + * Returns the three-dimensional X, Y, Z position in model space. This + * returns the Z value for a given coordinate based on the current set of + * transformations (scale, rotate, translate, etc.) The Z value can be used + * to place an object in space relative to the location of the original * point once the transformations are no longer in use.
*
- * In the example, the modelX(), modelY(), and - * modelZ() functions record the location of a box in space after - * being placed using a series of translate and rotate commands. After - * popMatrix() is called, those transformations no longer apply, but the - * (x, y, z) coordinate returned by the model functions is used to place + * In the example, the modelX(), modelY(), and + * modelZ() functions record the location of a box in space after + * being placed using a series of translate and rotate commands. After + * popMatrix() is called, those transformations no longer apply, but the + * (x, y, z) coordinate returned by the model functions is used to place * another box in the same location. * * ( end auto-generated ) - * + * * @webref lights_camera:coordinates * @param x 3D x-coordinate to be mapped * @param y 3D y-coordinate to be mapped @@ -12284,7 +12282,7 @@ public class PApplet extends Applet * emissive(), specular(), shininess(), ambient() * * ( end auto-generated ) - * + * * @webref structure * @see PGraphics#popStyle() */ @@ -12306,7 +12304,7 @@ public class PApplet extends Applet * provide more control (see the second example above for a demonstration.) * * ( end auto-generated ) - * + * * @webref structure * @see PGraphics#pushStyle() */ @@ -12338,7 +12336,7 @@ public class PApplet extends Applet * may not go higher than 10 pixels. * * ( end auto-generated ) - * + * * @webref shape:attributes * @param weight the weight (in pixels) of the stroke * @see PGraphics#stroke(int, float) @@ -12365,7 +12363,7 @@ public class PApplet extends Applet * size() reference. * * ( end auto-generated ) - * + * * @webref shape:attributes * @param join either MITER, BEVEL, ROUND * @see PGraphics#stroke(int, float) @@ -12443,7 +12441,7 @@ public class PApplet extends Applet * maximum value is 255. * * ( end auto-generated ) - * + * * @param rgb color value in hexadecimal notation * @see PGraphics#noStroke() * @see PGraphics#fill(int, float) @@ -12506,7 +12504,7 @@ public class PApplet extends Applet * displaying images with their original hues. * * ( end auto-generated ) - * + * * @webref image:loading_displaying * @usage web_application * @see PGraphics#tint(float, float, float, float) @@ -12522,30 +12520,30 @@ public class PApplet extends Applet * ( begin auto-generated from tint.xml ) * * Sets the fill value for displaying images. Images can be tinted to - * specified colors or made transparent by setting the alpha.
+ * specified colors or made transparent by setting the alpha.
*
* To make an image transparent, but not change it's color, use white as * the tint color and specify an alpha value. For instance, tint(255, 128) - * will make an image 50% transparent (unless colorMode() has been + * will make an image 50% transparent (unless colorMode() has been * used).
*
- * When using hexadecimal notation to specify a color, use "#" or "0x" - * before the values (e.g. #CCFFAA, 0xFFCCFFAA). The # syntax uses six - * digits to specify a color (the way colors are specified in HTML and - * CSS). When using the hexadecimal notation starting with "0x", the - * hexadecimal value must be specified with eight characters; the first two - * characters define the alpha component and the remainder the red, green, + * When using hexadecimal notation to specify a color, use "#" or "0x" + * before the values (e.g. #CCFFAA, 0xFFCCFFAA). The # syntax uses six + * digits to specify a color (the way colors are specified in HTML and + * CSS). When using the hexadecimal notation starting with "0x", the + * hexadecimal value must be specified with eight characters; the first two + * characters define the alpha component and the remainder the red, green, * and blue components.
*
* The value for the parameter "gray" must be less than or equal to the * current maximum value as specified by colorMode(). The default - * maximum value is 255.
+ * maximum value is 255.
*
- * The tint() function is also used to control the coloring of - * textures in 3D. - * + * The tint() function is also used to control the coloring of + * textures in 3D. + * * ( end auto-generated ) - * + * * @webref image:loading_displaying * @usage web_application * @param rgb color value in hexadecimal notation @@ -12610,7 +12608,7 @@ public class PApplet extends Applet * are called, nothing will be drawn to the screen. * * ( end auto-generated ) - * + * * @webref color:setting * @usage web_application * @see PGraphics#fill(float, float, float, float) @@ -12712,7 +12710,7 @@ public class PApplet extends Applet * and shininess() in setting the material properties of shapes. * * ( end auto-generated ) - * + * * @webref lights_camera:material_properties * @usage web_application * @param rgb any value of the color datatype @@ -12757,7 +12755,7 @@ public class PApplet extends Applet * setting the material properties of shapes. * * ( end auto-generated ) - * + * * @webref lights_camera:material_properties * @usage web_application * @param rgb color to set @@ -12799,7 +12797,7 @@ public class PApplet extends Applet * setting the material properties of shapes. * * ( end auto-generated ) - * + * * @webref lights_camera:material_properties * @usage web_application * @param shine degree of shininess @@ -12822,7 +12820,7 @@ public class PApplet extends Applet * properties of shapes. * * ( end auto-generated ) - * + * * @webref lights_camera:material_properties * @usage web_application * @param rgb color to set @@ -12868,7 +12866,7 @@ public class PApplet extends Applet * through the loop. * * ( end auto-generated ) - * + * * @webref lights_camera:lights * @usage web_application * @see PGraphics#ambientLight(float, float, float, float, float, float) @@ -12885,14 +12883,14 @@ public class PApplet extends Applet /** * ( begin auto-generated from noLights.xml ) - * - * Disable all lighting. Lighting is turned off by default and enabled with - * the lights() function. This function can be used to disable - * lighting so that 2D geometry (which does not require lighting) can be + * + * Disable all lighting. Lighting is turned off by default and enabled with + * the lights() function. This function can be used to disable + * lighting so that 2D geometry (which does not require lighting) can be * drawn after a set of lighted 3D geometry. * * ( end auto-generated ) - * + * * @webref lights_camera:lights * @usage web_application * @see PGraphics#lights() @@ -12916,7 +12914,7 @@ public class PApplet extends Applet * parameters is determined by the current color mode. * * ( end auto-generated ) - * + * * @webref lights_camera:lights * @usage web_application * @param red red or hue value (depending on current color mode) @@ -13139,7 +13137,7 @@ public class PApplet extends Applet * the main drawing surface, however they will work properly with createGraphics(). * * ( end auto-generated ) - * + * *

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 @@ -13319,7 +13317,7 @@ public class PApplet extends Applet * & 0xFF;

* * ( end auto-generated ) - * + * * @webref color:creating_reading * @usage web_application * @param what any value of the color datatype @@ -13349,7 +13347,7 @@ public class PApplet extends Applet * myColor >> 8 & 0xFF; * * ( end auto-generated ) - * + * * @webref color:creating_reading * @usage web_application * @param what any value of the color datatype @@ -13379,7 +13377,7 @@ public class PApplet extends Applet * & 0xFF; * * ( end auto-generated ) - * + * * @webref color:creating_reading * @usage web_application * @param what any value of the color datatype @@ -13440,7 +13438,7 @@ public class PApplet extends Applet * Extracts the brightness value from a color. * * ( end auto-generated ) - * + * * @webref color:creating_reading * @usage web_application * @param what any value of the color datatype @@ -13464,7 +13462,7 @@ public class PApplet extends Applet * point, 0.5 is half-way in between, etc. * * ( end auto-generated ) - * + * * @webref color:creating_reading * @usage web_application * @param c1 interpolate from this color @@ -13633,7 +13631,7 @@ public class PApplet extends Applet * PGraphicsJava2D, or resized image data and OpenGL texture indices for * PGraphicsOpenGL. * @param renderer The PGraphics renderer associated to the image - * @param storage The metadata required by the renderer + * @param storage The metadata required by the renderer */ public void setCache(PGraphics renderer, Object storage) { if (recorder != null) recorder.setCache(renderer, storage); @@ -13668,7 +13666,7 @@ public class PApplet extends Applet * Store parameters for a renderer that requires extra metadata of * some kind. * @param renderer The PGraphics renderer associated to the image - * @param storage The parameters required by the renderer + * @param storage The parameters required by the renderer */ public void setParams(PGraphics renderer, Object params) { if (recorder != null) recorder.setParams(renderer, params); @@ -13698,26 +13696,26 @@ public class PApplet extends Applet /** * ( begin auto-generated from PImage_get.xml ) - * - * Reads the color of any pixel or grabs a section of an image. If no - * parameters are specified, the entire image is returned. Use the x - * and y parameters to get the value of one pixel. Get a section of - * the display window by specifying an additional width and - * height parameter. When getting an image, the x and - * y parameters define the coordinates for the upper-left corner of + * + * Reads the color of any pixel or grabs a section of an image. If no + * parameters are specified, the entire image is returned. Use the x + * and y parameters to get the value of one pixel. Get a section of + * the display window by specifying an additional width and + * height parameter. When getting an image, the x and + * y parameters define the coordinates for the upper-left corner of * the image, regardless of the current imageMode().
*
- * If the pixel requested is outside of the image window, black is - * returned. The numbers returned are scaled according to the current color - * ranges, but only RGB values are returned by this function. For example, - * even though you may have drawn a shape with colorMode(HSB), the + * If the pixel requested is outside of the image window, black is + * returned. The numbers returned are scaled according to the current color + * ranges, but only RGB values are returned by this function. For example, + * even though you may have drawn a shape with colorMode(HSB), the * numbers returned will be in RGB format.
*
- * Getting the color of a single pixel with get(x, y) is easy, but - * not as fast as grabbing the data directly from pixels[]. The - * equivalent statement to get(x, y) using pixels[] is + * Getting the color of a single pixel with get(x, y) is easy, but + * not as fast as grabbing the data directly from pixels[]. The + * equivalent statement to get(x, y) using pixels[] is * pixels[y*width+x]. See the reference for pixels[] for more information. - * + * * ( end auto-generated ) * *

Advanced

@@ -13737,7 +13735,7 @@ public class PApplet extends Applet * is inside the bounds, and then has to check to see what image * type it is. If you want things to be more efficient, access the * pixels[] array directly. - * + * * @webref image:pixels * @brief Reads the color of any pixel or grabs a rectangle of pixels * @usage web_application @@ -13771,25 +13769,25 @@ public class PApplet extends Applet /** * ( begin auto-generated from PImage_set.xml ) - * - * Changes the color of any pixel or writes an image directly into the + * + * Changes the color of any pixel or writes an image directly into the * display window.
*
- * The x and y parameters specify the pixel to change and the - * color parameter specifies the color value. The color parameter is - * affected by the current color mode (the default is RGB values from 0 to - * 255). When setting an image, the x and y parameters define - * the coordinates for the upper-left corner of the image, regardless of + * The x and y parameters specify the pixel to change and the + * color parameter specifies the color value. The color parameter is + * affected by the current color mode (the default is RGB values from 0 to + * 255). When setting an image, the x and y parameters define + * the coordinates for the upper-left corner of the image, regardless of * the current imageMode(). *

- * Setting the color of a single pixel with set(x, y) is easy, but - * not as fast as putting the data directly into pixels[]. The - * equivalent statement to set(x, y, #000000) using pixels[] - * is pixels[y*width+x] = #000000. See the reference for + * Setting the color of a single pixel with set(x, y) is easy, but + * not as fast as putting the data directly into pixels[]. The + * equivalent statement to set(x, y, #000000) using pixels[] + * is pixels[y*width+x] = #000000. See the reference for * pixels[] for more information. - * + * * ( end auto-generated ) - * + * * @webref image:pixels * @brief writes a color to any pixel or writes an image into another * @usage web_application @@ -13822,18 +13820,18 @@ public class PApplet extends Applet /** * ( begin auto-generated from PImage_mask.xml ) - * - * Masks part of an image from displaying by loading another image and - * using it as an alpha channel. This mask image should only contain - * grayscale data, but only the blue color channel is used. The mask image + * + * Masks part of an image from displaying by loading another image and + * using it as an alpha channel. This mask image should only contain + * grayscale data, but only the blue color channel is used. The mask image * needs to be the same size as the image to which it is applied.
*
- * In addition to using a mask image, an integer array containing the alpha - * channel data can be specified directly. This method is useful for - * creating dynamically generated alpha masks. This array must be of the - * same length as the target image's pixels array and should contain only + * In addition to using a mask image, an integer array containing the alpha + * channel data can be specified directly. This method is useful for + * creating dynamically generated alpha masks. This array must be of the + * same length as the target image's pixels array and should contain only * grayscale data of values between 0-255. - * + * * ( end auto-generated ) * *

Advanced

@@ -13878,31 +13876,31 @@ public class PApplet extends Applet /** * ( begin auto-generated from PImage_filter.xml ) - * - * Filters an image as defined by one of the following modes:

THRESHOLD - converts the image to black and white pixels depending if - * they are above or below the threshold defined by the level parameter. - * The level must be between 0.0 (black) and 1.0(white). If no level is + * + * Filters an image as defined by one of the following modes:

THRESHOLD - converts the image to black and white pixels depending if + * they are above or below the threshold defined by the level parameter. + * The level must be between 0.0 (black) and 1.0(white). If no level is * specified, 0.5 is used.
*
* GRAY - converts any colors in the image to grayscale equivalents
*
* INVERT - sets each pixel to its inverse value
*
- * POSTERIZE - limits each channel of the image to the number of colors + * POSTERIZE - limits each channel of the image to the number of colors * specified as the level parameter
*
- * BLUR - executes a Guassian blur with the level parameter specifying the - * extent of the blurring. If no level parameter is used, the blur is + * BLUR - executes a Guassian blur with the level parameter specifying the + * extent of the blurring. If no level parameter is used, the blur is * equivalent to Guassian blur of radius 1
*
* OPAQUE - sets the alpha channel to entirely opaque
*
- * ERODE - reduces the light areas with the amount defined by the level + * ERODE - reduces the light areas with the amount defined by the level * parameter
*
* DILATE - increases the light areas with the amount defined by the level parameter - * + * * ( end auto-generated ) * *

Advanced

@@ -13937,17 +13935,17 @@ public class PApplet extends Applet /** * ( begin auto-generated from PImage_copy.xml ) - * - * Copies a region of pixels from one image into another. If the source and - * destination regions aren't the same size, it will automatically resize - * source pixels to fit the specified target region. No alpha information - * is used in the process, however if the source image has an alpha channel + * + * Copies a region of pixels from one image into another. If the source and + * destination regions aren't the same size, it will automatically resize + * source pixels to fit the specified target region. No alpha information + * is used in the process, however if the source image has an alpha channel * set, it will be copied as well. *

* As of release 0149, this function ignores imageMode(). - * + * * ( end auto-generated ) - * + * * @webref image:pixels * @brief Copies the entire image * @usage web_application @@ -13982,11 +13980,11 @@ public class PApplet extends Applet /** * ( begin auto-generated from blendColor.xml ) - * - * Blends two color values together based on the blending mode given as the - * MODE parameter. The possible modes are described in the reference + * + * Blends two color values together based on the blending mode given as the + * MODE parameter. The possible modes are described in the reference * for the blend() function. - * + * * ( end auto-generated ) *

Advanced

*