From db4ef457149914be876d27cff0a2c15cf1e5b949 Mon Sep 17 00:00:00 2001 From: benfry Date: Tue, 3 Apr 2012 16:16:53 +0000 Subject: [PATCH] adding createGraphics() without renderer params --- android/core/src/processing/core/PApplet.java | 5 + .../core/src/processing/core/PConstants.java | 6 +- .../src/processing/opengl/PGraphics2D.java | 27 + .../src/processing/opengl/PGraphics3D.java | 27 + android/todo.txt | 1 + core/src/processing/core/PApplet.java | 492 +++++++++--------- core/src/processing/core/PConstants.java | 3 +- core/todo.txt | 33 +- todo.txt | 12 +- 9 files changed, 341 insertions(+), 265 deletions(-) create mode 100644 android/core/src/processing/opengl/PGraphics2D.java create mode 100644 android/core/src/processing/opengl/PGraphics3D.java diff --git a/android/core/src/processing/core/PApplet.java b/android/core/src/processing/core/PApplet.java index 94a906854..0a8fcdcc4 100644 --- a/android/core/src/processing/core/PApplet.java +++ b/android/core/src/processing/core/PApplet.java @@ -1485,6 +1485,11 @@ public class PApplet extends Activity implements PConstants, Runnable { */ } + + public PGraphics createGraphics(int iwidth, int iheight) { + return createGraphics(iwidth, iheight, JAVA2D); + } + /** * Create an offscreen PGraphics object for drawing. This can be used diff --git a/android/core/src/processing/core/PConstants.java b/android/core/src/processing/core/PConstants.java index e2f38b8b9..85e08d199 100644 --- a/android/core/src/processing/core/PConstants.java +++ b/android/core/src/processing/core/PConstants.java @@ -131,9 +131,9 @@ public interface PConstants { static final String MEDIUM_COLOR_DEPTH = "8:8:8:8:16:0"; static final String HIGH_COLOR_DEPTH = "8:8:8:8:24:8"; - static final String P2D = "processing.core.PGraphicsAndroid2D"; - static final String JAVA2D = P2D; - static final String P3D = "processing.core.PGraphicsOpenGL"; + static final String JAVA2D = "processing.core.PGraphicsAndroid2D"; + static final String P2D = "processing.opengl.PGraphics2D"; + static final String P3D = "processing.opengl.PGraphics3D"; static final String OPENGL = P3D; // The PDF and DXF renderers are not available for Android. diff --git a/android/core/src/processing/opengl/PGraphics2D.java b/android/core/src/processing/opengl/PGraphics2D.java new file mode 100644 index 000000000..26deab87b --- /dev/null +++ b/android/core/src/processing/opengl/PGraphics2D.java @@ -0,0 +1,27 @@ +/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ + +/* + Part of the Processing project - http://processing.org + + Copyright (c) 2012 Ben Fry and Casey Reas + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License version 2.1 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General + Public License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA + */ + +package processing.opengl; + + +public class PGraphics2D extends PGraphicsOpenGL { +} \ No newline at end of file diff --git a/android/core/src/processing/opengl/PGraphics3D.java b/android/core/src/processing/opengl/PGraphics3D.java new file mode 100644 index 000000000..ca925692e --- /dev/null +++ b/android/core/src/processing/opengl/PGraphics3D.java @@ -0,0 +1,27 @@ +/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ + +/* + Part of the Processing project - http://processing.org + + Copyright (c) 2012 Ben Fry and Casey Reas + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License version 2.1 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General + Public License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA + */ + +package processing.opengl; + + +public class PGraphics3D extends PGraphicsOpenGL { +} \ No newline at end of file diff --git a/android/todo.txt b/android/todo.txt index c5f9a6687..d34d996a0 100644 --- a/android/todo.txt +++ b/android/todo.txt @@ -4,6 +4,7 @@ X http://stackoverflow.com/questions/2290945/writing-xml-on-android X consider switch to android 2.2 as the minimum X screenWidth/Height replaced with displayWidth/Height _ update this on the Wiki page +_ docs: P2D and P3D are now OpenGL variations andres A GL2 specific code in Processing 2.0a5 break P3D on GLES2 hardware diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index 02affb4c5..018f53bf6 100644 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -1397,6 +1397,11 @@ public class PApplet extends Applet } + public PGraphics createGraphics(int iwidth, int iheight) { + return createGraphics(iwidth, iheight, JAVA2D); + } + + /** * ( begin auto-generated from createGraphics.xml ) * @@ -1435,15 +1440,12 @@ public class PApplet extends Applet *
  • If you want to create images that are larger than the screen, * you should create your own PGraphics object, draw to that, and use * save(). - * For now, it's best to use P3D in this scenario. - * P2D is currently disabled, and the JAVA2D default will give mixed - * results. An example of using P3D: *
        *
        * PGraphics big;
        *
        * void setup() {
    -   *   big = createGraphics(3000, 3000, P3D);
    +   *   big = createGraphics(3000, 3000);
        *
        *   big.beginDraw();
        *   big.background(128);
    @@ -1462,8 +1464,6 @@ public class PApplet extends Applet
        * drawing has stopped, so that it can update itself internally.
        * This also handles calling the defaults() method, for people familiar
        * with that.
    -   * 
  • It's not possible to use createGraphics() with the OPENGL renderer, - * because it doesn't allow offscreen use. *
  • With Processing 0115 and later, it's possible to write images in * formats other than the default .tga and .tiff. The exact formats and * background information can be found in the developer's reference for @@ -10252,15 +10252,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 ) @@ -10382,7 +10382,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 @@ -10421,16 +10421,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 ) @@ -10541,7 +10541,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]. @@ -10572,7 +10572,7 @@ public class PApplet extends Applet * A sphere is a hollow ball made from tessellated triangles. * * ( end auto-generated ) - * + * *

    Advanced

    *

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

    Advanced

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

    Advanced

    * Code submitted by Dave Bollinger (davol) for release 0136. * @@ -10686,7 +10686,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) @@ -10720,7 +10720,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, @@ -10831,7 +10831,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) @@ -10856,7 +10856,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) @@ -10944,7 +10944,7 @@ public class PApplet extends Applet * smoothing altogether. * * ( end auto-generated ) - * + * * @webref shape:attributes * @see PGraphics#noSmooth() * @see PGraphics#hint(int) @@ -10994,7 +10994,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) @@ -11035,7 +11035,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. @@ -11090,7 +11090,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) @@ -11136,7 +11136,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 @@ -11188,7 +11188,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 @@ -11211,7 +11211,7 @@ public class PApplet extends Applet * will give you the total height of the line. * * ( end auto-generated ) - * + * * @webref typography:metrics * @see PGraphics#textDescent() */ @@ -11229,7 +11229,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() */ @@ -11288,7 +11288,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) @@ -11304,23 +11304,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 ) @@ -11347,7 +11347,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) @@ -11572,18 +11572,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) @@ -11600,17 +11600,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() */ @@ -11637,7 +11637,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 @@ -11684,7 +11684,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() @@ -11718,7 +11718,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() @@ -11752,7 +11752,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() @@ -11786,7 +11786,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() @@ -11806,9 +11806,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); @@ -11833,7 +11833,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() @@ -11896,7 +11896,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() @@ -11931,7 +11931,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() @@ -11954,7 +11954,7 @@ public class PApplet extends Applet * function in OpenGL is glLoadIdentity(). * * ( end auto-generated ) - * + * * @webref transform * @see PGraphics#pushMatrix() * @see PGraphics#popMatrix() @@ -11976,7 +11976,7 @@ public class PApplet extends Applet * function in OpenGL is glMultMatrix(). * * ( end auto-generated ) - * + * * @webref transform * @source * @see PGraphics#pushMatrix() @@ -12094,7 +12094,7 @@ public class PApplet extends Applet * of Processing). * * ( end auto-generated ) - * + * * @webref transform * @see PGraphics#pushMatrix() * @see PGraphics#popMatrix() @@ -12128,7 +12128,7 @@ public class PApplet extends Applet * endCamera() cannot be nested. * * ( end auto-generated ) - * + * * @webref lights_camera:camera * @see PGraphics#camera() * @see PGraphics#endCamera() @@ -12151,7 +12151,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) */ @@ -12163,19 +12163,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) @@ -12234,7 +12234,7 @@ public class PApplet extends Applet * -10, 10). * * ( end auto-generated ) - * + * * @webref lights_camera:camera */ public void ortho() { @@ -12283,7 +12283,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() { @@ -12312,7 +12312,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 @@ -12339,7 +12339,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) */ @@ -12356,7 +12356,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 @@ -12375,7 +12375,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 @@ -12410,7 +12410,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 @@ -12432,15 +12432,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 @@ -12455,22 +12455,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 @@ -12485,22 +12485,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 @@ -12532,7 +12532,7 @@ public class PApplet extends Applet * emissive(), specular(), shininess(), ambient() * * ( end auto-generated ) - * + * * @webref structure * @see PGraphics#popStyle() */ @@ -12554,7 +12554,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() */ @@ -12586,7 +12586,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) @@ -12613,7 +12613,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) @@ -12691,7 +12691,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) @@ -12754,7 +12754,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) @@ -12770,30 +12770,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 @@ -12858,7 +12858,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) @@ -12960,7 +12960,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 @@ -13005,7 +13005,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 @@ -13048,7 +13048,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 @@ -13071,7 +13071,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 @@ -13117,7 +13117,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) @@ -13134,14 +13134,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() @@ -13165,7 +13165,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) @@ -13389,7 +13389,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 @@ -13569,7 +13569,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 @@ -13600,7 +13600,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 @@ -13631,7 +13631,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 @@ -13696,7 +13696,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 @@ -13721,7 +13721,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 @@ -13807,7 +13807,7 @@ public class PApplet extends Applet /** * Return true if this renderer does rendering through OpenGL. Defaults to false. - */ + */ public boolean isGL() { return g.isGL(); } @@ -13847,7 +13847,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); @@ -13882,7 +13882,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); @@ -13912,26 +13912,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

    @@ -13951,7 +13951,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 @@ -13985,25 +13985,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 @@ -14036,18 +14036,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

    @@ -14092,31 +14092,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

    @@ -14151,17 +14151,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 @@ -14196,11 +14196,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

    *