picrate 0.2.0-java → 0.3.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -5
  3. data/Rakefile +10 -2
  4. data/docs/_posts/2018-06-26-auto_install_picrate.md +15 -0
  5. data/lib/export.txt +8 -0
  6. data/lib/picrate/app.rb +4 -4
  7. data/lib/picrate/version.rb +1 -1
  8. data/picrate.gemspec +1 -1
  9. data/pom.rb +1 -1
  10. data/pom.xml +1 -1
  11. data/src/main/java/processing/awt/PGraphicsJava2D.java +16 -85
  12. data/src/main/java/processing/awt/PShapeJava2D.java +9 -33
  13. data/src/main/java/processing/awt/PSurfaceAWT.java +76 -169
  14. data/src/main/java/processing/core/PApplet.java +14019 -15963
  15. data/src/main/java/processing/core/PConstants.java +475 -981
  16. data/src/main/java/processing/core/PFont.java +50 -202
  17. data/src/main/java/processing/core/PGraphics.java +7330 -8477
  18. data/src/main/java/processing/core/PImage.java +42 -212
  19. data/src/main/java/processing/core/PMatrix.java +21 -160
  20. data/src/main/java/processing/core/PMatrix2D.java +18 -178
  21. data/src/main/java/processing/core/PMatrix3D.java +48 -324
  22. data/src/main/java/processing/core/PShape.java +294 -1181
  23. data/src/main/java/processing/core/PShapeOBJ.java +16 -91
  24. data/src/main/java/processing/core/PShapeSVG.java +53 -253
  25. data/src/main/java/processing/core/PStyle.java +34 -179
  26. data/src/main/java/processing/core/PSurface.java +13 -94
  27. data/src/main/java/processing/core/PSurfaceNone.java +35 -140
  28. data/src/main/java/processing/core/PVector.java +10 -87
  29. data/src/main/java/processing/event/Event.java +86 -69
  30. data/src/main/java/processing/event/MouseEvent.java +102 -102
  31. data/src/main/java/processing/opengl/PGL.java +23 -16
  32. data/src/main/java/processing/opengl/PGraphicsOpenGL.java +13 -10
  33. data/src/main/java/processing/opengl/PJOGL.java +32 -12
  34. data/src/main/java/processing/opengl/shaders/LightVert-brcm.glsl +154 -0
  35. data/src/main/java/processing/opengl/shaders/LightVert-vc4.glsl +2 -2
  36. data/src/main/java/processing/opengl/shaders/TexLightVert-brcm.glsl +160 -0
  37. data/src/main/java/processing/opengl/shaders/TexLightVert-vc4.glsl +2 -2
  38. metadata +7 -3
@@ -1,6 +1,6 @@
1
1
  /* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2
2
 
3
- /*
3
+ /*
4
4
  Part of the Processing project - http://processing.org
5
5
 
6
6
  Copyright (c) 2004-11 Ben Fry and Casey Reas
@@ -20,41 +20,33 @@
20
20
  Public License along with this library; if not, write to the
21
21
  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
22
22
  Boston, MA 02111-1307 USA
23
- */
23
+ */
24
+
24
25
  package processing.core;
25
26
 
26
27
  import java.awt.Cursor;
27
28
  import java.awt.event.KeyEvent;
28
29
 
30
+
29
31
  /**
30
32
  * Numbers shared throughout processing.core.
31
- * <p>
32
- * An attempt is made to keep the constants as short/non-verbose as possible.
33
- * For instance, the constant is TIFF instead of FILE_TYPE_TIFF. We'll do this
34
- * as long as we can get away with it.
33
+ * <P>
34
+ * An attempt is made to keep the constants as short/non-verbose
35
+ * as possible. For instance, the constant is TIFF instead of
36
+ * FILE_TYPE_TIFF. We'll do this as long as we can get away with it.
35
37
  *
36
38
  * @usage Web &amp; Application
37
39
  */
