propane 3.3.1-java → 3.6.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.mvn/extensions.xml +1 -2
- data/.mvn/wrapper/MavenWrapperDownloader.java +117 -0
- data/.mvn/wrapper/maven-wrapper.properties +2 -3
- data/.travis.yml +9 -0
- data/CHANGELOG.md +17 -5
- data/Gemfile +2 -0
- data/README.md +17 -8
- data/Rakefile +16 -30
- data/bin/propane +3 -1
- data/lib/propane.rb +6 -4
- data/lib/propane/app.rb +20 -10
- data/lib/propane/creators/sketch_class.rb +7 -1
- data/lib/propane/creators/sketch_factory.rb +4 -2
- data/lib/propane/creators/sketch_writer.rb +1 -0
- data/lib/propane/helper_methods.rb +23 -24
- data/lib/propane/helpers/numeric.rb +2 -0
- data/lib/propane/helpers/version_error.rb +1 -0
- data/lib/propane/library.rb +5 -1
- data/lib/propane/library_loader.rb +2 -0
- data/lib/propane/native_folder.rb +21 -15
- data/lib/propane/native_loader.rb +3 -0
- data/lib/propane/runner.rb +14 -6
- data/lib/propane/version.rb +2 -1
- data/library/boids/boids.rb +21 -11
- data/library/color_group/color_group.rb +28 -0
- data/library/control_panel/control_panel.rb +8 -5
- data/library/dxf/dxf.rb +6 -0
- data/library/file_chooser/chooser.rb +10 -9
- data/library/file_chooser/file_chooser.rb +10 -9
- data/library/library_proxy/library_proxy.rb +2 -0
- data/library/net/net.rb +7 -0
- data/library/simplex_noise/simplex_noise.rb +2 -0
- data/library/slider/slider.rb +23 -22
- data/library/vector_utils/vector_utils.rb +4 -0
- data/library/video_event/video_event.rb +4 -1
- data/mvnw +127 -51
- data/mvnw.cmd +182 -145
- data/pom.rb +53 -50
- data/pom.xml +17 -8
- data/propane.gemspec +13 -11
- data/src/main/java/monkstone/ColorUtil.java +13 -1
- data/src/main/java/monkstone/MathToolModule.java +253 -203
- data/src/main/java/monkstone/PropaneLibrary.java +2 -2
- data/src/main/java/monkstone/fastmath/Deglut.java +1 -1
- data/src/main/java/monkstone/filechooser/Chooser.java +2 -1
- data/src/main/java/monkstone/noise/SimplexNoise.java +2 -2
- data/src/main/java/monkstone/slider/CustomHorizontalSlider.java +1 -1
- data/src/main/java/monkstone/slider/CustomVerticalSlider.java +1 -1
- data/src/main/java/monkstone/slider/SimpleHorizontalSlider.java +1 -1
- data/src/main/java/monkstone/slider/SimpleVerticalSlider.java +1 -1
- data/src/main/java/monkstone/slider/SliderBar.java +1 -1
- data/src/main/java/monkstone/slider/SliderGroup.java +1 -1
- data/src/main/java/monkstone/slider/WheelHandler.java +7 -6
- data/src/main/java/monkstone/vecmath/package-info.java +1 -1
- data/src/main/java/monkstone/vecmath/vec2/Vec2.java +2 -2
- data/src/main/java/monkstone/vecmath/vec3/Vec3.java +1 -1
- data/src/main/java/monkstone/videoevent/CaptureEvent.java +27 -0
- data/src/main/java/monkstone/videoevent/{VideoInterface.java → MovieEvent.java} +11 -27
- data/src/main/java/monkstone/videoevent/package-info.java +1 -1
- data/src/main/java/processing/awt/PGraphicsJava2D.java +2164 -1661
- data/src/main/java/processing/awt/PImageAWT.java +377 -0
- data/src/main/java/processing/awt/PShapeJava2D.java +280 -268
- data/src/main/java/processing/awt/PSurfaceAWT.java +942 -829
- data/src/main/java/processing/awt/ShimAWT.java +581 -0
- data/src/main/java/processing/core/PApplet.java +831 -824
- data/src/main/java/processing/core/PConstants.java +477 -447
- data/src/main/java/processing/core/PFont.java +914 -880
- data/src/main/java/processing/core/PGraphics.java +229 -213
- data/src/main/java/processing/core/PImage.java +620 -318
- data/src/main/java/processing/core/PMatrix.java +172 -159
- data/src/main/java/processing/core/PMatrix2D.java +478 -409
- data/src/main/java/processing/core/PMatrix3D.java +762 -735
- data/src/main/java/processing/core/PShape.java +2888 -2652
- data/src/main/java/processing/core/PShapeOBJ.java +436 -415
- data/src/main/java/processing/core/PShapeSVG.java +1702 -1479
- data/src/main/java/processing/core/PStyle.java +40 -37
- data/src/main/java/processing/core/PSurface.java +139 -97
- data/src/main/java/processing/core/PSurfaceNone.java +296 -208
- data/src/main/java/processing/core/PVector.java +997 -965
- data/src/main/java/processing/core/ThinkDifferent.java +12 -17
- data/src/main/java/processing/data/DoubleDict.java +756 -710
- data/src/main/java/processing/data/DoubleList.java +749 -696
- data/src/main/java/processing/data/FloatDict.java +748 -702
- data/src/main/java/processing/data/FloatList.java +751 -697
- data/src/main/java/processing/data/IntDict.java +720 -673
- data/src/main/java/processing/data/IntList.java +699 -633
- data/src/main/java/processing/data/JSONArray.java +931 -873
- data/src/main/java/processing/data/JSONObject.java +1262 -1165
- data/src/main/java/processing/data/JSONTokener.java +351 -341
- data/src/main/java/processing/data/LongDict.java +710 -663
- data/src/main/java/processing/data/LongList.java +701 -635
- data/src/main/java/processing/data/Sort.java +37 -41
- data/src/main/java/processing/data/StringDict.java +525 -486
- data/src/main/java/processing/data/StringList.java +626 -580
- data/src/main/java/processing/data/Table.java +3690 -3510
- data/src/main/java/processing/data/TableRow.java +182 -183
- data/src/main/java/processing/data/XML.java +957 -883
- data/src/main/java/processing/dxf/RawDXF.java +404 -0
- data/src/main/java/processing/event/Event.java +87 -66
- data/src/main/java/processing/event/KeyEvent.java +48 -41
- data/src/main/java/processing/event/MouseEvent.java +88 -113
- data/src/main/java/processing/event/TouchEvent.java +10 -6
- data/src/main/java/processing/javafx/PGraphicsFX2D.java +20 -345
- data/src/main/java/processing/javafx/PSurfaceFX.java +149 -121
- data/src/main/java/processing/net/Client.java +744 -0
- data/src/main/java/processing/net/Server.java +388 -0
- data/src/main/java/processing/opengl/FontTexture.java +289 -270
- data/src/main/java/processing/opengl/FrameBuffer.java +386 -364
- data/src/main/java/processing/opengl/LinePath.java +547 -500
- data/src/main/java/processing/opengl/LineStroker.java +588 -581
- data/src/main/java/processing/opengl/PGL.java +3047 -2914
- data/src/main/java/processing/opengl/PGraphics2D.java +408 -315
- data/src/main/java/processing/opengl/PGraphics3D.java +107 -72
- data/src/main/java/processing/opengl/PGraphicsOpenGL.java +12378 -12075
- data/src/main/java/processing/opengl/PJOGL.java +1753 -1670
- data/src/main/java/processing/opengl/PShader.java +1266 -1257
- data/src/main/java/processing/opengl/PShapeOpenGL.java +4678 -4580
- data/src/main/java/processing/opengl/PSurfaceJOGL.java +1114 -1027
- data/src/main/java/processing/opengl/Texture.java +1492 -1401
- data/src/main/java/processing/opengl/VertexBuffer.java +57 -55
- data/test/create_test.rb +21 -20
- data/test/deglut_spec_test.rb +4 -2
- data/test/helper_methods_test.rb +49 -20
- data/test/math_tool_test.rb +39 -32
- data/test/native_folder.rb +47 -0
- data/test/respond_to_test.rb +3 -2
- data/test/sketches/key_event.rb +2 -2
- data/test/sketches/library/my_library/my_library.rb +3 -0
- data/test/test_helper.rb +2 -0
- data/test/vecmath_spec_test.rb +35 -22
- data/vendors/Rakefile +33 -62
- metadata +54 -45
- data/src/main/java/processing/core/util/image/ImageLoadFacade.java +0 -161
- data/src/main/java/processing/core/util/image/ImageSaveFacade.java +0 -169
- data/src/main/java/processing/core/util/image/constants/TifConstants.java +0 -45
- data/src/main/java/processing/core/util/image/load/AwtImageLoadStrategy.java +0 -80
- data/src/main/java/processing/core/util/image/load/Base64StringImageLoadStrategy.java +0 -73
- data/src/main/java/processing/core/util/image/load/FallbackImageLoadStrategy.java +0 -70
- data/src/main/java/processing/core/util/image/load/ImageIoImageLoadStrategy.java +0 -132
- data/src/main/java/processing/core/util/image/load/ImageLoadStrategy.java +0 -48
- data/src/main/java/processing/core/util/image/load/ImageLoadUtil.java +0 -45
- data/src/main/java/processing/core/util/image/load/TgaImageLoadStrategy.java +0 -255
- data/src/main/java/processing/core/util/image/load/TiffImageLoadStrategy.java +0 -98
- data/src/main/java/processing/core/util/image/save/ImageSaveStrategy.java +0 -49
- data/src/main/java/processing/core/util/image/save/ImageSaveUtil.java +0 -48
- data/src/main/java/processing/core/util/image/save/ImageWriterImageSaveStrategy.java +0 -179
- data/src/main/java/processing/core/util/image/save/SaveImageException.java +0 -41
- data/src/main/java/processing/core/util/image/save/TgaImageSaveStrategy.java +0 -198
- data/src/main/java/processing/core/util/image/save/TiffImageSaveStrategy.java +0 -91
- data/src/main/java/processing/core/util/image/save/TiffNakedFilenameImageSaveStrategy.java +0 -57
- data/src/main/java/processing/core/util/io/InputFactory.java +0 -285
- data/src/main/java/processing/core/util/io/PathUtil.java +0 -109
- data/src/main/java/processing/opengl/shaders/LightVert-brcm.glsl +0 -154
- data/src/main/java/processing/opengl/shaders/LightVert-vc4.glsl +0 -154
- data/src/main/java/processing/opengl/shaders/TexLightVert-brcm.glsl +0 -160
- data/src/main/java/processing/opengl/shaders/TexLightVert-vc4.glsl +0 -160
@@ -207,12 +207,12 @@ public class PGraphics extends PImage implements PConstants {
|
|
207
207
|
/**
|
208
208
|
* Array of hint[] items. These are hacks to get around various
|
209
209
|
* temporary workarounds inside the environment.
|
210
|
-
*
|
210
|
+
*
|
211
211
|
* Note that this array cannot be static, as a hint() may result in a
|
212
212
|
* runtime change specific to a renderer. For instance, calling
|
213
213
|
* hint(DISABLE_DEPTH_TEST) has to call glDisable() right away on an
|
214
214
|
* instance of PGraphicsOpenGL.
|
215
|
-
*
|
215
|
+
*
|
216
216
|
* The hints[] array is allocated early on because it might
|
217
217
|
* be used inside beginDraw(), allocate(), etc.
|
218
218
|
*/
|
@@ -570,7 +570,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
570
570
|
|
571
571
|
// vertices
|
572
572
|
public static final int DEFAULT_VERTICES = 512;
|
573
|
-
protected float
|
573
|
+
protected float[][] vertices =
|
574
574
|
new float[DEFAULT_VERTICES][VERTEX_FIELD_COUNT];
|
575
575
|
protected int vertexCount; // total number of vertices
|
576
576
|
|
@@ -605,7 +605,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
605
605
|
|
606
606
|
// spline vertices
|
607
607
|
|
608
|
-
protected float
|
608
|
+
protected float[][] curveVertices;
|
609
609
|
protected int curveVertexCount;
|
610
610
|
|
611
611
|
// ........................................................
|
@@ -618,8 +618,8 @@ public class PGraphics extends PImage implements PConstants {
|
|
618
618
|
// [toxi 031031]
|
619
619
|
// changed table's precision to 0.5 degree steps
|
620
620
|
// introduced new vars for more flexible code
|
621
|
-
static final protected float sinLUT
|
622
|
-
static final protected float cosLUT
|
621
|
+
static final protected float[] sinLUT;
|
622
|
+
static final protected float[] cosLUT;
|
623
623
|
static final protected float SINCOS_PRECISION = 0.5f;
|
624
624
|
static final protected int SINCOS_LENGTH = (int) (360f / SINCOS_PRECISION);
|
625
625
|
static {
|
@@ -702,7 +702,9 @@ public class PGraphics extends PImage implements PConstants {
|
|
702
702
|
|
703
703
|
// [toxi031031] new & faster sphere code w/ support flexible resolutions
|
704
704
|
// will be set by sphereDetail() or 1st call to sphere()
|
705
|
-
protected float
|
705
|
+
protected float[] sphereX;
|
706
|
+
protected float[] sphereY;
|
707
|
+
protected float[] sphereZ;
|
706
708
|
|
707
709
|
/// Number of U steps (aka "theta") around longitudinally spanning 2*pi
|
708
710
|
public int sphereDetailU = 0;
|
@@ -737,9 +739,10 @@ public class PGraphics extends PImage implements PConstants {
|
|
737
739
|
|
738
740
|
|
739
741
|
/**
|
740
|
-
* Set (or unset) this as the main drawing surface.
|
741
|
-
|
742
|
-
|
742
|
+
* Set (or unset) this as the main drawing surface.Meaning that it can
|
743
|
+
safely be set to opaque (and given a default gray background), or anything
|
744
|
+
else that goes along with that.
|
745
|
+
* @param primary
|
743
746
|
*/
|
744
747
|
public void setPrimary(boolean primary) { // ignore
|
745
748
|
this.primaryGraphics = primary;
|
@@ -764,15 +767,14 @@ public class PGraphics extends PImage implements PConstants {
|
|
764
767
|
|
765
768
|
|
766
769
|
/**
|
767
|
-
* The final step in setting up a renderer, set its size of this renderer.
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
*
|
774
|
-
*
|
775
|
-
* animation thread.
|
770
|
+
* The final step in setting up a renderer, set its size of this renderer.This was formerly handled by the constructor, but instead it's been broken
|
771
|
+
out so that setParent/setPrimary/setPath can be handled differently.Important: this is ignored by the Methods task because otherwise it will
|
772
|
+
override setSize() in PApplet/Applet/Component, which will 1) not call
|
773
|
+
super.setSize(), and 2) will cause the renderer to be resized from the
|
774
|
+
event thread (EDT), causing a nasty crash as it collides with the
|
775
|
+
animation thread.
|
776
|
+
* @param w
|
777
|
+
* @param h
|
776
778
|
*/
|
777
779
|
public void setSize(int w, int h) { // ignore
|
778
780
|
width = w;
|
@@ -841,10 +843,11 @@ public class PGraphics extends PImage implements PConstants {
|
|
841
843
|
|
842
844
|
|
843
845
|
/**
|
844
|
-
* Get cache storage data for the specified renderer.
|
845
|
-
|
846
|
-
|
847
|
-
|
846
|
+
* Get cache storage data for the specified renderer.Because each renderer
|
847
|
+
will cache data in different formats, it's necessary to store cache data
|
848
|
+
keyed by the renderer object. Otherwise, attempting to draw the same
|
849
|
+
image to both a PGraphicsJava2D and a PGraphicsOpenGL will cause errors.
|
850
|
+
* @param image
|
848
851
|
* @return metadata stored for the specified renderer
|
849
852
|
*/
|
850
853
|
public Object getCache(PImage image) { // ignore
|
@@ -910,7 +913,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
910
913
|
*
|
911
914
|
* ( end auto-generated )
|
912
915
|
* <h3>Advanced</h3>
|
913
|
-
*
|
916
|
+
*
|
914
917
|
* When creating your own PGraphics, you should call this when
|
915
918
|
* you're finished drawing.
|
916
919
|
*
|
@@ -1087,7 +1090,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
1087
1090
|
* obscure rendering features that cannot be implemented in a consistent
|
1088
1091
|
* manner across renderers. Many options will often graduate to standard
|
1089
1092
|
* features instead of hints over time.
|
1090
|
-
*
|
1093
|
+
*
|
1091
1094
|
* hint(ENABLE_OPENGL_4X_SMOOTH) - Enable 4x anti-aliasing for P3D. This
|
1092
1095
|
* can help force anti-aliasing if it has not been enabled by the user. On
|
1093
1096
|
* some graphics cards, this can also be set by the graphics driver's
|
@@ -1095,13 +1098,13 @@ public class PGraphics extends PImage implements PConstants {
|
|
1095
1098
|
* be called immediately after the size() command because it resets the
|
1096
1099
|
* renderer, obliterating any settings and anything drawn (and like size(),
|
1097
1100
|
* re-running the code that came before it again).
|
1098
|
-
*
|
1101
|
+
*
|
1099
1102
|
* hint(DISABLE_OPENGL_2X_SMOOTH) - In Processing 1.0, Processing always
|
1100
1103
|
* enables 2x smoothing when the P3D renderer is used. This hint disables
|
1101
1104
|
* the default 2x smoothing and returns the smoothing behavior found in
|
1102
1105
|
* earlier releases, where smooth() and noSmooth() could be used to enable
|
1103
1106
|
* and disable smoothing, though the quality was inferior.
|
1104
|
-
*
|
1107
|
+
*
|
1105
1108
|
* hint(ENABLE_NATIVE_FONTS) - Use the native version fonts when they are
|
1106
1109
|
* installed, rather than the bitmapped version from a .vlw file. This is
|
1107
1110
|
* useful with the default (or JAVA2D) renderer setting, as it will improve
|
@@ -1110,7 +1113,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
1110
1113
|
* machine (because you have the font installed) but lousy on others'
|
1111
1114
|
* machines if the identical font is unavailable. This option can only be
|
1112
1115
|
* set per-sketch, and must be called before any use of textFont().
|
1113
|
-
*
|
1116
|
+
*
|
1114
1117
|
* hint(DISABLE_DEPTH_TEST) - Disable the zbuffer, allowing you to draw on
|
1115
1118
|
* top of everything at will. When depth testing is disabled, items will be
|
1116
1119
|
* drawn to the screen sequentially, like a painting. This hint is most
|
@@ -1120,14 +1123,14 @@ public class PGraphics extends PImage implements PConstants {
|
|
1120
1123
|
* hint(ENABLE_DEPTH_TEST), but note that with the depth buffer cleared,
|
1121
1124
|
* any 3D drawing that happens later in draw() will ignore existing shapes
|
1122
1125
|
* on the screen.
|
1123
|
-
*
|
1126
|
+
*
|
1124
1127
|
* hint(ENABLE_DEPTH_SORT) - Enable primitive z-sorting of triangles and
|
1125
1128
|
* lines in P3D and OPENGL. This can slow performance considerably, and the
|
1126
1129
|
* algorithm is not yet perfect. Restore the default with hint(DISABLE_DEPTH_SORT).
|
1127
|
-
*
|
1130
|
+
*
|
1128
1131
|
* hint(DISABLE_OPENGL_ERROR_REPORT) - Speeds up the P3D renderer setting
|
1129
1132
|
* by not checking for errors while running. Undo with hint(ENABLE_OPENGL_ERROR_REPORT).
|
1130
|
-
*
|
1133
|
+
*
|
1131
1134
|
* hint(ENABLE_BUFFER_READING) - Depth and stencil buffers in P2D/P3D will be
|
1132
1135
|
* downsampled to make PGL#readPixels work with multisampling. Enabling this
|
1133
1136
|
* introduces some overhead, so if you experience bad performance, disable
|
@@ -1136,17 +1139,17 @@ public class PGraphics extends PImage implements PConstants {
|
|
1136
1139
|
* creating your PGraphics2D/3D. You can restore the default with
|
1137
1140
|
* hint(DISABLE_BUFFER_READING) if you don't plan to read depth from
|
1138
1141
|
* this PGraphics anymore.
|
1139
|
-
*
|
1142
|
+
*
|
1140
1143
|
* hint(ENABLE_KEY_REPEAT) - Auto-repeating key events are discarded
|
1141
1144
|
* by default (works only in P2D/P3D); use this hint to get all the key events
|
1142
1145
|
* (including auto-repeated). Call hint(DISABLE_KEY_REPEAT) to get events
|
1143
1146
|
* only when the key goes physically up or down.
|
1144
|
-
*
|
1147
|
+
*
|
1145
1148
|
* hint(DISABLE_ASYNC_SAVEFRAME) - P2D/P3D only - save() and saveFrame()
|
1146
1149
|
* will not use separate threads for saving and will block until the image
|
1147
1150
|
* is written to the drive. This was the default behavior in 3.0b7 and before.
|
1148
1151
|
* To enable, call hint(ENABLE_ASYNC_SAVEFRAME).
|
1149
|
-
*
|
1152
|
+
*
|
1150
1153
|
* As of release 0149, unhint() has been removed in favor of adding
|
1151
1154
|
* additional ENABLE/DISABLE constants to reset the default behavior. This
|
1152
1155
|
* prevents the double negatives, and also reinforces which hints can be
|
@@ -1208,12 +1211,12 @@ public class PGraphics extends PImage implements PConstants {
|
|
1208
1211
|
* specifies a position in 2D and the <b>vertex()</b> function with three
|
1209
1212
|
* parameters specifies a position in 3D. Each shape will be outlined with
|
1210
1213
|
* the current stroke color and filled with the fill color.
|
1211
|
-
*
|
1214
|
+
*
|
1212
1215
|
* Transformations such as <b>translate()</b>, <b>rotate()</b>, and
|
1213
1216
|
* <b>scale()</b> do not work within <b>beginShape()</b>. It is also not
|
1214
1217
|
* possible to use other shapes, such as <b>ellipse()</b> or <b>rect()</b>
|
1215
1218
|
* within <b>beginShape()</b>.
|
1216
|
-
*
|
1219
|
+
*
|
1217
1220
|
* The P3D renderer settings allow <b>stroke()</b> and <b>fill()</b>
|
1218
1221
|
* settings to be altered per-vertex, however the default P2D renderer does
|
1219
1222
|
* not. Settings such as <b>strokeWeight()</b>, <b>strokeCap()</b>, and
|
@@ -1235,8 +1238,8 @@ public class PGraphics extends PImage implements PConstants {
|
|
1235
1238
|
|
1236
1239
|
|
1237
1240
|
/**
|
1238
|
-
* Sets whether the upcoming vertex is part of an edge.
|
1239
|
-
*
|
1241
|
+
* Sets whether the upcoming vertex is part of an edge.Equivalent to glEdgeFlag(), for people familiar with OpenGL.
|
1242
|
+
* @param edge
|
1240
1243
|
*/
|
1241
1244
|
public void edge(boolean edge) {
|
1242
1245
|
this.edge = edge;
|
@@ -1358,7 +1361,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
1358
1361
|
* Sets a texture to be applied to vertex points. The <b>texture()</b>
|
1359
1362
|
* function must be called between <b>beginShape()</b> and
|
1360
1363
|
* <b>endShape()</b> and before any calls to <b>vertex()</b>.
|
1361
|
-
*
|
1364
|
+
*
|
1362
1365
|
* When textures are in use, the fill color is ignored. Instead, use tint()
|
1363
1366
|
* to specify the color of the texture as it is applied to the shape.
|
1364
1367
|
*
|
@@ -1388,7 +1391,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
1388
1391
|
|
1389
1392
|
protected void vertexCheck() {
|
1390
1393
|
if (vertexCount == vertices.length) {
|
1391
|
-
float
|
1394
|
+
float[][] temp = new float[vertexCount << 1][VERTEX_FIELD_COUNT];
|
1392
1395
|
System.arraycopy(vertices, 0, temp, 0, vertexCount);
|
1393
1396
|
vertices = temp;
|
1394
1397
|
}
|
@@ -1480,7 +1483,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
1480
1483
|
// http://dev.processing.org/bugs/show_bug.cgi?id=444
|
1481
1484
|
if (shape == POLYGON) {
|
1482
1485
|
if (vertexCount > 0) {
|
1483
|
-
float
|
1486
|
+
float[] pvertex = vertices[vertexCount-1];
|
1484
1487
|
if ((Math.abs(pvertex[X] - x) < EPSILON) &&
|
1485
1488
|
(Math.abs(pvertex[Y] - y) < EPSILON) &&
|
1486
1489
|
(Math.abs(pvertex[Z] - z) < EPSILON)) {
|
@@ -1605,11 +1608,11 @@ public class PGraphics extends PImage implements PConstants {
|
|
1605
1608
|
* All shapes are constructed by connecting a series of vertices.
|
1606
1609
|
* <b>vertex()</b> is used to specify the vertex coordinates for points,
|
1607
1610
|
* lines, triangles, quads, and polygons and is used exclusively within the
|
1608
|
-
* <b>beginShape()</b> and <b>endShape()</b> function
|
1609
|
-
*
|
1611
|
+
* <b>beginShape()</b> and <b>endShape()</b> function.
|
1612
|
+
*
|
1610
1613
|
* Drawing a vertex in 3D using the <b>z</b> parameter requires the P3D
|
1611
|
-
* parameter in combination with size as shown in the above example
|
1612
|
-
*
|
1614
|
+
* parameter in combination with size as shown in the above example.
|
1615
|
+
*
|
1613
1616
|
* This function is also used to map a texture onto the geometry. The
|
1614
1617
|
* <b>texture()</b> function declares the texture to apply to the geometry
|
1615
1618
|
* and the <b>u</b> and <b>v</b> coordinates set define the mapping of this
|
@@ -1647,18 +1650,18 @@ public class PGraphics extends PImage implements PConstants {
|
|
1647
1650
|
|
1648
1651
|
|
1649
1652
|
/**
|
1650
|
-
* Set (U, V) coords for the next vertex in the current shape.
|
1651
|
-
|
1652
|
-
|
1653
|
-
|
1654
|
-
* param of and overloaded vertex().
|
1655
|
-
* <p/>
|
1653
|
+
* Set (U, V) coords for the next vertex in the current shape.This is ugly as its own function, and will (almost?) always be
|
1654
|
+
coincident with a call to vertex.As of beta, this was moved to
|
1655
|
+
the protected method you see here, and called from an optional
|
1656
|
+
param of and overloaded vertex().
|
1656
1657
|
* The parameters depend on the current textureMode. When using
|
1657
|
-
|
1658
|
-
|
1659
|
-
|
1660
|
-
|
1661
|
-
|
1658
|
+
textureMode(IMAGE), the coordinates will be relative to the size
|
1659
|
+
of the image texture, when used with textureMode(NORMAL),
|
1660
|
+
they'll be in the range 0..1.
|
1661
|
+
|
1662
|
+
Used by both PGraphics2D (for images) and PGraphics3D.
|
1663
|
+
* @param u
|
1664
|
+
* @param v
|
1662
1665
|
*/
|
1663
1666
|
protected void vertexTexture(float u, float v) {
|
1664
1667
|
if (textureImage == null) {
|
@@ -1735,6 +1738,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
1735
1738
|
|
1736
1739
|
|
1737
1740
|
/**
|
1741
|
+
* @return
|
1738
1742
|
* @webref shape
|
1739
1743
|
* @param filename name of file to load, can be .svg or .obj
|
1740
1744
|
* @see PShape
|
@@ -2732,11 +2736,11 @@ public class PGraphics extends PImage implements PConstants {
|
|
2732
2736
|
/**
|
2733
2737
|
* ( begin auto-generated from square.xml )
|
2734
2738
|
*
|
2735
|
-
* Draws a square to the screen. A square is a four-sided shape with
|
2736
|
-
* every angle at ninety degrees and each side is the same length.
|
2737
|
-
* By default, the first two parameters set the location of the
|
2738
|
-
* upper-left corner, the third sets the width and height. The way
|
2739
|
-
* these parameters are interpreted, however, may be changed with the
|
2739
|
+
* Draws a square to the screen. A square is a four-sided shape with
|
2740
|
+
* every angle at ninety degrees and each side is the same length.
|
2741
|
+
* By default, the first two parameters set the location of the
|
2742
|
+
* upper-left corner, the third sets the width and height. The way
|
2743
|
+
* these parameters are interpreted, however, may be changed with the
|
2740
2744
|
* <b>rectMode()</b> function.
|
2741
2745
|
*
|
2742
2746
|
* ( end auto-generated )
|
@@ -2931,9 +2935,9 @@ public class PGraphics extends PImage implements PConstants {
|
|
2931
2935
|
/**
|
2932
2936
|
* ( begin auto-generated from circle.xml )
|
2933
2937
|
*
|
2934
|
-
* Draws a circle to the screen. By default, the first two parameters
|
2935
|
-
* set the location of the center, and the third sets the shape's width
|
2936
|
-
* and height. The origin may be changed with the <b>ellipseMode()</b>
|
2938
|
+
* Draws a circle to the screen. By default, the first two parameters
|
2939
|
+
* set the location of the center, and the third sets the shape's width
|
2940
|
+
* and height. The origin may be changed with the <b>ellipseMode()</b>
|
2937
2941
|
* function.
|
2938
2942
|
*
|
2939
2943
|
* ( end auto-generated )
|
@@ -3424,17 +3428,17 @@ public class PGraphics extends PImage implements PConstants {
|
|
3424
3428
|
* ( begin auto-generated from curvePoint.xml )
|
3425
3429
|
*
|
3426
3430
|
* Evalutes the curve at point t for points a, b, c, d. The parameter t
|
3427
|
-
* varies between 0 and 1, a and d are
|
3428
|
-
* the
|
3431
|
+
* varies between 0 and 1, a and d are the control points, and b and c are
|
3432
|
+
* the points on the curve. This can be done once with the x coordinates and a
|
3429
3433
|
* second time with the y coordinates to get the location of a curve at t.
|
3430
3434
|
*
|
3431
3435
|
* ( end auto-generated )
|
3432
3436
|
*
|
3433
3437
|
* @webref shape:curves
|
3434
|
-
* @param a coordinate of first point
|
3435
|
-
* @param b coordinate of
|
3436
|
-
* @param c coordinate of
|
3437
|
-
* @param d coordinate of
|
3438
|
+
* @param a coordinate of first control point
|
3439
|
+
* @param b coordinate of first point on the curve
|
3440
|
+
* @param c coordinate of second point on the curve
|
3441
|
+
* @param d coordinate of second control point
|
3438
3442
|
* @param t value between 0 and 1
|
3439
3443
|
* @see PGraphics#curve(float, float, float, float, float, float, float, float, float, float, float, float)
|
3440
3444
|
* @see PGraphics#curveVertex(float, float)
|
@@ -3460,7 +3464,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
3460
3464
|
*
|
3461
3465
|
* Calculates the tangent of a point on a curve. There's a good definition
|
3462
3466
|
* of <em><a href="http://en.wikipedia.org/wiki/Tangent"
|
3463
|
-
* target="new">tangent
|
3467
|
+
* target="new">tangent on Wikipedia</a></em>.
|
3464
3468
|
*
|
3465
3469
|
* ( end auto-generated )
|
3466
3470
|
*
|
@@ -3746,8 +3750,8 @@ public class PGraphics extends PImage implements PConstants {
|
|
3746
3750
|
* <b>image()</b> to set the location of one corner of the image and uses
|
3747
3751
|
* the fourth and fifth parameters to set the opposite corner. Use
|
3748
3752
|
* <b>imageMode(CENTER)</b> to draw images centered at the given x and y
|
3749
|
-
* position
|
3750
|
-
*
|
3753
|
+
* position.
|
3754
|
+
*
|
3751
3755
|
* The parameter to <b>imageMode()</b> must be written in ALL CAPS because
|
3752
3756
|
* Processing is a case-sensitive language.
|
3753
3757
|
*
|
@@ -3781,13 +3785,13 @@ public class PGraphics extends PImage implements PConstants {
|
|
3781
3785
|
* <b>x</b> and <b>y</b> parameters define the location of the image from
|
3782
3786
|
* its upper-left corner. The image is displayed at its original size
|
3783
3787
|
* unless the <b>width</b> and <b>height</b> parameters specify a different
|
3784
|
-
* size
|
3785
|
-
*
|
3788
|
+
* size.
|
3789
|
+
*
|
3786
3790
|
* The <b>imageMode()</b> function changes the way the parameters work. For
|
3787
3791
|
* example, a call to <b>imageMode(CORNERS)</b> will change the
|
3788
3792
|
* <b>width</b> and <b>height</b> parameters to define the x and y values
|
3789
|
-
* of the opposite corner of the image
|
3790
|
-
*
|
3793
|
+
* of the opposite corner of the image.
|
3794
|
+
*
|
3791
3795
|
* The color of an image may be modified with the <b>tint()</b> function.
|
3792
3796
|
* This function will maintain transparency for GIF and PNG images.
|
3793
3797
|
*
|
@@ -3891,7 +3895,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
3891
3895
|
/**
|
3892
3896
|
* Expects x1, y1, x2, y2 coordinates where (x2 >= x1) and (y2 >= y1).
|
3893
3897
|
* If tint() has been called, the image will be colored.
|
3894
|
-
*
|
3898
|
+
*
|
3895
3899
|
* The default implementation draws an image as a textured quad.
|
3896
3900
|
* The (u, v) coordinates are in image space (they're ints, after all..)
|
3897
3901
|
*/
|
@@ -4016,7 +4020,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
4016
4020
|
* to <b>shapeMode(CORNERS)</b>, for example, will change the width and
|
4017
4021
|
* height parameters to define the x and y values of the opposite corner of
|
4018
4022
|
* the shape.
|
4019
|
-
*
|
4023
|
+
*
|
4020
4024
|
* Note complex shapes may draw awkwardly with P3D. This renderer does not
|
4021
4025
|
* yet support shapes that have holes or complicated breaks.
|
4022
4026
|
*
|
@@ -4165,7 +4169,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
4165
4169
|
* CENTER, and RIGHT set the display characteristics of the letters in
|
4166
4170
|
* relation to the values for the <b>x</b> and <b>y</b> parameters of the
|
4167
4171
|
* <b>text()</b> function.
|
4168
|
-
*
|
4172
|
+
*
|
4169
4173
|
* In Processing 0125 and later, an optional second parameter can be used
|
4170
4174
|
* to vertically align the text. BASELINE is the default, and the vertical
|
4171
4175
|
* alignment will be reset to BASELINE if the second parameter is not used.
|
@@ -4173,12 +4177,12 @@ public class PGraphics extends PImage implements PConstants {
|
|
4173
4177
|
* offsets the line based on the current <b>textDescent()</b>. For multiple
|
4174
4178
|
* lines, the final line will be aligned to the bottom, with the previous
|
4175
4179
|
* lines appearing above it.
|
4176
|
-
*
|
4180
|
+
*
|
4177
4181
|
* When using <b>text()</b> with width and height parameters, BASELINE is
|
4178
4182
|
* ignored, and treated as TOP. (Otherwise, text would by default draw
|
4179
4183
|
* outside the box, since BASELINE is the default setting. BASELINE is not
|
4180
4184
|
* a useful drawing mode for text drawn in a rectangle.)
|
4181
|
-
*
|
4185
|
+
*
|
4182
4186
|
* The vertical alignment is based on the value of <b>textAscent()</b>,
|
4183
4187
|
* which many fonts do not specify correctly. It may be necessary to use a
|
4184
4188
|
* hack and offset by a few pixels by hand so that the offset looks
|
@@ -4255,10 +4259,10 @@ public class PGraphics extends PImage implements PConstants {
|
|
4255
4259
|
* <b>text()</b> function. If no <b>size</b> parameter is input, the font
|
4256
4260
|
* will appear at its original size (the size it was created at with the
|
4257
4261
|
* "Create Font..." tool) until it is changed with <b>textSize()</b>. <br
|
4258
|
-
* />
|
4262
|
+
* /> Because fonts are usually bitmaped, you should create fonts at
|
4259
4263
|
* the sizes that will be used most commonly. Using <b>textFont()</b>
|
4260
4264
|
* without the size parameter will result in the cleanest-looking text. <br
|
4261
|
-
*
|
4265
|
+
* /> With the default (JAVA2D) and PDF renderers, it's also possible
|
4262
4266
|
* to enable the use of native fonts via the command
|
4263
4267
|
* <b>hint(ENABLE_NATIVE_FONTS)</b>. This will produce vector text in
|
4264
4268
|
* JAVA2D sketches and PDF output in cases where the vector data is
|
@@ -4372,16 +4376,16 @@ public class PGraphics extends PImage implements PConstants {
|
|
4372
4376
|
*
|
4373
4377
|
* Sets the way text draws to the screen. In the default configuration, the
|
4374
4378
|
* <b>MODEL</b> mode, it's possible to rotate, scale, and place letters in
|
4375
|
-
* two and three dimensional space
|
4376
|
-
*
|
4379
|
+
* two and three dimensional space.
|
4380
|
+
*
|
4377
4381
|
* The <b>SHAPE</b> mode draws text using the the glyph outlines of
|
4378
4382
|
* individual characters rather than as textures. This mode is only
|
4379
4383
|
* supported with the <b>PDF</b> and <b>P3D</b> renderer settings. With the
|
4380
4384
|
* <b>PDF</b> renderer, you must call <b>textMode(SHAPE)</b> before any
|
4381
4385
|
* other drawing occurs. If the outlines are not available, then
|
4382
4386
|
* <b>textMode(SHAPE)</b> will be ignored and <b>textMode(MODEL)</b> will
|
4383
|
-
* be used instead
|
4384
|
-
*
|
4387
|
+
* be used instead.
|
4388
|
+
*
|
4385
4389
|
* The <b>textMode(SHAPE)</b> option in <b>P3D</b> can be combined with
|
4386
4390
|
* <b>beginRaw()</b> to write vector-accurate text to 2D and 3D output
|
4387
4391
|
* files, for instance <b>DXF</b> or <b>PDF</b>. The <b>SHAPE</b> mode is
|
@@ -4551,7 +4555,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
4551
4555
|
* Unlike the previous version that was inside PFont, this will
|
4552
4556
|
* return the size not of a 1 pixel font, but the actual current size.
|
4553
4557
|
*/
|
4554
|
-
protected float textWidthImpl(char buffer
|
4558
|
+
protected float textWidthImpl(char[] buffer, int start, int stop) {
|
4555
4559
|
float wide = 0;
|
4556
4560
|
for (int i = start; i < stop; i++) {
|
4557
4561
|
// could add kerning here, but it just ain't implemented
|
@@ -4575,7 +4579,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
4575
4579
|
* with the <b>fill()</b> function. The text displays in relation to the
|
4576
4580
|
* <b>textAlign()</b> function, which gives the option to draw to the left,
|
4577
4581
|
* right, and center of the coordinates.
|
4578
|
-
*
|
4582
|
+
*
|
4579
4583
|
* The <b>x2</b> and <b>y2</b> parameters define a rectangular area to
|
4580
4584
|
* display within and may only be used with string data. For text drawn
|
4581
4585
|
* inside a rectangle, the coordinates are interpreted based on the current
|
@@ -4745,11 +4749,11 @@ public class PGraphics extends PImage implements PConstants {
|
|
4745
4749
|
* Draw text in a box that is constrained to a particular size.
|
4746
4750
|
* The current rectMode() determines what the coordinates mean
|
4747
4751
|
* (whether x1/y1/x2/y2 or x/y/w/h).
|
4748
|
-
*
|
4752
|
+
*
|
4749
4753
|
* Note that the x,y coords of the start of the box
|
4750
4754
|
* will align with the *ascent* of the text, not the baseline,
|
4751
4755
|
* as is the case for the other text() functions.
|
4752
|
-
*
|
4756
|
+
*
|
4753
4757
|
* Newlines that are \n (Unix newline or linefeed char, ascii 10)
|
4754
4758
|
* are honored, and \r (carriage return, Windows and Mac OS) are
|
4755
4759
|
* ignored.
|
@@ -5019,7 +5023,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5019
5023
|
* Handles placement of a text line, then calls textLineImpl
|
5020
5024
|
* to actually render at the specific point.
|
5021
5025
|
*/
|
5022
|
-
protected void textLineAlignImpl(char buffer
|
5026
|
+
protected void textLineAlignImpl(char[] buffer, int start, int stop,
|
5023
5027
|
float x, float y) {
|
5024
5028
|
if (textAlign == CENTER) {
|
5025
5029
|
x -= textWidthImpl(buffer, start, stop) / 2f;
|
@@ -5035,7 +5039,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5035
5039
|
/**
|
5036
5040
|
* Implementation of actual drawing for a line of text.
|
5037
5041
|
*/
|
5038
|
-
protected void textLineImpl(char buffer
|
5042
|
+
protected void textLineImpl(char[] buffer, int start, int stop,
|
5039
5043
|
float x, float y) {
|
5040
5044
|
for (int index = start; index < stop; index++) {
|
5041
5045
|
textCharImpl(buffer[index], x, y);
|
@@ -5167,28 +5171,28 @@ public class PGraphics extends PImage implements PConstants {
|
|
5167
5171
|
/**
|
5168
5172
|
* ( begin auto-generated from push.xml )
|
5169
5173
|
*
|
5170
|
-
* The <b>push()</b> function saves the current drawing style
|
5171
|
-
* settings and transformations, while <b>pop()</b> restores these
|
5172
|
-
* settings. Note that these functions are always used together.
|
5173
|
-
* They allow you to change the style and transformation settings
|
5174
|
-
* and later return to what you had. When a new state is started
|
5175
|
-
* with push(), it builds on the current style and transform
|
5176
|
-
* information
|
5177
|
-
*
|
5178
|
-
* <b>push()</b> stores information related to the current
|
5179
|
-
* transformation state and style settings controlled by the
|
5180
|
-
* following functions: <b>rotate()</b>, <b>translate()</b>,
|
5181
|
-
* <b>scale()</b>, <b>fill()</b>, <b>stroke()</b>, <b>tint()</b>,
|
5182
|
-
* <b>strokeWeight()</b>, <b>strokeCap()</b>, <b>strokeJoin()</b>,
|
5183
|
-
* <b>imageMode()</b>, <b>rectMode()</b>, <b>ellipseMode()</b>,
|
5184
|
-
* <b>colorMode()</b>, <b>textAlign()</b>, <b>textFont()</b>,
|
5185
|
-
* <b>textMode()</b>, <b>textSize()</b>, <b>textLeading()</b
|
5186
|
-
*
|
5187
|
-
* The <b>push()</b> and <b>pop()</b> functions were added with
|
5188
|
-
* Processing 3.5. They can be used in place of <b>pushMatrix()</b>,
|
5189
|
-
* <b>popMatrix()</b>, <b>pushStyles()</b>, and <b>popStyles()</b>.
|
5190
|
-
* The difference is that push() and pop() control both the
|
5191
|
-
* transformations (rotate, scale, translate) and the drawing styles
|
5174
|
+
* The <b>push()</b> function saves the current drawing style
|
5175
|
+
* settings and transformations, while <b>pop()</b> restores these
|
5176
|
+
* settings. Note that these functions are always used together.
|
5177
|
+
* They allow you to change the style and transformation settings
|
5178
|
+
* and later return to what you had. When a new state is started
|
5179
|
+
* with push(), it builds on the current style and transform
|
5180
|
+
* information.
|
5181
|
+
*
|
5182
|
+
* <b>push()</b> stores information related to the current
|
5183
|
+
* transformation state and style settings controlled by the
|
5184
|
+
* following functions: <b>rotate()</b>, <b>translate()</b>,
|
5185
|
+
* <b>scale()</b>, <b>fill()</b>, <b>stroke()</b>, <b>tint()</b>,
|
5186
|
+
* <b>strokeWeight()</b>, <b>strokeCap()</b>, <b>strokeJoin()</b>,
|
5187
|
+
* <b>imageMode()</b>, <b>rectMode()</b>, <b>ellipseMode()</b>,
|
5188
|
+
* <b>colorMode()</b>, <b>textAlign()</b>, <b>textFont()</b>,
|
5189
|
+
* <b>textMode()</b>, <b>textSize()</b>, <b>textLeading()</b>.
|
5190
|
+
*
|
5191
|
+
* The <b>push()</b> and <b>pop()</b> functions were added with
|
5192
|
+
* Processing 3.5. They can be used in place of <b>pushMatrix()</b>,
|
5193
|
+
* <b>popMatrix()</b>, <b>pushStyles()</b>, and <b>popStyles()</b>.
|
5194
|
+
* The difference is that push() and pop() control both the
|
5195
|
+
* transformations (rotate, scale, translate) and the drawing styles
|
5192
5196
|
* at the same time.
|
5193
5197
|
*
|
5194
5198
|
* ( end auto-generated )
|
@@ -5204,28 +5208,28 @@ public class PGraphics extends PImage implements PConstants {
|
|
5204
5208
|
/**
|
5205
5209
|
* ( begin auto-generated from pop.xml )
|
5206
5210
|
*
|
5207
|
-
* The <b>pop()</b> function restores the previous drawing style
|
5208
|
-
* settings and transformations after <b>push()</b> has changed them.
|
5209
|
-
* Note that these functions are always used together. They allow
|
5210
|
-
* you to change the style and transformation settings and later
|
5211
|
-
* return to what you had. When a new state is started with push(),
|
5212
|
-
* it builds on the current style and transform information
|
5213
|
-
*
|
5214
|
-
*
|
5215
|
-
* <b>push()</b> stores information related to the current
|
5216
|
-
* transformation state and style settings controlled by the
|
5217
|
-
* following functions: <b>rotate()</b>, <b>translate()</b>,
|
5218
|
-
* <b>scale()</b>, <b>fill()</b>, <b>stroke()</b>, <b>tint()</b>,
|
5219
|
-
* <b>strokeWeight()</b>, <b>strokeCap()</b>, <b>strokeJoin()</b>,
|
5220
|
-
* <b>imageMode()</b>, <b>rectMode()</b>, <b>ellipseMode()</b>,
|
5221
|
-
* <b>colorMode()</b>, <b>textAlign()</b>, <b>textFont()</b>,
|
5222
|
-
* <b>textMode()</b>, <b>textSize()</b>, <b>textLeading()</b
|
5223
|
-
*
|
5224
|
-
* The <b>push()</b> and <b>pop()</b> functions were added with
|
5225
|
-
* Processing 3.5. They can be used in place of <b>pushMatrix()</b>,
|
5226
|
-
* <b>popMatrix()</b>, <b>pushStyles()</b>, and <b>popStyles()</b>.
|
5227
|
-
* The difference is that push() and pop() control both the
|
5228
|
-
* transformations (rotate, scale, translate) and the drawing styles
|
5211
|
+
* The <b>pop()</b> function restores the previous drawing style
|
5212
|
+
* settings and transformations after <b>push()</b> has changed them.
|
5213
|
+
* Note that these functions are always used together. They allow
|
5214
|
+
* you to change the style and transformation settings and later
|
5215
|
+
* return to what you had. When a new state is started with push(),
|
5216
|
+
* it builds on the current style and transform information.
|
5217
|
+
*
|
5218
|
+
*
|
5219
|
+
* <b>push()</b> stores information related to the current
|
5220
|
+
* transformation state and style settings controlled by the
|
5221
|
+
* following functions: <b>rotate()</b>, <b>translate()</b>,
|
5222
|
+
* <b>scale()</b>, <b>fill()</b>, <b>stroke()</b>, <b>tint()</b>,
|
5223
|
+
* <b>strokeWeight()</b>, <b>strokeCap()</b>, <b>strokeJoin()</b>,
|
5224
|
+
* <b>imageMode()</b>, <b>rectMode()</b>, <b>ellipseMode()</b>,
|
5225
|
+
* <b>colorMode()</b>, <b>textAlign()</b>, <b>textFont()</b>,
|
5226
|
+
* <b>textMode()</b>, <b>textSize()</b>, <b>textLeading()</b>.
|
5227
|
+
*
|
5228
|
+
* The <b>push()</b> and <b>pop()</b> functions were added with
|
5229
|
+
* Processing 3.5. They can be used in place of <b>pushMatrix()</b>,
|
5230
|
+
* <b>popMatrix()</b>, <b>pushStyles()</b>, and <b>popStyles()</b>.
|
5231
|
+
* The difference is that push() and pop() control both the
|
5232
|
+
* transformations (rotate, scale, translate) and the drawing styles
|
5229
5233
|
* at the same time.
|
5230
5234
|
*
|
5231
5235
|
* ( end auto-generated )
|
@@ -5348,7 +5352,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5348
5352
|
* Rotates a shape the amount specified by the <b>angle</b> parameter.
|
5349
5353
|
* Angles should be specified in radians (values from 0 to TWO_PI) or
|
5350
5354
|
* converted to radians with the <b>radians()</b> function.
|
5351
|
-
*
|
5355
|
+
*
|
5352
5356
|
* Objects are always rotated around their relative position to the origin
|
5353
5357
|
* and positive numbers rotate objects in a clockwise direction.
|
5354
5358
|
* Transformations apply to everything that happens after and subsequent
|
@@ -5356,7 +5360,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5356
5360
|
* <b>rotate(HALF_PI)</b> and then <b>rotate(HALF_PI)</b> is the same as
|
5357
5361
|
* <b>rotate(PI)</b>. All tranformations are reset when <b>draw()</b>
|
5358
5362
|
* begins again.
|
5359
|
-
*
|
5363
|
+
*
|
5360
5364
|
* Technically, <b>rotate()</b> multiplies the current transformation
|
5361
5365
|
* matrix by a rotation matrix. This function can be further controlled by
|
5362
5366
|
* the <b>pushMatrix()</b> and <b>popMatrix()</b>.
|
@@ -5559,7 +5563,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5559
5563
|
* <b>shearX(PI/2)</b> and then <b>shearX(PI/2)</b> is the same as
|
5560
5564
|
* <b>shearX(PI)</b>. If <b>shearX()</b> is called within the
|
5561
5565
|
* <b>draw()</b>, the transformation is reset when the loop begins again.
|
5562
|
-
*
|
5566
|
+
*
|
5563
5567
|
* Technically, <b>shearX()</b> multiplies the current transformation
|
5564
5568
|
* matrix by a rotation matrix. This function can be further controlled by
|
5565
5569
|
* the <b>pushMatrix()</b> and <b>popMatrix()</b> functions.
|
@@ -5593,7 +5597,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5593
5597
|
* <b>shearY(PI/2)</b> and then <b>shearY(PI/2)</b> is the same as
|
5594
5598
|
* <b>shearY(PI)</b>. If <b>shearY()</b> is called within the
|
5595
5599
|
* <b>draw()</b>, the transformation is reset when the loop begins again.
|
5596
|
-
*
|
5600
|
+
*
|
5597
5601
|
* Technically, <b>shearY()</b> multiplies the current transformation
|
5598
5602
|
* matrix by a rotation matrix. This function can be further controlled by
|
5599
5603
|
* the <b>pushMatrix()</b> and <b>popMatrix()</b> functions.
|
@@ -5799,15 +5803,15 @@ public class PGraphics extends PImage implements PConstants {
|
|
5799
5803
|
* The <b>beginCamera()</b> and <b>endCamera()</b> functions enable
|
5800
5804
|
* advanced customization of the camera space. The functions are useful if
|
5801
5805
|
* you want to more control over camera movement, however for most users,
|
5802
|
-
* the <b>camera()</b> function will be sufficient
|
5806
|
+
* the <b>camera()</b> function will be sufficient.The camera
|
5803
5807
|
* functions will replace any transformations (such as <b>rotate()</b> or
|
5804
5808
|
* <b>translate()</b>) that occur before them in <b>draw()</b>, but they
|
5805
5809
|
* will not automatically replace the camera transform itself. For this
|
5806
5810
|
* reason, camera functions should be placed at the beginning of
|
5807
5811
|
* <b>draw()</b> (so that transformations happen afterwards), and the
|
5808
5812
|
* <b>camera()</b> function can be used after <b>beginCamera()</b> if you
|
5809
|
-
* want to reset the camera before applying transformations
|
5810
|
-
*
|
5813
|
+
* want to reset the camera before applying transformations.
|
5814
|
+
* This function sets the matrix mode to the camera matrix so calls such
|
5811
5815
|
* as <b>translate()</b>, <b>rotate()</b>, applyMatrix() and resetMatrix()
|
5812
5816
|
* affect the camera. <b>beginCamera()</b> should always be used with a
|
5813
5817
|
* following <b>endCamera()</b> and pairs of <b>beginCamera()</b> and
|
@@ -6069,6 +6073,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6069
6073
|
|
6070
6074
|
/**
|
6071
6075
|
* @param z 3D z-coordinate to be mapped
|
6076
|
+
* @return
|
6072
6077
|
*/
|
6073
6078
|
public float screenX(float x, float y, float z) {
|
6074
6079
|
showMissingWarning("screenX");
|
@@ -6090,10 +6095,10 @@ public class PGraphics extends PImage implements PConstants {
|
|
6090
6095
|
* ( begin auto-generated from screenZ.xml )
|
6091
6096
|
*
|
6092
6097
|
* Takes a three-dimensional X, Y, Z position and returns the Z value for
|
6093
|
-
* where it will appear on a (two-dimensional) screen.
|
6098
|
+
* where it will appear on a (two-dimensional) screen.( end auto-generated )
|
6094
6099
|
*
|
6095
|
-
* ( end auto-generated )
|
6096
6100
|
*
|
6101
|
+
* @return
|
6097
6102
|
* @webref lights_camera:coordinates
|
6098
6103
|
* @param x 3D x-coordinate to be mapped
|
6099
6104
|
* @param y 3D y-coordinate to be mapped
|
@@ -6110,13 +6115,11 @@ public class PGraphics extends PImage implements PConstants {
|
|
6110
6115
|
/**
|
6111
6116
|
* ( begin auto-generated from modelX.xml )
|
6112
6117
|
*
|
6113
|
-
* Returns the three-dimensional X, Y, Z position in model space.
|
6114
|
-
|
6115
|
-
|
6116
|
-
|
6117
|
-
|
6118
|
-
* <br/> <br/>
|
6119
|
-
* In the example, the <b>modelX()</b>, <b>modelY()</b>, and
|
6118
|
+
* Returns the three-dimensional X, Y, Z position in model space.This
|
6119
|
+
returns the X value for a given coordinate based on the current set of
|
6120
|
+
transformations (scale, rotate, translate, etc.) The X value can be used
|
6121
|
+
to place an object in space relative to the location of the original
|
6122
|
+
point once the transformations are no longer in use. In the example, the <b>modelX()</b>, <b>modelY()</b>, and
|
6120
6123
|
* <b>modelZ()</b> functions record the location of a box in space after
|
6121
6124
|
* being placed using a series of translate and rotate commands. After
|
6122
6125
|
* popMatrix() is called, those transformations no longer apply, but the
|
@@ -6125,6 +6128,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6125
6128
|
*
|
6126
6129
|
* ( end auto-generated )
|
6127
6130
|
*
|
6131
|
+
* @return
|
6128
6132
|
* @webref lights_camera:coordinates
|
6129
6133
|
* @param x 3D x-coordinate to be mapped
|
6130
6134
|
* @param y 3D y-coordinate to be mapped
|
@@ -6141,13 +6145,11 @@ public class PGraphics extends PImage implements PConstants {
|
|
6141
6145
|
/**
|
6142
6146
|
* ( begin auto-generated from modelY.xml )
|
6143
6147
|
*
|
6144
|
-
* Returns the three-dimensional X, Y, Z position in model space.
|
6145
|
-
|
6146
|
-
|
6147
|
-
|
6148
|
-
|
6149
|
-
* <br />
|
6150
|
-
* In the example, the <b>modelX()</b>, <b>modelY()</b>, and
|
6148
|
+
* Returns the three-dimensional X, Y, Z position in model space.This
|
6149
|
+
returns the Y value for a given coordinate based on the current set of
|
6150
|
+
transformations (scale, rotate, translate, etc.) The Y value can be used
|
6151
|
+
to place an object in space relative to the location of the original
|
6152
|
+
point once the transformations are no longer in use. In the example, the <b>modelX()</b>, <b>modelY()</b>, and
|
6151
6153
|
* <b>modelZ()</b> functions record the location of a box in space after
|
6152
6154
|
* being placed using a series of translate and rotate commands. After
|
6153
6155
|
* popMatrix() is called, those transformations no longer apply, but the
|
@@ -6156,6 +6158,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6156
6158
|
*
|
6157
6159
|
* ( end auto-generated )
|
6158
6160
|
*
|
6161
|
+
* @return
|
6159
6162
|
* @webref lights_camera:coordinates
|
6160
6163
|
* @param x 3D x-coordinate to be mapped
|
6161
6164
|
* @param y 3D y-coordinate to be mapped
|
@@ -6172,13 +6175,11 @@ public class PGraphics extends PImage implements PConstants {
|
|
6172
6175
|
/**
|
6173
6176
|
* ( begin auto-generated from modelZ.xml )
|
6174
6177
|
*
|
6175
|
-
* Returns the three-dimensional X, Y, Z position in model space.
|
6176
|
-
|
6177
|
-
|
6178
|
-
|
6179
|
-
|
6180
|
-
* <br />
|
6181
|
-
* In the example, the <b>modelX()</b>, <b>modelY()</b>, and
|
6178
|
+
* Returns the three-dimensional X, Y, Z position in model space.This
|
6179
|
+
returns the Z value for a given coordinate based on the current set of
|
6180
|
+
transformations (scale, rotate, translate, etc.) The Z value can be used
|
6181
|
+
to place an object in space relative to the location of the original
|
6182
|
+
point once the transformations are no longer in use. In the example, the <b>modelX()</b>, <b>modelY()</b>, and
|
6182
6183
|
* <b>modelZ()</b> functions record the location of a box in space after
|
6183
6184
|
* being placed using a series of translate and rotate commands. After
|
6184
6185
|
* popMatrix() is called, those transformations no longer apply, but the
|
@@ -6187,6 +6188,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6187
6188
|
*
|
6188
6189
|
* ( end auto-generated )
|
6189
6190
|
*
|
6191
|
+
* @return
|
6190
6192
|
* @webref lights_camera:coordinates
|
6191
6193
|
* @param x 3D x-coordinate to be mapped
|
6192
6194
|
* @param y 3D y-coordinate to be mapped
|
@@ -6215,7 +6217,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6215
6217
|
* <b>pushStyle()</b>, it builds on the current style information. The
|
6216
6218
|
* <b>pushStyle()</b> and <b>popStyle()</b> functions can be embedded to
|
6217
6219
|
* provide more control (see the second example above for a demonstration.)
|
6218
|
-
*
|
6220
|
+
*
|
6219
6221
|
* The style information controlled by the following functions are included
|
6220
6222
|
* in the style:
|
6221
6223
|
* fill(), stroke(), tint(), strokeWeight(), strokeCap(), strokeJoin(),
|
@@ -6408,7 +6410,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6408
6410
|
*
|
6409
6411
|
* Sets the width of the stroke used for lines, points, and the border
|
6410
6412
|
* around shapes. All widths are set in units of pixels.
|
6411
|
-
*
|
6413
|
+
*
|
6412
6414
|
* When drawing with P3D, series of connected lines (such as the stroke
|
6413
6415
|
* around a polygon, triangle, or ellipse) produce unattractive results
|
6414
6416
|
* when a thick stroke weight is set (<a
|
@@ -6437,7 +6439,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6437
6439
|
* are either mitered, beveled, or rounded and specified with the
|
6438
6440
|
* corresponding parameters MITER, BEVEL, and ROUND. The default joint is
|
6439
6441
|
* MITER.
|
6440
|
-
*
|
6442
|
+
*
|
6441
6443
|
* This function is not available with the P3D renderer, (<a
|
6442
6444
|
* href="http://code.google.com/p/processing/issues/detail?id=123">see
|
6443
6445
|
* Issue 123</a>). More information about the renderers can be found in the
|
@@ -6461,7 +6463,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6461
6463
|
* Sets the style for rendering line endings. These ends are either
|
6462
6464
|
* squared, extended, or rounded and specified with the corresponding
|
6463
6465
|
* parameters SQUARE, PROJECT, and ROUND. The default cap is ROUND.
|
6464
|
-
*
|
6466
|
+
*
|
6465
6467
|
* This function is not available with the P3D renderer (<a
|
6466
6468
|
* href="http://code.google.com/p/processing/issues/detail?id=123">see
|
6467
6469
|
* Issue 123</a>). More information about the renderers can be found in the
|
@@ -6512,7 +6514,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6512
6514
|
* is either specified in terms of the RGB or HSB color depending on the
|
6513
6515
|
* current <b>colorMode()</b> (the default color space is RGB, with each
|
6514
6516
|
* value in the range from 0 to 255).
|
6515
|
-
*
|
6517
|
+
*
|
6516
6518
|
* When using hexadecimal notation to specify a color, use "#" or "0x"
|
6517
6519
|
* before the values (e.g. #CCFFAA, 0xFFCCFFAA). The # syntax uses six
|
6518
6520
|
* digits to specify a color (the way colors are specified in HTML and
|
@@ -6520,7 +6522,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6520
6522
|
* hexadecimal value must be specified with eight characters; the first two
|
6521
6523
|
* characters define the alpha component and the remainder the red, green,
|
6522
6524
|
* and blue components.
|
6523
|
-
*
|
6525
|
+
*
|
6524
6526
|
* The value for the parameter "gray" must be less than or equal to the
|
6525
6527
|
* current maximum value as specified by <b>colorMode()</b>. The default
|
6526
6528
|
* maximum value is 255.
|
@@ -6629,25 +6631,25 @@ public class PGraphics extends PImage implements PConstants {
|
|
6629
6631
|
* ( begin auto-generated from tint.xml )
|
6630
6632
|
*
|
6631
6633
|
* Sets the fill value for displaying images. Images can be tinted to
|
6632
|
-
* specified colors or made transparent by setting the alpha
|
6633
|
-
*
|
6634
|
+
* specified colors or made transparent by setting the alpha.
|
6635
|
+
*
|
6634
6636
|
* To make an image transparent, but not change it's color, use white as
|
6635
6637
|
* the tint color and specify an alpha value. For instance, tint(255, 128)
|
6636
6638
|
* will make an image 50% transparent (unless <b>colorMode()</b> has been
|
6637
|
-
* used)
|
6638
|
-
*
|
6639
|
+
* used).
|
6640
|
+
*
|
6639
6641
|
* When using hexadecimal notation to specify a color, use "#" or "0x"
|
6640
6642
|
* before the values (e.g. #CCFFAA, 0xFFCCFFAA). The # syntax uses six
|
6641
6643
|
* digits to specify a color (the way colors are specified in HTML and
|
6642
6644
|
* CSS). When using the hexadecimal notation starting with "0x", the
|
6643
6645
|
* hexadecimal value must be specified with eight characters; the first two
|
6644
6646
|
* characters define the alpha component and the remainder the red, green,
|
6645
|
-
* and blue components
|
6646
|
-
*
|
6647
|
+
* and blue components.
|
6648
|
+
*
|
6647
6649
|
* The value for the parameter "gray" must be less than or equal to the
|
6648
6650
|
* current maximum value as specified by <b>colorMode()</b>. The default
|
6649
|
-
* maximum value is 255
|
6650
|
-
*
|
6651
|
+
* maximum value is 255.
|
6652
|
+
*
|
6651
6653
|
* The <b>tint()</b> function is also used to control the coloring of
|
6652
6654
|
* textures in 3D.
|
6653
6655
|
*
|
@@ -6753,7 +6755,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6753
6755
|
* color is either specified in terms of the RGB or HSB color depending on
|
6754
6756
|
* the current <b>colorMode()</b> (the default color space is RGB, with
|
6755
6757
|
* each value in the range from 0 to 255).
|
6756
|
-
*
|
6758
|
+
*
|
6757
6759
|
* When using hexadecimal notation to specify a color, use "#" or "0x"
|
6758
6760
|
* before the values (e.g. #CCFFAA, 0xFFCCFFAA). The # syntax uses six
|
6759
6761
|
* digits to specify a color (the way colors are specified in HTML and
|
@@ -6761,11 +6763,11 @@ public class PGraphics extends PImage implements PConstants {
|
|
6761
6763
|
* hexadecimal value must be specified with eight characters; the first two
|
6762
6764
|
* characters define the alpha component and the remainder the red, green,
|
6763
6765
|
* and blue components.
|
6764
|
-
*
|
6766
|
+
*
|
6765
6767
|
* The value for the parameter "gray" must be less than or equal to the
|
6766
6768
|
* current maximum value as specified by <b>colorMode()</b>. The default
|
6767
6769
|
* maximum value is 255.
|
6768
|
-
*
|
6770
|
+
*
|
6769
6771
|
* To change the color of an image (or a texture), use tint().
|
6770
6772
|
*
|
6771
6773
|
* ( end auto-generated )
|
@@ -6940,6 +6942,8 @@ public class PGraphics extends PImage implements PConstants {
|
|
6940
6942
|
|
6941
6943
|
/**
|
6942
6944
|
* gray number specifying value between white and black
|
6945
|
+
*
|
6946
|
+
* @param gray value between black and white, by default 0 to 255
|
6943
6947
|
*/
|
6944
6948
|
public void specular(float gray) {
|
6945
6949
|
colorCalc(gray);
|
@@ -7017,6 +7021,8 @@ public class PGraphics extends PImage implements PConstants {
|
|
7017
7021
|
|
7018
7022
|
/**
|
7019
7023
|
* gray number specifying value between white and black
|
7024
|
+
*
|
7025
|
+
* @param gray value between black and white, by default 0 to 255
|
7020
7026
|
*/
|
7021
7027
|
public void emissive(float gray) {
|
7022
7028
|
colorCalc(gray);
|
@@ -7243,9 +7249,9 @@ public class PGraphics extends PImage implements PConstants {
|
|
7243
7249
|
*
|
7244
7250
|
* Sets the falloff rates for point lights, spot lights, and ambient
|
7245
7251
|
* lights. The parameters are used to determine the falloff with the
|
7246
|
-
* following equation
|
7247
|
-
* vertex
|
7248
|
-
* QUADRATIC)
|
7252
|
+
* following equation:d = distance from light position to
|
7253
|
+
* vertex positionfalloff = 1 / (CONSTANT + d * LINEAR + (d*d) *
|
7254
|
+
* QUADRATIC)Like <b>fill()</b>, it affects only the elements
|
7249
7255
|
* which are created after it in the code. The default value if
|
7250
7256
|
* <b>LightFalloff(1.0, 0.0, 0.0)</b>. Thinking about an ambient light with
|
7251
7257
|
* a falloff can be tricky. It is used, for example, if you wanted a region
|
@@ -7313,13 +7319,13 @@ public class PGraphics extends PImage implements PConstants {
|
|
7313
7319
|
* of the Processing window. The default background is light gray. In the
|
7314
7320
|
* <b>draw()</b> function, the background color is used to clear the
|
7315
7321
|
* display window at the beginning of each frame.
|
7316
|
-
*
|
7322
|
+
*
|
7317
7323
|
* An image can also be used as the background for a sketch, however its
|
7318
7324
|
* width and height must be the same size as the sketch window. To resize
|
7319
7325
|
* an image 'b' to the size of the sketch window, use b.resize(width, height).
|
7320
|
-
*
|
7326
|
+
*
|
7321
7327
|
* Images used as background will ignore the current <b>tint()</b> setting.
|
7322
|
-
*
|
7328
|
+
*
|
7323
7329
|
* It is not possible to use transparency (alpha) in background colors with
|
7324
7330
|
* the main drawing surface, however they will work properly with <b>createGraphics()</b>.
|
7325
7331
|
*
|
@@ -7450,13 +7456,13 @@ public class PGraphics extends PImage implements PConstants {
|
|
7450
7456
|
/**
|
7451
7457
|
* Takes an RGB or ARGB image and sets it as the background.
|
7452
7458
|
* The width and height of the image must be the same size as the sketch.
|
7453
|
-
* Use image.resize(width, height) to make short work of such a task
|
7454
|
-
*
|
7459
|
+
* Use image.resize(width, height) to make short work of such a task.
|
7460
|
+
*
|
7455
7461
|
* Note that even if the image is set as RGB, the high 8 bits of each pixel
|
7456
7462
|
* should be set opaque (0xFF000000) because the image data will be copied
|
7457
7463
|
* directly to the screen, and non-opaque background images may have strange
|
7458
|
-
* behavior. Use image.filter(OPAQUE) to handle this easily
|
7459
|
-
*
|
7464
|
+
* behavior. Use image.filter(OPAQUE) to handle this easily.
|
7465
|
+
*
|
7460
7466
|
* When using 3D, this will also clear the zbuffer (if it exists).
|
7461
7467
|
*
|
7462
7468
|
* @param image PImage to set as background (must be same size as the sketch window)
|
@@ -7904,12 +7910,12 @@ public class PGraphics extends PImage implements PConstants {
|
|
7904
7910
|
*
|
7905
7911
|
* Extracts the red value from a color, scaled to match current
|
7906
7912
|
* <b>colorMode()</b>. This value is always returned as a float so be
|
7907
|
-
* careful not to assign it to an int value
|
7913
|
+
* careful not to assign it to an int value.The red() function
|
7908
7914
|
* is easy to use and undestand, but is slower than another technique. To
|
7909
7915
|
* achieve the same results when working in <b>colorMode(RGB, 255)</b>, but
|
7910
7916
|
* with greater speed, use the >> (right shift) operator with a bit
|
7911
7917
|
* mask. For example, the following two lines of code are equivalent:<br
|
7912
|
-
* /><pre>float r1 = red(myColor)
|
7918
|
+
* /><pre>float r1 = red(myColor);float r2 = myColor >> 16
|
7913
7919
|
* & 0xFF;</pre>
|
7914
7920
|
*
|
7915
7921
|
* ( end auto-generated )
|
@@ -7937,12 +7943,12 @@ public class PGraphics extends PImage implements PConstants {
|
|
7937
7943
|
*
|
7938
7944
|
* Extracts the green value from a color, scaled to match current
|
7939
7945
|
* <b>colorMode()</b>. This value is always returned as a float so be
|
7940
|
-
* careful not to assign it to an int value
|
7946
|
+
* careful not to assign it to an int value.The <b>green()</b>
|
7941
7947
|
* function is easy to use and undestand, but is slower than another
|
7942
7948
|
* technique. To achieve the same results when working in <b>colorMode(RGB,
|
7943
7949
|
* 255)</b>, but with greater speed, use the >> (right shift)
|
7944
7950
|
* operator with a bit mask. For example, the following two lines of code
|
7945
|
-
* are equivalent:<
|
7951
|
+
* are equivalent:<pre>float r1 = green(myColor);float r2 =
|
7946
7952
|
* myColor >> 8 & 0xFF;</pre>
|
7947
7953
|
*
|
7948
7954
|
* ( end auto-generated )
|
@@ -7970,12 +7976,12 @@ public class PGraphics extends PImage implements PConstants {
|
|
7970
7976
|
*
|
7971
7977
|
* Extracts the blue value from a color, scaled to match current
|
7972
7978
|
* <b>colorMode()</b>. This value is always returned as a float so be
|
7973
|
-
* careful not to assign it to an int value
|
7979
|
+
* careful not to assign it to an int value.The <b>blue()</b>
|
7974
7980
|
* function is easy to use and undestand, but is slower than another
|
7975
7981
|
* technique. To achieve the same results when working in <b>colorMode(RGB,
|
7976
7982
|
* 255)</b>, but with greater speed, use a bit mask to remove the other
|
7977
7983
|
* color components. For example, the following two lines of code are
|
7978
|
-
* equivalent:<
|
7984
|
+
* equivalent:<pre>float r1 = blue(myColor);float r2 = myColor
|
7979
7985
|
* & 0xFF;</pre>
|
7980
7986
|
*
|
7981
7987
|
* ( end auto-generated )
|
@@ -8001,9 +8007,9 @@ public class PGraphics extends PImage implements PConstants {
|
|
8001
8007
|
/**
|
8002
8008
|
* ( begin auto-generated from hue.xml )
|
8003
8009
|
*
|
8004
|
-
* Extracts the hue value from a color.
|
8010
|
+
* Extracts the hue value from a color.( end auto-generated )
|
8005
8011
|
*
|
8006
|
-
*
|
8012
|
+
* @return
|
8007
8013
|
* @webref color:creating_reading
|
8008
8014
|
* @usage web_application
|
8009
8015
|
* @param rgb any value of the color datatype
|
@@ -8027,9 +8033,9 @@ public class PGraphics extends PImage implements PConstants {
|
|
8027
8033
|
/**
|
8028
8034
|
* ( begin auto-generated from saturation.xml )
|
8029
8035
|
*
|
8030
|
-
* Extracts the saturation value from a color.
|
8036
|
+
* Extracts the saturation value from a color.( end auto-generated )
|
8031
8037
|
*
|
8032
|
-
*
|
8038
|
+
* @return
|
8033
8039
|
* @webref color:creating_reading
|
8034
8040
|
* @usage web_application
|
8035
8041
|
* @param rgb any value of the color datatype
|
@@ -8053,10 +8059,10 @@ public class PGraphics extends PImage implements PConstants {
|
|
8053
8059
|
/**
|
8054
8060
|
* ( begin auto-generated from brightness.xml )
|
8055
8061
|
*
|
8056
|
-
* Extracts the brightness value from a color.
|
8062
|
+
* Extracts the brightness value from a color.( end auto-generated )
|
8057
8063
|
*
|
8058
|
-
* ( end auto-generated )
|
8059
8064
|
*
|
8065
|
+
* @return
|
8060
8066
|
* @webref color:creating_reading
|
8061
8067
|
* @usage web_application
|
8062
8068
|
* @param rgb any value of the color datatype
|
@@ -8192,6 +8198,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
8192
8198
|
|
8193
8199
|
/**
|
8194
8200
|
* Record individual lines and triangles by echoing them to another renderer.
|
8201
|
+
* @param rawGraphics
|
8195
8202
|
*/
|
8196
8203
|
public void beginRaw(PGraphics rawGraphics) { // ignore
|
8197
8204
|
this.raw = rawGraphics;
|
@@ -8249,6 +8256,8 @@ public class PGraphics extends PImage implements PConstants {
|
|
8249
8256
|
|
8250
8257
|
/**
|
8251
8258
|
* Version of showWarning() that takes a parsed String.
|
8259
|
+
* @param msg
|
8260
|
+
* @param args
|
8252
8261
|
*/
|
8253
8262
|
static public void showWarning(String msg, Object... args) { // ignore
|
8254
8263
|
showWarning(String.format(msg, args));
|
@@ -8280,6 +8289,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
8280
8289
|
|
8281
8290
|
/**
|
8282
8291
|
* Display a warning that the specified method is simply unavailable.
|
8292
|
+
* @param method
|
8283
8293
|
*/
|
8284
8294
|
static public void showMethodWarning(String method) {
|
8285
8295
|
showWarning(method + "() is not available with this renderer.");
|
@@ -8288,8 +8298,9 @@ public class PGraphics extends PImage implements PConstants {
|
|
8288
8298
|
|
8289
8299
|
/**
|
8290
8300
|
* Error that a particular variation of a method is unavailable (even though
|
8291
|
-
* other variations are).
|
8292
|
-
|
8301
|
+
* other variations are).For instance, if vertex(x, y, u, v) is not
|
8302
|
+
available, but vertex(x, y) is just fine.
|
8303
|
+
* @param str
|
8293
8304
|
*/
|
8294
8305
|
static public void showVariationWarning(String str) {
|
8295
8306
|
showWarning(str + " is not available with this renderer.");
|
@@ -8300,6 +8311,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
8300
8311
|
* Display a warning that the specified method is not implemented, meaning
|
8301
8312
|
* that it could be either a completely missing function, although other
|
8302
8313
|
* variations of it may still work properly.
|
8314
|
+
* @param method
|
8303
8315
|
*/
|
8304
8316
|
static public void showMissingWarning(String method) {
|
8305
8317
|
showWarning(method + "(), or this particular variation of it, " +
|
@@ -8308,9 +8320,10 @@ public class PGraphics extends PImage implements PConstants {
|
|
8308
8320
|
|
8309
8321
|
|
8310
8322
|
/**
|
8311
|
-
* Show an renderer-related exception that halts the program.
|
8312
|
-
|
8313
|
-
|
8323
|
+
* Show an renderer-related exception that halts the program.Currently just
|
8324
|
+
wraps the message as a RuntimeException and throws it, but might do
|
8325
|
+
something more specific might be used in the future.
|
8326
|
+
* @param msg
|
8314
8327
|
*/
|
8315
8328
|
static public void showException(String msg) { // ignore
|
8316
8329
|
throw new RuntimeException(msg);
|
@@ -8319,6 +8332,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
8319
8332
|
|
8320
8333
|
/**
|
8321
8334
|
* Same as below, but defaults to a 12 point font, just as MacWrite intended.
|
8335
|
+
* @param method
|
8322
8336
|
*/
|
8323
8337
|
protected void defaultFontOrDeath(String method) {
|
8324
8338
|
defaultFontOrDeath(method, 12);
|
@@ -8329,6 +8343,8 @@ public class PGraphics extends PImage implements PConstants {
|
|
8329
8343
|
* First try to create a default font, but if that's not possible, throw
|
8330
8344
|
* an exception that halts the program because textFont() has not been used
|
8331
8345
|
* prior to the specified method.
|
8346
|
+
* @param method
|
8347
|
+
* @param size
|
8332
8348
|
*/
|
8333
8349
|
protected void defaultFontOrDeath(String method, float size) {
|
8334
8350
|
if (parent != null) {
|
@@ -8349,7 +8365,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
8349
8365
|
* Return true if this renderer should be drawn to the screen. Defaults to
|
8350
8366
|
* returning true, since nearly all renderers are on-screen beasts. But can
|
8351
8367
|
* be overridden for subclasses like PDF so that a window doesn't open up.
|
8352
|
-
*
|
8368
|
+
*
|
8353
8369
|
* A better name? showFrame, displayable, isVisible, visible, shouldDisplay,
|
8354
8370
|
* what to call this?
|
8355
8371
|
*/
|