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
@@ -99,11 +99,7 @@ public class PImage implements PConstants, Cloneable {
99
99
 
100
100
  /** Actual dimensions of pixels array, taking into account the 2x setting. */
101
101
  public int pixelWidth;
102
-
103
- /**
104
- *
105
- */
106
- public int pixelHeight;
102
+ public int pixelHeight;
107
103
 
108
104
  /**
109
105
  * ( begin auto-generated from PImage_width.xml )
@@ -141,26 +137,7 @@ public class PImage implements PConstants, Cloneable {
141
137
 
142
138
  /** modified portion of the image */
143
139
  protected boolean modified;
144
-
145
- /**
146
- *
147
- */
148
- protected int mx1,
149
-
150
- /**
151
- *
152
- */
153
- my1,
154
-
155
- /**
156
- *
157
- */
158
- mx2,
159
-
160
- /**
161
- *
162
- */
163
- my2;
140
+ protected int mx1, my1, mx2, my2;
164
141
 
165
142
  /** Loaded pixels flag */
166
143
  public boolean loaded = false;
@@ -189,26 +166,10 @@ public class PImage implements PConstants, Cloneable {
189
166
  private int[][] blurMult;
190
167
 
191
168
  // colour component bitmasks (moved from PConstants in 2.0b7)
192
-
193
- /**
194
- *
195
- */
196
169
  public static final int ALPHA_MASK = 0xff000000;
197
-
198
- /**
199
- *
200
- */
201
- public static final int RED_MASK = 0x00ff0000;
202
-
203
- /**
204
- *
205
- */
206
- public static final int GREEN_MASK = 0x0000ff00;
207
-
208
- /**
209
- *
210
- */
211
- public static final int BLUE_MASK = 0x000000ff;
170
+ public static final int RED_MASK = 0x00ff0000;
171
+ public static final int GREEN_MASK = 0x0000ff00;
172
+ public static final int BLUE_MASK = 0x000000ff;
212
173
 
213
174
 
214
175
  //////////////////////////////////////////////////////////////
@@ -266,8 +227,6 @@ public class PImage implements PConstants, Cloneable {
266
227
 
267
228
 
268
229
  /**
269
- * @param width
270
- * @param height
271
230
  * @nowebref
272
231
  * @param format Either RGB, ARGB, ALPHA (grayscale alpha channel)
273
232
  */
@@ -275,23 +234,14 @@ public class PImage implements PConstants, Cloneable {
275
234
  init(width, height, format, 1);
276
235
  }
277
236
 
278
- /**
279
- *
280
- * @param width
281
- * @param height
282
- * @param format
283
- * @param factor
284
- */
285
- public PImage(int width, int height, int format, int factor) {
237
+
238
+ public PImage(int width, int height, int format, int factor) {
286
239
  init(width, height, format, factor);
287
240
  }
288
241
 
289
242
 
290
243
  /**
291
244
  * Do not remove, see notes in the other variant.
292
- * @param width
293
- * @param height
294
- * @param format
295
245
  */
296
246
  public void init(int width, int height, int format) { // ignore
297
247
  init(width, height, format, 1);
@@ -304,10 +254,6 @@ public class PImage implements PConstants, Cloneable {
304
254
  * Used by Capture and Movie classes (and perhaps others),
305
255
  * because the width/height will not be known when super() is called.
306
256
  * (Leave this public so that other libraries can do the same.)
307
- * @param width
308
- * @param factor
309
- * @param height
310
- * @param format
311
257
  */
312
258
  public void init(int width, int height, int format, int factor) { // ignore
313
259
  this.width = width;
@@ -400,7 +346,6 @@ public class PImage implements PConstants, Cloneable {
400
346
  * Use the getNative() method instead, which allows library interfaces to be
401
347
  * written in a cross-platform fashion for desktop, Android, and others.
402
348
  * This is still included for PGraphics objects, which may need the image.
403
- * @return
404
349
  */
405
350
  public Image getImage() { // ignore
406
351
  return (Image) getNative();
@@ -409,7 +354,6 @@ public class PImage implements PConstants, Cloneable {
409
354
 
410
355
  /**
411
356
  * Returns a native BufferedImage from this PImage.
412
- * @return
413
357
  */
414
358
  public Object getNative() { // ignore
415
359
  loadPixels();
@@ -426,20 +370,13 @@ public class PImage implements PConstants, Cloneable {
426
370
 
427
371
  // MARKING IMAGE AS MODIFIED / FOR USE w/ GET/SET
428
372
 
429
- /**
430
- *
431
- * @return
432
- */
433
-
434
373
 
435
374
  public boolean isModified() { // ignore
436
375
  return modified;
437
376
  }
438
377
 
439
- /**
440
- *
441
- */
442
- public void setModified() { // ignore
378
+
379
+ public void setModified() { // ignore
443
380
  modified = true;
444
381
  mx1 = 0;
445
382
  my1 = 0;
@@ -447,43 +384,28 @@ public class PImage implements PConstants, Cloneable {
447
384
  my2 = pixelHeight;
448
385
  }
449
386
 
450
- /**
451
- *
452
- * @param m
453
- */
454
- public void setModified(boolean m) { // ignore
387
+
388
+ public void setModified(boolean m) { // ignore
455
389
  modified = m;
456
390
  }
457
391
 
458
- /**
459
- *
460
- * @return
461
- */
462
- public int getModifiedX1() { // ignore
392
+
393
+ public int getModifiedX1() { // ignore
463
394
  return mx1;
464
395
  }
465
396
 
466
- /**
467
- *
468
- * @return
469
- */
470
- public int getModifiedX2() { // ignore
397
+
398
+ public int getModifiedX2() { // ignore
471
399
  return mx2;
472
400
  }
473
401
 
474
- /**
475
- *
476
- * @return
477
- */
478
- public int getModifiedY1() { // ignore
402
+
403
+ public int getModifiedY1() { // ignore
479
404
  return my1;
480
405
  }
481
406
 
482
- /**
483
- *
484
- * @return
485
- */
486
- public int getModifiedY2() { // ignore
407
+
408
+ public int getModifiedY2() { // ignore
487
409
  return my2;
488
410
  }
489
411
 
@@ -520,10 +442,8 @@ public class PImage implements PConstants, Cloneable {
520
442
  setLoaded();
521
443
  }
522
444
 
523
- /**
524
- *
525
- */
526
- public void updatePixels() { // ignore
445
+
446
+ public void updatePixels() { // ignore
527
447
  updatePixels(0, 0, pixelWidth, pixelHeight);
528
448
  }
529
449
 
@@ -596,8 +516,6 @@ public class PImage implements PConstants, Cloneable {
596
516
  * override of Object.clone(). We recommend using get() instead,
597
517
  * because it prevents you from needing to catch the
598
518
  * CloneNotSupportedException, and from doing a cast from the result.
599
- * @return
600
- * @throws java.lang.CloneNotSupportedException
601
519
  */
602
520
  @Override
603
521
  public Object clone() throws CloneNotSupportedException { // ignore
@@ -734,28 +652,18 @@ public class PImage implements PConstants, Cloneable {
734
652
 
735
653
  // MARKING IMAGE AS LOADED / FOR USE IN RENDERERS
736
654
 
737
- /**
738
- *
739
- * @return
740
- */
741
-
742
655
 
743
656
  public boolean isLoaded() { // ignore
744
657
  return loaded;
745
658
  }
746
659
 
747
- /**
748
- *
749
- */
750
- public void setLoaded() { // ignore
660
+
661
+ public void setLoaded() { // ignore
751
662
  loaded = true;
752
663
  }
753
664
 
754
- /**
755
- *
756
- * @param l
757
- */
758
- public void setLoaded(boolean l) { // ignore
665
+
666
+ public void setLoaded(boolean l) { // ignore
759
667
  loaded = l;
760
668
  }
761
669
 
@@ -807,7 +715,6 @@ public class PImage implements PConstants, Cloneable {
807
715
  * type it is. If you want things to be more efficient, access the
808
716
  * pixels[] array directly.
809
717
  *
810
- * @return
811
718
  * @webref image:pixels
812
719
  * @brief Reads the color of any pixel or grabs a rectangle of pixels
813
720
  * @usage web_application
@@ -835,11 +742,8 @@ public class PImage implements PConstants, Cloneable {
835
742
 
836
743
 
837
744
  /**
838
- * @param x
839
- * @param y
840
745
  * @param w width of pixel rectangle to get
841
746
  * @param h height of pixel rectangle to get
842
- * @return
843
747
  */
844
748
  public PImage get(int x, int y, int w, int h) {
845
749
  int targetX = 0;
@@ -896,7 +800,6 @@ public class PImage implements PConstants, Cloneable {
896
800
  /**
897
801
  * Returns a copy of this PImage. Equivalent to get(0, 0, width, height).
898
802
  * Deprecated, just use copy() instead.
899
- * @return
900
803
  */
901
804
  public PImage get() {
902
805
  // Formerly this used clone(), which caused memory problems.
@@ -904,11 +807,8 @@ public class PImage implements PConstants, Cloneable {
904
807
  return get(0, 0, pixelWidth, pixelHeight);
905
808
  }
906
809
 
907
- /**
908
- *
909
- * @return
910
- */
911
- public PImage copy() {
810
+
811
+ public PImage copy() {
912
812
  return get(0, 0, pixelWidth, pixelHeight);
913
813
  }
914
814
 
@@ -918,13 +818,6 @@ public class PImage implements PConstants, Cloneable {
918
818
  * has already been properly cropped to a valid region. That is, x/y/w/h
919
819
  * are guaranteed to be inside the image space, so the implementation can
920
820
  * use the fastest possible pixel copying method.
921
- * @param sourceX
922
- * @param sourceY
923
- * @param sourceWidth
924
- * @param target
925
- * @param sourceHeight
926
- * @param targetX
927
- * @param targetY
928
821
  */
929
822
  protected void getImpl(int sourceX, int sourceY,
930
823
  int sourceWidth, int sourceHeight,
@@ -983,9 +876,7 @@ public class PImage implements PConstants, Cloneable {
983
876
  * No variations are employed, meaning that any scale, tint, or imageMode
984
877
  * settings will be ignored.
985
878
  *
986
- * @param x
987
879
  * @param img image to copy into the original image
988
- * @param y
989
880
  */
990
881
  public void set(int x, int y, PImage img) {
991
882
  int sx = 0;
@@ -1020,13 +911,6 @@ public class PImage implements PConstants, Cloneable {
1020
911
  /**
1021
912
  * Internal function to actually handle setting a block of pixels that
1022
913
  * has already been properly cropped from the image to a valid region.
1023
- * @param sourceImage
1024
- * @param sourceX
1025
- * @param targetY
1026
- * @param sourceHeight
1027
- * @param sourceY
1028
- * @param sourceWidth
1029
- * @param targetX
1030
914
  */
1031
915
  protected void setImpl(PImage sourceImage,
1032
916
  int sourceX, int sourceY,
@@ -1116,11 +1000,6 @@ public class PImage implements PConstants, Cloneable {
1116
1000
 
1117
1001
  // IMAGE FILTERS
1118
1002
 
1119
- /**
1120
- *
1121
- * @param kind
1122
- */
1123
-
1124
1003
 
1125
1004
  public void filter(int kind) {
1126
1005
  loadPixels();
@@ -1329,7 +1208,6 @@ public class PImage implements PConstants, Cloneable {
1329
1208
  * bigger speed gains for larger radii (~30%)
1330
1209
  * added support for various image types (ALPHA, RGB, ARGB)
1331
1210
  * [toxi 050728]
1332
- * @param r
1333
1211
  */
1334
1212
  protected void buildBlurKernel(float r) {
1335
1213
  int radius = (int) (r * 3.5f);
@@ -1357,11 +1235,8 @@ public class PImage implements PConstants, Cloneable {
1357
1235
  }
1358
1236
  }
1359
1237
 
1360
- /**
1361
- *
1362
- * @param r
1363
- */
1364
- protected void blurAlpha(float r) {
1238
+
1239
+ protected void blurAlpha(float r) {
1365
1240
  int sum, cb;
1366
1241
  int read, ri, ym, ymi, bk0;
1367
1242
  int b2[] = new int[pixels.length];
@@ -1431,11 +1306,8 @@ public class PImage implements PConstants, Cloneable {
1431
1306
  }
1432
1307
  }
1433
1308
 
1434
- /**
1435
- *
1436
- * @param r
1437
- */
1438
- protected void blurRGB(float r) {
1309
+
1310
+ protected void blurRGB(float r) {
1439
1311
  int sum, cr, cg, cb; //, k;
1440
1312
  int /*pixel,*/ read, ri, /*roff,*/ ym, ymi, /*riw,*/ bk0;
1441
1313
  int r2[] = new int[pixels.length];
@@ -1516,11 +1388,8 @@ public class PImage implements PConstants, Cloneable {
1516
1388
  }
1517
1389
  }
1518
1390
 
1519
- /**
1520
- *
1521
- * @param r
1522
- */
1523
- protected void blurARGB(float r) {
1391
+
1392
+ protected void blurARGB(float r) {
1524
1393
  int sum, cr, cg, cb, ca;
1525
1394
  int /*pixel,*/ read, ri, /*roff,*/ ym, ymi, /*riw,*/ bk0;
1526
1395
  int wh = pixels.length;
@@ -1679,10 +1548,8 @@ public class PImage implements PConstants, Cloneable {
1679
1548
  System.arraycopy(outgoing, 0, pixels, 0, maxIndex);
1680
1549
  }
1681
1550
 
1682
- /**
1683
- *
1684
- */
1685
- protected void erode() { // formerly dilate(true)
1551
+
1552
+ protected void erode() { // formerly dilate(true)
1686
1553
  int index = 0;
1687
1554
  int maxIndex = pixels.length;
1688
1555
  int[] outgoing = new int[maxIndex];
@@ -1792,14 +1659,6 @@ public class PImage implements PConstants, Cloneable {
1792
1659
 
1793
1660
  /**
1794
1661
  * @param src an image variable referring to the source image.
1795
- * @param sx
1796
- * @param sy
1797
- * @param dh
1798
- * @param sw
1799
- * @param dx
1800
- * @param sh
1801
- * @param dy
1802
- * @param dw
1803
1662
  */
1804
1663
  public void copy(PImage src,
1805
1664
  int sx, int sy, int sw, int sh,
@@ -1885,7 +1744,6 @@ public class PImage implements PConstants, Cloneable {
1885
1744
  * are preferrable, and the difference is insignificant for applications
1886
1745
  * built with Processing.</P>
1887
1746
  *
1888
- * @return
1889
1747
  * @webref color:creating_reading
1890
1748
  * @usage web_application
1891
1749
  * @param c1 the first color to blend
@@ -1921,19 +1779,8 @@ public class PImage implements PConstants, Cloneable {
1921
1779
  return 0;
1922
1780
  }
1923
1781
 
1924
- /**
1925
- *
1926
- * @param sx
1927
- * @param sy
1928
- * @param sw
1929
- * @param sh
1930
- * @param dx
1931
- * @param dy
1932
- * @param dw
1933
- * @param dh
1934
- * @param mode
1935
- */
1936
- public void blend(int sx, int sy, int sw, int sh,
1782
+
1783
+ public void blend(int sx, int sy, int sw, int sh,
1937
1784
  int dx, int dy, int dw, int dh, int mode) {
1938
1785
  blend(this, sx, sy, sw, sh, dx, dy, dw, dh, mode);
1939
1786
  }
@@ -3114,12 +2961,7 @@ int testFunction(int dst, int src) {
3114
2961
  static final String TIFF_ERROR =
3115
2962
  "Error: Processing can only read its own TIFF files.";
3116
2963
 
3117
- /**
3118
- *
3119
- * @param tiff
3120
- * @return
3121
- */
3122
- static protected PImage loadTIFF(byte tiff[]) {
2964
+ static protected PImage loadTIFF(byte tiff[]) {
3123
2965
  if ((tiff[42] != tiff[102]) || // width/height in both places
3124
2966
  (tiff[43] != tiff[103])) {
3125
2967
  System.err.println(TIFF_ERROR);
@@ -3166,12 +3008,8 @@ int testFunction(int dst, int src) {
3166
3008
  return outgoing;
3167
3009
  }
3168
3010
 
3169
- /**
3170
- *
3171
- * @param output
3172
- * @return
3173
- */
3174
- protected boolean saveTIFF(OutputStream output) {
3011
+
3012
+ protected boolean saveTIFF(OutputStream output) {
3175
3013
  // shutting off the warning, people can figure this out themselves
3176
3014
  /*
3177
3015
  if (format != RGB) {
@@ -3229,8 +3067,6 @@ int testFunction(int dst, int src) {
3229
3067
  * </p>
3230
3068
  * Contributed by toxi 8-10 May 2005, based on this RLE
3231
3069
  * <A HREF="http://www.wotsit.org/download.asp?f=tga">specification</A>
3232
- * @param output
3233
- * @return
3234
3070
  */
3235
3071
  protected boolean saveTGA(OutputStream output) {
3236
3072
  byte header[] = new byte[18];
@@ -3373,9 +3209,6 @@ int testFunction(int dst, int src) {
3373
3209
  * Various formats are supported, typically jpeg, png, bmp, and wbmp.
3374
3210
  * To get a list of the supported formats for writing, use: <BR>
3375
3211
  * <TT>println(javax.imageio.ImageIO.getReaderFormatNames())</TT>
3376
- * @param path
3377
- * @return
3378
- * @throws java.io.IOException
3379
3212
  */
3380
3213
  protected boolean saveImageIO(String path) throws IOException {
3381
3214
  try {
@@ -3489,10 +3322,8 @@ int testFunction(int dst, int src) {
3489
3322
  return null;
3490
3323
  }
3491
3324
 
3492
- /**
3493
- *
3494
- */
3495
- protected String[] saveImageFormats;
3325
+
3326
+ protected String[] saveImageFormats;
3496
3327
 
3497
3328
  /**
3498
3329
  * ( begin auto-generated from PImage_save.xml )
@@ -3535,7 +3366,6 @@ int testFunction(int dst, int src) {
3535
3366
  * require a black and white image. Basic testing produced a zero-length
3536
3367
  * file with no error.
3537
3368
  *
3538
- * @return
3539
3369
  * @webref pimage:method
3540
3370
  * @brief Saves the image to a TIFF, TARGA, PNG, or JPEG file
3541
3371
  * @usage application