38
40
  public interface PConstants {
39
41
 
40
- /**
41
- *
42
- */
43
- static public final int X = 0;
42
+ static public final int X = 0;
43
+ static public final int Y = 1;
44
+ static public final int Z = 2;
44
45
 
45
- /**
46
- *
47
- */
48
- static public final int Y = 1;
49
46
 
50
- /**
51
- *
52
- */
53
- static public final int Z = 2;
47
+ // renderers known to processing.core
54
48
 
55
- // renderers known to processing.core
56
-
57
- /*
49
+ /*
58
50
  // List of renderers used inside PdePreprocessor
59
51
  static final StringList rendererList = new StringList(new String[] {
60
52
  "JAVA2D", "JAVA2D_2X",
@@ -63,971 +55,473 @@ public interface PConstants {
63
55
  "LWJGL.P2D", "LWJGL.P3D", // hmm
64
56
  "PDF" // no DXF because that's only for beginRaw()
65
57
  });
66
- */
67
- /**
68
- *
69
- */
70
- static final String JAVA2D = "processing.awt.PGraphicsJava2D";
71
-
72
- /**
73
- *
74
- */
75
- static final String P2D = "processing.opengl.PGraphics2D";
76
-
77
- /**
78
- *
79
- */
80
- static final String P3D = "processing.opengl.PGraphics3D";
81
-
82
- // When will it be time to remove this?
83
- /**
84
- *
85
- * @deprecated
86
- */
87
- @Deprecated
88
- static final String OPENGL = P3D;
89
-
90
- // Experimental, higher-performance Java 2D renderer (but no pixel ops)
58
+ */
59
+
60
+ static final String JAVA2D = "processing.awt.PGraphicsJava2D";
61
+
62
+ static final String P2D = "processing.opengl.PGraphics2D";
63
+ static final String P3D = "processing.opengl.PGraphics3D";
64
+
65
+ // When will it be time to remove this?
66
+ @Deprecated
67
+ static final String OPENGL = P3D;
68
+
69
+ // Experimental, higher-performance Java 2D renderer (but no pixel ops)
91
70
  // static final String E2D = PGraphicsDanger2D.class.getName();
92
- // Experimental JavaFX renderer; even better 2D performance
93
- /**
94
- *
95
- */
96
- static final String FX2D = "processing.javafx.PGraphicsFX2D";
97
-
98
- /**
99
- *
100
- */
101
- static final String PDF = "processing.pdf.PGraphicsPDF";
102
-
103
- /**
104
- *
105
- */
106
- static final String SVG = "processing.svg.PGraphicsSVG";
107
-
108
- /**
109
- *
110
- */
111
- static final String DXF = "processing.dxf.RawDXF";
112
-
113
- // platform IDs for PApplet.platform
114
- /**
115
- *
116
- */
117
- static final int OTHER = 0;
118
-
119
- /**
120
- *
121
- */
122
- static final int WINDOWS = 1;
123
-
124
- /**
125
- *
126
- */
127
- static final int MACOSX = 2;
128
-
129
- /**
130
- *
131
- */
132
- static final int LINUX = 3;
133
-
134
- /**
135
- *
136
- */
137
- static final String[] platformNames = {
138
- "other", "windows", "macosx", "linux"
139
- };
140
-
141
- /**
142
- *
143
- */
144
- static final float EPSILON = 0.0001f;
145
-
146
- // max/min values for numbers
147
- /**
148
- * Same as Float.MAX_VALUE, but included for parity with MIN_VALUE, and to
149
- * avoid teaching static methods on the first day.
150
- */
151
- static final float MAX_FLOAT = Float.MAX_VALUE;
152
- /**
153
- * Note that Float.MIN_VALUE is the smallest <EM>positive</EM> value for a
154
- * floating point number, not actually the minimum (negative) value for a
155
- * float. This constant equals 0xFF7FFFFF, the smallest (farthest negative)
156
- * value a float can have before it hits NaN.
157
- */
158
- static final float MIN_FLOAT = -Float.MAX_VALUE;
159
- /**
160
- * Largest possible (positive) integer value
161
- */
162
- static final int MAX_INT = Integer.MAX_VALUE;
163
- /**
164
- * Smallest possible (negative) integer value
165
- */
166
- static final int MIN_INT = Integer.MIN_VALUE;
167
-
168
- // shapes
169
- /**
170
- *
171
- */
172
- static public final int VERTEX = 0;
173
-
174
- /**
175
- *
176
- */
177
- static public final int BEZIER_VERTEX = 1;
178
-
179
- /**
180
- *
181
- */
182
- static public final int QUADRATIC_VERTEX = 2;
183
-
184
- /**
185
- *
186
- */
187
- static public final int CURVE_VERTEX = 3;
188
-
189
- /**
190
- *
191
- */
192
- static public final int BREAK = 4;
193
-
194
- /**
195
- *
196
- * @deprecated
197
- */
198
- @Deprecated
199
- static public final int QUAD_BEZIER_VERTEX = 2; // should not have been exposed
200
-
201
- // useful goodness
202
- /**
203
- * ( begin auto-generated from PI.xml )
204
- *
205
- * PI is a mathematical constant with the value 3.14159265358979323846. It
206
- * is the ratio of the circumference of a circle to its diameter. It is
207
- * useful in combination with the trigonometric functions <b>sin()</b> and
208
- * <b>cos()</b>.
209
- *
210
- * ( end auto-generated )
211
- *
212
- * @webref constants
213
- * @see PConstants#TWO_PI
214
- * @see PConstants#TAU
215
- * @see PConstants#HALF_PI
216
- * @see PConstants#QUARTER_PI
217
- *
218
- */
219
- static final float PI = (float) Math.PI;
220
- /**
221
- * ( begin auto-generated from HALF_PI.xml )
222
- *
223
- * HALF_PI is a mathematical constant with the value 1.57079632679489661923.
224
- * It is half the ratio of the circumference of a circle to its diameter. It
225
- * is useful in combination with the trigonometric functions <b>sin()</b>
226
- * and <b>cos()</b>.
227
- *
228
- * ( end auto-generated )
229
- *
230
- * @webref constants
231
- * @see PConstants#PI
232
- * @see PConstants#TWO_PI
233
- * @see PConstants#TAU
234
- * @see PConstants#QUARTER_PI
235
- */
236
- static final float HALF_PI = (float) (Math.PI / 2.0);
237
-
238
- /**
239
- *
240
- */
241
- static final float THIRD_PI = (float) (Math.PI / 3.0);
242
- /**
243
- * ( begin auto-generated from QUARTER_PI.xml )
244
- *
245
- * QUARTER_PI is a mathematical constant with the value 0.7853982. It is one
246
- * quarter the ratio of the circumference of a circle to its diameter. It is
247
- * useful in combination with the trigonometric functions
248
- * <b>sin()</b> and <b>cos()</b>.
249
- *
250
- * ( end auto-generated )
251
- *
252
- * @webref constants
253
- * @see PConstants#PI
254
- * @see PConstants#TWO_PI
255
- * @see PConstants#TAU
256
- * @see PConstants#HALF_PI
257
- */
258
- static final float QUARTER_PI = (float) (Math.PI / 4.0);
259
- /**
260
- * ( begin auto-generated from TWO_PI.xml )
261
- *
262
- * TWO_PI is a mathematical constant with the value 6.28318530717958647693.
263
- * It is twice the ratio of the circumference of a circle to its diameter.
264
- * It is useful in combination with the trigonometric functions
265
- * <b>sin()</b> and <b>cos()</b>.
266
- *
267
- * ( end auto-generated )
268
- *
269
- * @webref constants
270
- * @see PConstants#PI
271
- * @see PConstants#TAU
272
- * @see PConstants#HALF_PI
273
- * @see PConstants#QUARTER_PI
274
- */
275
- static final float TWO_PI = (float) (2.0 * Math.PI);
276
- /**
277
- * ( begin auto-generated from TAU.xml )
278
- *
279
- * TAU is an alias for TWO_PI, a mathematical constant with the value
280
- * 6.28318530717958647693. It is twice the ratio of the circumference of a
281
- * circle to its diameter. It is useful in combination with the
282
- * trigonometric functions <b>sin()</b> and <b>cos()</b>.
283
- *
284
- * ( end auto-generated )
285
- *
286
- * @webref constants
287
- * @see PConstants#PI
288
- * @see PConstants#TWO_PI
289
- * @see PConstants#HALF_PI
290
- * @see PConstants#QUARTER_PI
291
- */
292
- static final float TAU = (float) (2.0 * Math.PI);
293
-
294
- /**
295
- *
296
- */
297
- static final float DEG_TO_RAD = PI / 180.0f;
298
-
299
- /**
300
- *
301
- */
302
- static final float RAD_TO_DEG = 180.0f / PI;
303
-
304
- // angle modes
305
- //static final int RADIANS = 0;
306
- //static final int DEGREES = 1;
307
- // used by split, all the standard whitespace chars
308
- // (also includes unicode nbsp, that little bostage)
309
- /**
310
- *
311
- */
312
- static final String WHITESPACE = " \t\n\r\f\u00A0";
313
-
314
- // for colors and/or images
315
- /**
316
- *
317
- */
318
- static final int RGB = 1; // image & color
319
-
320
- /**
321
- *
322
- */
323
- static final int ARGB = 2; // image
324
-
325
- /**
326
- *
327
- */
328
- static final int HSB = 3; // color
329
-
330
- /**
331
- *
332
- */
333
- static final int ALPHA = 4; // image
71
+
72
+ // Experimental JavaFX renderer; even better 2D performance
73
+ static final String FX2D = "processing.javafx.PGraphicsFX2D";
74
+
75
+ static final String PDF = "processing.pdf.PGraphicsPDF";
76
+ static final String SVG = "processing.svg.PGraphicsSVG";
77
+ static final String DXF = "processing.dxf.RawDXF";
78
+
79
+ // platform IDs for PApplet.platform
80
+
81
+ static final int OTHER = 0;
82
+ static final int WINDOWS = 1;
83
+ static final int MACOSX = 2;
84
+ static final int LINUX = 3;
85
+
86
+ static final String[] platformNames = {
87
+ "other", "windows", "macosx", "linux"
88
+ };
89
+
90
+
91
+ static final float EPSILON = 0.0001f;
92
+
93
+
94
+ // max/min values for numbers
95
+
96
+ /**
97
+ * Same as Float.MAX_VALUE, but included for parity with MIN_VALUE,
98
+ * and to avoid teaching static methods on the first day.
99
+ */
100
+ static final float MAX_FLOAT = Float.MAX_VALUE;
101
+ /**
102
+ * Note that Float.MIN_VALUE is the smallest <EM>positive</EM> value
103
+ * for a floating point number, not actually the minimum (negative) value
104
+ * for a float. This constant equals 0xFF7FFFFF, the smallest (farthest
105
+ * negative) value a float can have before it hits NaN.
106
+ */
107
+ static final float MIN_FLOAT = -Float.MAX_VALUE;
108
+ /** Largest possible (positive) integer value */
109
+ static final int MAX_INT = Integer.MAX_VALUE;
110
+ /** Smallest possible (negative) integer value */
111
+ static final int MIN_INT = Integer.MIN_VALUE;
112
+
113
+ // shapes
114
+
115
+ static public final int VERTEX = 0;
116
+ static public final int BEZIER_VERTEX = 1;
117
+ static public final int QUADRATIC_VERTEX = 2;
118
+ static public final int CURVE_VERTEX = 3;
119
+ static public final int BREAK = 4;
120
+
121
+ @Deprecated
122
+ static public final int QUAD_BEZIER_VERTEX = 2; // should not have been exposed
123
+
124
+ // useful goodness
125
+
126
+ /**
127
+ * ( begin auto-generated from PI.xml )
128
+ *
129
+ * PI is a mathematical constant with the value 3.14159265358979323846. It
130
+ * is the ratio of the circumference of a circle to its diameter. It is
131
+ * useful in combination with the trigonometric functions <b>sin()</b> and
132
+ * <b>cos()</b>.
133
+ *
134
+ * ( end auto-generated )
135
+ * @webref constants
136
+ * @see PConstants#TWO_PI
137
+ * @see PConstants#TAU
138
+ * @see PConstants#HALF_PI
139
+ * @see PConstants#QUARTER_PI
140
+ *
141
+ */
142
+ static final float PI = (float) Math.PI;
143
+ /**
144
+ * ( begin auto-generated from HALF_PI.xml )
145
+ *
146
+ * HALF_PI is a mathematical constant with the value
147
+ * 1.57079632679489661923. It is half the ratio of the circumference of a
148
+ * circle to its diameter. It is useful in combination with the
149
+ * trigonometric functions <b>sin()</b> and <b>cos()</b>.
150
+ *
151
+ * ( end auto-generated )
152
+ * @webref constants
153
+ * @see PConstants#PI
154
+ * @see PConstants#TWO_PI
155
+ * @see PConstants#TAU
156
+ * @see PConstants#QUARTER_PI
157
+ */
158
+ static final float HALF_PI = (float) (Math.PI / 2.0);
159
+ static final float THIRD_PI = (float) (Math.PI / 3.0);
160
+ /**
161
+ * ( begin auto-generated from QUARTER_PI.xml )
162
+ *
163
+ * QUARTER_PI is a mathematical constant with the value 0.7853982. It is
164
+ * one quarter the ratio of the circumference of a circle to its diameter.
165
+ * It is useful in combination with the trigonometric functions
166
+ * <b>sin()</b> and <b>cos()</b>.
167
+ *
168
+ * ( end auto-generated )
169
+ * @webref constants
170
+ * @see PConstants#PI
171
+ * @see PConstants#TWO_PI
172
+ * @see PConstants#TAU
173
+ * @see PConstants#HALF_PI
174
+ */
175
+ static final float QUARTER_PI = (float) (Math.PI / 4.0);
176
+ /**
177
+ * ( begin auto-generated from TWO_PI.xml )
178
+ *
179
+ * TWO_PI is a mathematical constant with the value 6.28318530717958647693.
180
+ * It is twice the ratio of the circumference of a circle to its diameter.
181
+ * It is useful in combination with the trigonometric functions
182
+ * <b>sin()</b> and <b>cos()</b>.
183
+ *
184
+ * ( end auto-generated )
185
+ * @webref constants
186
+ * @see PConstants#PI
187
+ * @see PConstants#TAU
188
+ * @see PConstants#HALF_PI
189
+ * @see PConstants#QUARTER_PI
190
+ */
191
+ static final float TWO_PI = (float) (2.0 * Math.PI);
192
+ /**
193
+ * ( begin auto-generated from TAU.xml )
194
+ *
195
+ * TAU is an alias for TWO_PI, a mathematical constant with the value
196
+ * 6.28318530717958647693. It is twice the ratio of the circumference
197
+ * of a circle to its diameter. It is useful in combination with the
198
+ * trigonometric functions <b>sin()</b> and <b>cos()</b>.
199
+ *
200
+ * ( end auto-generated )
201
+ * @webref constants
202
+ * @see PConstants#PI
203
+ * @see PConstants#TWO_PI
204
+ * @see PConstants#HALF_PI
205
+ * @see PConstants#QUARTER_PI
206
+ */
207
+ static final float TAU = (float) (2.0 * Math.PI);
208
+
209
+ static final float DEG_TO_RAD = PI/180.0f;
210
+ static final float RAD_TO_DEG = 180.0f/PI;
211
+
212
+
213
+ // angle modes
214
+
215
+ //static final int RADIANS = 0;
216
+ //static final int DEGREES = 1;
217
+
218
+
219
+ // used by split, all the standard whitespace chars
220
+ // (also includes unicode nbsp, that little bostage)
221
+
222
+ static final String WHITESPACE = " \t\n\r\f\u00A0";
223
+
224
+
225
+ // for colors and/or images
226
+
227
+ static final int RGB = 1; // image & color
228
+ static final int ARGB = 2; // image
229
+ static final int HSB = 3; // color
230
+ static final int ALPHA = 4; // image
334
231
  // static final int CMYK = 5; // image & color (someday)
335
232
 
336
- // image file types
337
- /**
338
- *
339
- */
340
- static final int TIFF = 0;
341
-
342
- /**
343
- *
344
- */
345
- static final int TARGA = 1;
346
-
347
- /**
348
- *
349
- */
350
- static final int JPEG = 2;
351
-
352
- /**
353
- *
354
- */
355
- static final int GIF = 3;
356
-
357
- // filter/convert types
358
- /**
359
- *
360
- */
361
- static final int BLUR = 11;
362
-
363
- /**
364
- *
365
- */
366
- static final int GRAY = 12;
367
-
368
- /**
369
- *
370
- */
371
- static final int INVERT = 13;
372
-
373
- /**
374
- *
375
- */
376
- static final int OPAQUE = 14;
377
-
378
- /**
379
- *
380
- */
381
- static final int POSTERIZE = 15;
382
-
383
- /**
384
- *
385
- */
386
- static final int THRESHOLD = 16;
387
-
388
- /**
389
- *
390
- */
391
- static final int ERODE = 17;
392
-
393
- /**
394
- *
395
- */
396
- static final int DILATE = 18;
397
-
398
- // blend mode keyword definitions
399
- // @see processing.core.PImage#blendColor(int,int,int)
400
- /**
401
- *
402
- */
403
- public final static int REPLACE = 0;
404
-
405
- /**
406
- *
407
- */
408
- public final static int BLEND = 1;
409
-
410
- /**
411
- *
412
- */
413
- public final static int ADD = 1 << 1;
414
-
415
- /**
416
- *
417
- */
418
- public final static int SUBTRACT = 1 << 2;
419
-
420
- /**
421
- *
422
- */
423
- public final static int LIGHTEST = 1 << 3;
424
-
425
- /**
426
- *
427
- */
428
- public final static int DARKEST = 1 << 4;
429
-
430
- /**
431
- *
432
- */
433
- public final static int DIFFERENCE = 1 << 5;
434
-
435
- /**
436
- *
437
- */
438
- public final static int EXCLUSION = 1 << 6;
439
-
440
- /**
441
- *
442
- */
443
- public final static int MULTIPLY = 1 << 7;
444
-
445
- /**
446
- *
447
- */
448
- public final static int SCREEN = 1 << 8;
449
-
450
- /**
451
- *
452
- */
453
- public final static int OVERLAY = 1 << 9;
454
-
455
- /**
456
- *
457
- */
458
- public final static int HARD_LIGHT = 1 << 10;
459
-
460
- /**
461
- *
462
- */
463
- public final static int SOFT_LIGHT = 1 << 11;
464
-
465
- /**
466
- *
467
- */
468
- public final static int DODGE = 1 << 12;
469
-
470
- /**
471
- *
472
- */
473
- public final static int BURN = 1 << 13;
474
-
475
- // for messages
476
- /**
477
- *
478
- */
479
- static final int CHATTER = 0;
480
-
481
- /**
482
- *
483
- */
484
- static final int COMPLAINT = 1;
485
-
486
- /**
487
- *
488
- */
489
- static final int PROBLEM = 2;
490
-
491
- // types of transformation matrices
492
- /**
493
- *
494
- */
495
- static final int PROJECTION = 0;
496
-
497
- /**
498
- *
499
- */
500
- static final int MODELVIEW = 1;
501
-
502
- // types of projection matrices
503
- /**
504
- *
505
- */
506
- static final int CUSTOM = 0; // user-specified fanciness
507
-
508
- /**
509
- *
510
- */
511
- static final int ORTHOGRAPHIC = 2; // 2D isometric projection
512
-
513
- /**
514
- *
515
- */
516
- static final int PERSPECTIVE = 3; // perspective matrix
517
-
518
- // shapes
519
- // the low four bits set the variety,
520
- // higher bits set the specific shape type
521
- /**
522
- *
523
- */
524
- static final int GROUP = 0; // createShape()
525
-
526
- /**
527
- *
528
- */
529
- static final int POINT = 2; // primitive
530
-
531
- /**
532
- *
533
- */
534
- static final int POINTS = 3; // vertices
535
-
536
- /**
537
- *
538
- */
539
- static final int LINE = 4; // primitive
540
-
541
- /**
542
- *
543
- */
544
- static final int LINES = 5; // beginShape(), createShape()
545
-
546
- /**
547
- *
548
- */
549
- static final int LINE_STRIP = 50; // beginShape()
550
-
551
- /**
552
- *
553
- */
554
- static final int LINE_LOOP = 51;
555
-
556
- /**
557
- *
558
- */
559
- static final int TRIANGLE = 8; // primitive
560
-
561
- /**
562
- *
563
- */
564
- static final int TRIANGLES = 9; // vertices
565
-
566
- /**
567
- *
568
- */
569
- static final int TRIANGLE_STRIP = 10; // vertices
570
-
571
- /**
572
- *
573
- */
574
- static final int TRIANGLE_FAN = 11; // vertices
575
-
576
- /**
577
- *
578
- */
579
- static final int QUAD = 16; // primitive
580
-
581
- /**
582
- *
583
- */
584
- static final int QUADS = 17; // vertices
585
-
586
- /**
587
- *
588
- */
589
- static final int QUAD_STRIP = 18; // vertices
590
-
591
- /**
592
- *
593
- */
594
- static final int POLYGON = 20; // in the end, probably cannot
595
-
596
- /**
597
- *
598
- */
599
- static final int PATH = 21; // separate these two
600
-
601
- /**
602
- *
603
- */
604
- static final int RECT = 30; // primitive
605
-
606
- /**
607
- *
608
- */
609
- static final int ELLIPSE = 31; // primitive
610
-
611
- /**
612
- *
613
- */
614
- static final int ARC = 32; // primitive
615
-
616
- /**
617
- *
618
- */
619
- static final int SPHERE = 40; // primitive
620
-
621
- /**
622
- *
623
- */
624
- static final int BOX = 41; // primitive
233
+
234
+ // image file types
235
+
236
+ static final int TIFF = 0;
237
+ static final int TARGA = 1;
238
+ static final int JPEG = 2;
239
+ static final int GIF = 3;
240
+
241
+
242
+ // filter/convert types
243
+
244
+ static final int BLUR = 11;
245
+ static final int GRAY = 12;
246
+ static final int INVERT = 13;
247
+ static final int OPAQUE = 14;
248
+ static final int POSTERIZE = 15;
249
+ static final int THRESHOLD = 16;
250
+ static final int ERODE = 17;
251
+ static final int DILATE = 18;
252
+
253
+
254
+ // blend mode keyword definitions
255
+ // @see processing.core.PImage#blendColor(int,int,int)
256
+
257
+ public final static int REPLACE = 0;
258
+ public final static int BLEND = 1 << 0;
259
+ public final static int ADD = 1 << 1;
260
+ public final static int SUBTRACT = 1 << 2;
261
+ public final static int LIGHTEST = 1 << 3;
262
+ public final static int DARKEST = 1 << 4;
263
+ public final static int DIFFERENCE = 1 << 5;
264
+ public final static int EXCLUSION = 1 << 6;
265
+ public final static int MULTIPLY = 1 << 7;
266
+ public final static int SCREEN = 1 << 8;
267
+ public final static int OVERLAY = 1 << 9;
268
+ public final static int HARD_LIGHT = 1 << 10;
269
+ public final static int SOFT_LIGHT = 1 << 11;
270
+ public final static int DODGE = 1 << 12;
271
+ public final static int BURN = 1 << 13;
272
+
273
+ // for messages
274
+
275
+ static final int CHATTER = 0;
276
+ static final int COMPLAINT = 1;
277
+ static final int PROBLEM = 2;
278
+
279
+
280
+ // types of transformation matrices
281
+
282
+ static final int PROJECTION = 0;
283
+ static final int MODELVIEW = 1;
284
+
285
+ // types of projection matrices
286
+
287
+ static final int CUSTOM = 0; // user-specified fanciness
288
+ static final int ORTHOGRAPHIC = 2; // 2D isometric projection
289
+ static final int PERSPECTIVE = 3; // perspective matrix
290
+
291
+
292
+ // shapes
293
+
294
+ // the low four bits set the variety,
295
+ // higher bits set the specific shape type
296
+
297
+ static final int GROUP = 0; // createShape()
298
+
299
+ static final int POINT = 2; // primitive
300
+ static final int POINTS = 3; // vertices
301
+
302
+ static final int LINE = 4; // primitive
303
+ static final int LINES = 5; // beginShape(), createShape()
304
+ static final int LINE_STRIP = 50; // beginShape()
305
+ static final int LINE_LOOP = 51;
306
+
307
+ static final int TRIANGLE = 8; // primitive
308
+ static final int TRIANGLES = 9; // vertices
309
+ static final int TRIANGLE_STRIP = 10; // vertices
310
+ static final int TRIANGLE_FAN = 11; // vertices
311
+
312
+ static final int QUAD = 16; // primitive
313
+ static final int QUADS = 17; // vertices
314
+ static final int QUAD_STRIP = 18; // vertices
315
+
316
+ static final int POLYGON = 20; // in the end, probably cannot
317
+ static final int PATH = 21; // separate these two
318
+
319
+ static final int RECT = 30; // primitive
320
+ static final int ELLIPSE = 31; // primitive
321
+ static final int ARC = 32; // primitive
322
+
323
+ static final int SPHERE = 40; // primitive
324
+ static final int BOX = 41; // primitive
625
325
 
626
326
  // static public final int POINT_SPRITES = 52;
627
327
  // static public final int NON_STROKED_SHAPE = 60;
628
328
  // static public final int STROKED_SHAPE = 61;
629
- // shape closing modes
630
- /**
631
- *
632
- */
633
- static final int OPEN = 1;
634
-
635
- /**
636
- *
637
- */
638
- static final int CLOSE = 2;
639
-
640
- // shape drawing modes
641
- /**
642
- * Draw mode convention to use (x, y) to (width, height)
643
- */
644
- static final int CORNER = 0;
645
- /**
646
- * Draw mode convention to use (x1, y1) to (x2, y2) coordinates
647
- */
648
- static final int CORNERS = 1;
649
- /**
650
- * Draw mode from the center, and using the radius
651
- */
652
- static final int RADIUS = 2;
653
- /**
654
- * Draw from the center, using second pair of values as the diameter.
655
- * Formerly called CENTER_DIAMETER in alpha releases.
656
- */
657
- static final int CENTER = 3;
658
- /**
659
- * Synonym for the CENTER constant. Draw from the center, using second pair
660
- * of values as the diameter.
661
- */
662
- static final int DIAMETER = 3;
663
-
664
- // arc drawing modes
665
- //static final int OPEN = 1; // shared
666
- /**
667
- *
668
- */
669
- static final int CHORD = 2;
670
-
671
- /**
672
- *
673
- */
674
- static final int PIE = 3;
675
-
676
- // vertically alignment modes for text
677
- /**
678
- * Default vertical alignment for text placement
679
- */
680
- static final int BASELINE = 0;
681
- /**
682
- * Align text to the top
683
- */
684
- static final int TOP = 101;
685
- /**
686
- * Align text from the bottom, using the baseline.
687
- */
688
- static final int BOTTOM = 102;
689
-
690
- // uv texture orientation modes
691
- /**
692
- * texture coordinates in 0..1 range
693
- */
694
- static final int NORMAL = 1;
695
- /**
696
- * texture coordinates based on image width/height
697
- */
698
- static final int IMAGE = 2;
699
-
700
- // texture wrapping modes
701
- /**
702
- * textures are clamped to their edges
703
- */
704
- public static final int CLAMP = 0;
705
- /**
706
- * textures wrap around when uv values go outside 0..1 range
707
- */
708
- public static final int REPEAT = 1;
709
-
710
- // text placement modes
711
- /**
712
- * textMode(MODEL) is the default, meaning that characters will be affected
713
- * by transformations like any other shapes.
714
- * <p/>
715
- * Changed value in 0093 to not interfere with LEFT, CENTER, and RIGHT.
716
- */
717
- static final int MODEL = 4;
718
-
719
- /**
720
- * textMode(SHAPE) draws text using the the glyph outlines of individual
721
- * characters rather than as textures. If the outlines are not available,
722
- * then textMode(SHAPE) will be ignored and textMode(MODEL) will be used
723
- * instead. For this reason, be sure to call textMode()
724
- * <EM>after</EM> calling textFont().
725
- * <p/>
726
- * Currently, textMode(SHAPE) is only supported by OPENGL mode. It also
727
- * requires Java 1.2 or higher (OPENGL requires 1.4 anyway)
728
- */
729
- static final int SHAPE = 5;
730
-
731
- // text alignment modes
732
- // are inherited from LEFT, CENTER, RIGHT
733
- // stroke modes
734
- /**
735
- *
736
- */
737
- static final int SQUARE = 1 << 0; // called 'butt' in the svg spec
738
-
739
- /**
740
- *
741
- */
742
- static final int ROUND = 1 << 1;
743
-
744
- /**
745
- *
746
- */
747
- static final int PROJECT = 1 << 2; // called 'square' in the svg spec
748
-
749
- /**
750
- *
751
- */
752
- static final int MITER = 1 << 3;
753
-
754
- /**
755
- *
756
- */
757
- static final int BEVEL = 1 << 5;
758
-
759
- // lighting
760
- /**
761
- *
762
- */
763
- static final int AMBIENT = 0;
764
-
765
- /**
766
- *
767
- */
768
- static final int DIRECTIONAL = 1;
769
- //static final int POINT = 2; // shared with shape feature
770
-
771
- /**
772
- *
773
- */
774
- static final int SPOT = 3;
775
-
776
- // key constants
777
- // only including the most-used of these guys
778
- // if people need more esoteric keys, they can learn about
779
- // the esoteric java KeyEvent api and of virtual keys
780
- // both key and keyCode will equal these values
781
- // for 0125, these were changed to 'char' values, because they
782
- // can be upgraded to ints automatically by Java, but having them
783
- // as ints prevented split(blah, TAB) from working
784
- /**
785
- *
786
- */
787
- static final char BACKSPACE = 8;
788
-
789
- /**
790
- *
791
- */
792
- static final char TAB = 9;
793
-
794
- /**
795
- *
796
- */
797
- static final char ENTER = 10;
798
-
799
- /**
800
- *
801
- */
802
- static final char RETURN = 13;
803
-
804
- /**
805
- *
806
- */
807
- static final char ESC = 27;
808
-
809
- /**
810
- *
811
- */
812
- static final char DELETE = 127;
813
-
814
- // i.e. if ((key == CODED) && (keyCode == UP))
815
- /**
816
- *
817
- */
818
- static final int CODED = 0xffff;
819
-
820
- // key will be CODED and keyCode will be this value
821
- /**
822
- *
823
- */
824
- static final int UP = KeyEvent.VK_UP;
825
-
826
- /**
827
- *
828
- */
829
- static final int DOWN = KeyEvent.VK_DOWN;
830
-
831
- /**
832
- *
833
- */
834
- static final int LEFT = KeyEvent.VK_LEFT;
835
-
836
- /**
837
- *
838
- */
839
- static final int RIGHT = KeyEvent.VK_RIGHT;
840
-
841
- // key will be CODED and keyCode will be this value
842
- /**
843
- *
844
- */
845
- static final int ALT = KeyEvent.VK_ALT;
846
-
847
- /**
848
- *
849
- */
850
- static final int CONTROL = KeyEvent.VK_CONTROL;
851
-
852
- /**
853
- *
854
- */
855
- static final int SHIFT = KeyEvent.VK_SHIFT;
856
-
857
- // orientations (only used on Android, ignored on desktop)
858
- /**
859
- * Screen orientation constant for portrait (the hamburger way).
860
- */
861
- static final int PORTRAIT = 1;
862
- /**
863
- * Screen orientation constant for landscape (the hot dog way).
864
- */
865
- static final int LANDSCAPE = 2;
866
-
867
- /**
868
- * Use with fullScreen() to indicate all available displays.
869
- */
870
- static final int SPAN = 0;
871
-
872
- // cursor types
873
- /**
874
- *
875
- */
876
- static final int ARROW = Cursor.DEFAULT_CURSOR;
877
-
878
- /**
879
- *
880
- */
881
- static final int CROSS = Cursor.CROSSHAIR_CURSOR;
882
-
883
- /**
884
- *
885
- */
886
- static final int HAND = Cursor.HAND_CURSOR;
887
-
888
- /**
889
- *
890
- */
891
- static final int MOVE = Cursor.MOVE_CURSOR;
892
-
893
- /**
894
- *
895
- */
896
- static final int TEXT = Cursor.TEXT_CURSOR;
897
-
898
- /**
899
- *
900
- */
901
- static final int WAIT = Cursor.WAIT_CURSOR;
902
-
903
- // hints - hint values are positive for the alternate version,
904
- // negative of the same value returns to the normal/default state
905
- /**
906
- *
907
- * @deprecated
908
- */
909
- @Deprecated
910
- static final int ENABLE_NATIVE_FONTS = 1;
911
-
912
- /**
913
- *
914
- * @deprecated
915
- */
916
- @Deprecated
917
- static final int DISABLE_NATIVE_FONTS = -1;
918
-
919
- /**
920
- *
921
- */
922
- static final int DISABLE_DEPTH_TEST = 2;
923
-
924
- /**
925
- *
926
- */
927
- static final int ENABLE_DEPTH_TEST = -2;
928
-
929
- /**
930
- *
931
- */
932
- static final int ENABLE_DEPTH_SORT = 3;
933
-
934
- /**
935
- *
936
- */
937
- static final int DISABLE_DEPTH_SORT = -3;
938
-
939
- /**
940
- *
941
- */
942
- static final int DISABLE_OPENGL_ERRORS = 4;
943
-
944
- /**
945
- *
946
- */
947
- static final int ENABLE_OPENGL_ERRORS = -4;
948
-
949
- /**
950
- *
951
- */
952
- static final int DISABLE_DEPTH_MASK = 5;
953
-
954
- /**
955
- *
956
- */
957
- static final int ENABLE_DEPTH_MASK = -5;
958
-
959
- /**
960
- *
961
- */
962
- static final int DISABLE_OPTIMIZED_STROKE = 6;
963
-
964
- /**
965
- *
966
- */
967
- static final int ENABLE_OPTIMIZED_STROKE = -6;
968
-
969
- /**
970
- *
971
- */
972
- static final int ENABLE_STROKE_PERSPECTIVE = 7;
973
-
974
- /**
975
- *
976
- */
977
- static final int DISABLE_STROKE_PERSPECTIVE = -7;
978
-
979
- /**
980
- *
981
- */
982
- static final int DISABLE_TEXTURE_MIPMAPS = 8;
983
-
984
- /**
985
- *
986
- */
987
- static final int ENABLE_TEXTURE_MIPMAPS = -8;
988
-
989
- /**
990
- *
991
- */
992
- static final int ENABLE_STROKE_PURE = 9;
993
-
994
- /**
995
- *
996
- */
997
- static final int DISABLE_STROKE_PURE = -9;
998
-
999
- /**
1000
- *
1001
- */
1002
- static final int ENABLE_BUFFER_READING = 10;
1003
-
1004
- /**
1005
- *
1006
- */
1007
- static final int DISABLE_BUFFER_READING = -10;
1008
-
1009
- /**
1010
- *
1011
- */
1012
- static final int DISABLE_KEY_REPEAT = 11;
1013
-
1014
- /**
1015
- *
1016
- */
1017
- static final int ENABLE_KEY_REPEAT = -11;
1018
-
1019
- /**
1020
- *
1021
- */
1022
- static final int DISABLE_ASYNC_SAVEFRAME = 12;
1023
-
1024
- /**
1025
- *
1026
- */
1027
- static final int ENABLE_ASYNC_SAVEFRAME = -12;
1028
-
1029
- /**
1030
- *
1031
- */
1032
- static final int HINT_COUNT = 13;
329
+
330
+
331
+ // shape closing modes
332
+
333
+ static final int OPEN = 1;
334
+ static final int CLOSE = 2;
335
+
336
+
337
+ // shape drawing modes
338
+
339
+ /** Draw mode convention to use (x, y) to (width, height) */
340
+ static final int CORNER = 0;
341
+ /** Draw mode convention to use (x1, y1) to (x2, y2) coordinates */
342
+ static final int CORNERS = 1;
343
+ /** Draw mode from the center, and using the radius */
344
+ static final int RADIUS = 2;
345
+ /**
346
+ * Draw from the center, using second pair of values as the diameter.
347
+ * Formerly called CENTER_DIAMETER in alpha releases.
348
+ */
349
+ static final int CENTER = 3;
350
+ /**
351
+ * Synonym for the CENTER constant. Draw from the center,
352
+ * using second pair of values as the diameter.
353
+ */
354
+ static final int DIAMETER = 3;
355
+
356
+
357
+ // arc drawing modes
358
+
359
+ //static final int OPEN = 1; // shared
360
+ static final int CHORD = 2;
361
+ static final int PIE = 3;
362
+
363
+
364
+ // vertically alignment modes for text
365
+
366
+ /** Default vertical alignment for text placement */
367
+ static final int BASELINE = 0;
368
+ /** Align text to the top */
369
+ static final int TOP = 101;
370
+ /** Align text from the bottom, using the baseline. */
371
+ static final int BOTTOM = 102;
372
+
373
+
374
+ // uv texture orientation modes
375
+
376
+ /** texture coordinates in 0..1 range */
377
+ static final int NORMAL = 1;
378
+ /** texture coordinates based on image width/height */
379
+ static final int IMAGE = 2;
380
+
381
+
382
+ // texture wrapping modes
383
+
384
+ /** textures are clamped to their edges */
385
+ public static final int CLAMP = 0;
386
+ /** textures wrap around when uv values go outside 0..1 range */
387
+ public static final int REPEAT = 1;
388
+
389
+
390
+ // text placement modes
391
+
392
+ /**
393
+ * textMode(MODEL) is the default, meaning that characters
394
+ * will be affected by transformations like any other shapes.
395
+ * <p/>
396
+ * Changed value in 0093 to not interfere with LEFT, CENTER, and RIGHT.
397
+ */
398
+ static final int MODEL = 4;
399
+
400
+ /**
401
+ * textMode(SHAPE) draws text using the the glyph outlines of
402
+ * individual characters rather than as textures. If the outlines are
403
+ * not available, then textMode(SHAPE) will be ignored and textMode(MODEL)
404
+ * will be used instead. For this reason, be sure to call textMode()
405
+ * <EM>after</EM> calling textFont().
406
+ * <p/>
407
+ * Currently, textMode(SHAPE) is only supported by OPENGL mode.
408
+ * It also requires Java 1.2 or higher (OPENGL requires 1.4 anyway)
409
+ */
410
+ static final int SHAPE = 5;
411
+
412
+
413
+ // text alignment modes
414
+ // are inherited from LEFT, CENTER, RIGHT
415
+
416
+ // stroke modes
417
+
418
+ static final int SQUARE = 1 << 0; // called 'butt' in the svg spec
419
+ static final int ROUND = 1 << 1;
420
+ static final int PROJECT = 1 << 2; // called 'square' in the svg spec
421
+ static final int MITER = 1 << 3;
422
+ static final int BEVEL = 1 << 5;
423
+
424
+
425
+ // lighting
426
+
427
+ static final int AMBIENT = 0;
428
+ static final int DIRECTIONAL = 1;
429
+ //static final int POINT = 2; // shared with shape feature
430
+ static final int SPOT = 3;
431
+
432
+
433
+ // key constants
434
+
435
+ // only including the most-used of these guys
436
+ // if people need more esoteric keys, they can learn about
437
+ // the esoteric java KeyEvent api and of virtual keys
438
+
439
+ // both key and keyCode will equal these values
440
+ // for 0125, these were changed to 'char' values, because they
441
+ // can be upgraded to ints automatically by Java, but having them
442
+ // as ints prevented split(blah, TAB) from working
443
+ static final char BACKSPACE = 8;
444
+ static final char TAB = 9;
445
+ static final char ENTER = 10;
446
+ static final char RETURN = 13;
447
+ static final char ESC = 27;
448
+ static final char DELETE = 127;
449
+
450
+ // i.e. if ((key == CODED) && (keyCode == UP))
451
+ static final int CODED = 0xffff;
452
+
453
+ // key will be CODED and keyCode will be this value
454
+ static final int UP = KeyEvent.VK_UP;
455
+ static final int DOWN = KeyEvent.VK_DOWN;
456
+ static final int LEFT = KeyEvent.VK_LEFT;
457
+ static final int RIGHT = KeyEvent.VK_RIGHT;
458
+
459
+ // key will be CODED and keyCode will be this value
460
+ static final int ALT = KeyEvent.VK_ALT;
461
+ static final int CONTROL = KeyEvent.VK_CONTROL;
462
+ static final int SHIFT = KeyEvent.VK_SHIFT;
463
+
464
+
465
+ // orientations (only used on Android, ignored on desktop)
466
+
467
+ /** Screen orientation constant for portrait (the hamburger way). */
468
+ static final int PORTRAIT = 1;
469
+ /** Screen orientation constant for landscape (the hot dog way). */
470
+ static final int LANDSCAPE = 2;
471
+
472
+ /** Use with fullScreen() to indicate all available displays. */
473
+ static final int SPAN = 0;
474
+
475
+ // cursor types
476
+
477
+ static final int ARROW = Cursor.DEFAULT_CURSOR;
478
+ static final int CROSS = Cursor.CROSSHAIR_CURSOR;
479
+ static final int HAND = Cursor.HAND_CURSOR;
480
+ static final int MOVE = Cursor.MOVE_CURSOR;
481
+ static final int TEXT = Cursor.TEXT_CURSOR;
482
+ static final int WAIT = Cursor.WAIT_CURSOR;
483
+
484
+
485
+ // hints - hint values are positive for the alternate version,
486
+ // negative of the same value returns to the normal/default state
487
+
488
+ @Deprecated
489
+ static final int ENABLE_NATIVE_FONTS = 1;
490
+ @Deprecated
491
+ static final int DISABLE_NATIVE_FONTS = -1;
492
+
493
+ static final int DISABLE_DEPTH_TEST = 2;
494
+ static final int ENABLE_DEPTH_TEST = -2;
495
+
496
+ static final int ENABLE_DEPTH_SORT = 3;
497
+ static final int DISABLE_DEPTH_SORT = -3;
498
+
499
+ static final int DISABLE_OPENGL_ERRORS = 4;
500
+ static final int ENABLE_OPENGL_ERRORS = -4;
501
+
502
+ static final int DISABLE_DEPTH_MASK = 5;
503
+ static final int ENABLE_DEPTH_MASK = -5;
504
+
505
+ static final int DISABLE_OPTIMIZED_STROKE = 6;
506
+ static final int ENABLE_OPTIMIZED_STROKE = -6;
507
+
508
+ static final int ENABLE_STROKE_PERSPECTIVE = 7;
509
+ static final int DISABLE_STROKE_PERSPECTIVE = -7;
510
+
511
+ static final int DISABLE_TEXTURE_MIPMAPS = 8;
512
+ static final int ENABLE_TEXTURE_MIPMAPS = -8;
513
+
514
+ static final int ENABLE_STROKE_PURE = 9;
515
+ static final int DISABLE_STROKE_PURE = -9;
516
+
517
+ static final int ENABLE_BUFFER_READING = 10;
518
+ static final int DISABLE_BUFFER_READING = -10;
519
+
520
+ static final int DISABLE_KEY_REPEAT = 11;
521
+ static final int ENABLE_KEY_REPEAT = -11;
522
+
523
+ static final int DISABLE_ASYNC_SAVEFRAME = 12;
524
+ static final int ENABLE_ASYNC_SAVEFRAME = -12;
525
+
526
+ static final int HINT_COUNT = 13;
1033
527
  }