p5 2.2.1-rc.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accessibility/color_namer.js +5 -6
- package/dist/accessibility/describe.js +4 -26
- package/dist/accessibility/index.js +5 -6
- package/dist/accessibility/outputs.js +6 -38
- package/dist/app.js +5 -6
- package/dist/color/color_conversion.js +5 -6
- package/dist/color/creating_reading.js +1 -1
- package/dist/color/index.js +2 -2
- package/dist/color/p5.Color.js +1 -1
- package/dist/color/setting.js +59 -357
- package/dist/{constants-DEJVKr9Z.js → constants-DQyACdzq.js} +11 -61
- package/dist/core/constants.js +1 -1
- package/dist/core/environment.js +26 -158
- package/dist/core/filterShaders.js +1 -1
- package/dist/core/friendly_errors/fes_core.js +1 -1
- package/dist/core/friendly_errors/file_errors.js +1 -1
- package/dist/core/friendly_errors/index.js +1 -1
- package/dist/core/friendly_errors/param_validator.js +1 -1
- package/dist/core/friendly_errors/sketch_verifier.js +1 -1
- package/dist/core/helpers.js +1 -1
- package/dist/core/init.js +5 -6
- package/dist/core/internationalization.js +1 -1
- package/dist/core/legacy.js +5 -6
- package/dist/core/main.js +5 -6
- package/dist/core/p5.Graphics.js +4 -5
- package/dist/core/p5.Renderer.js +3 -4
- package/dist/core/p5.Renderer2D.js +5 -6
- package/dist/core/p5.Renderer3D.js +4 -5
- package/dist/core/rendering.js +4 -5
- package/dist/core/structure.js +13 -52
- package/dist/core/transform.js +32 -176
- package/dist/{creating_reading-CgHCHxqN.js → creating_reading-ZXzcZEsb.js} +3 -196
- package/dist/data/local_storage.js +4 -30
- package/dist/dom/dom.js +24 -159
- package/dist/dom/index.js +2 -2
- package/dist/dom/p5.Element.js +31 -208
- package/dist/dom/p5.File.js +1 -32
- package/dist/dom/p5.MediaElement.js +10 -113
- package/dist/events/acceleration.js +11 -64
- package/dist/events/keyboard.js +13 -81
- package/dist/events/pointer.js +18 -160
- package/dist/image/const.js +1 -1
- package/dist/image/filterRenderer2D.js +4 -5
- package/dist/image/image.js +4 -5
- package/dist/image/index.js +4 -5
- package/dist/image/loading_displaying.js +4 -5
- package/dist/image/p5.Image.js +3 -4
- package/dist/image/pixels.js +17 -100
- package/dist/io/files.js +4 -5
- package/dist/io/index.js +4 -5
- package/dist/io/p5.Table.js +66 -158
- package/dist/io/p5.TableRow.js +48 -71
- package/dist/io/p5.XML.js +6 -99
- package/dist/io/utilities.js +8 -3
- package/dist/{main-_RXV5Lx8.js → main-DvN69W3f.js} +13 -42
- package/dist/math/Matrices/Matrix.js +87 -126
- package/dist/math/Matrices/MatrixNumjs.js +1 -5
- package/dist/math/calculation.js +10 -112
- package/dist/math/index.js +1 -1
- package/dist/math/math.js +2 -12
- package/dist/math/noise.js +5 -32
- package/dist/math/p5.Matrix.js +3 -3
- package/dist/math/p5.Vector.js +104 -345
- package/dist/math/random.js +5 -32
- package/dist/math/trigonometry.js +15 -105
- package/dist/{p5.Renderer-QoFcvj3f.js → p5.Renderer-D-5LdCRz.js} +25 -178
- package/dist/{rendering-CsICjEXA.js → rendering-h9unX5K0.js} +254 -1156
- package/dist/shape/2d_primitives.js +33 -194
- package/dist/shape/attributes.js +12 -73
- package/dist/shape/curves.js +30 -95
- package/dist/shape/custom_shapes.js +63 -144
- package/dist/shape/index.js +2 -2
- package/dist/shape/vertex.js +21 -106
- package/dist/strands/p5.strands.js +248 -46
- package/dist/type/index.js +3 -4
- package/dist/type/p5.Font.js +4 -49
- package/dist/type/textCore.js +5 -158
- package/dist/utilities/conversion.js +17 -104
- package/dist/utilities/time_date.js +3 -40
- package/dist/utilities/utility_functions.js +6 -48
- package/dist/webgl/3d_primitives.js +4 -5
- package/dist/webgl/GeometryBuilder.js +1 -2
- package/dist/webgl/ShapeBuilder.js +22 -2
- package/dist/webgl/enums.js +1 -1
- package/dist/webgl/index.js +4 -5
- package/dist/webgl/interaction.js +6 -33
- package/dist/webgl/light.js +4 -5
- package/dist/webgl/loading.js +12 -46
- package/dist/webgl/material.js +4 -5
- package/dist/webgl/p5.Camera.js +4 -5
- package/dist/webgl/p5.DataArray.js +0 -4
- package/dist/webgl/p5.Framebuffer.js +4 -5
- package/dist/webgl/p5.Geometry.js +12 -106
- package/dist/webgl/p5.Quat.js +1 -1
- package/dist/webgl/p5.RendererGL.js +7 -18
- package/dist/webgl/p5.Shader.js +12 -36
- package/dist/webgl/p5.Texture.js +4 -5
- package/dist/webgl/text.js +4 -5
- package/dist/webgl/utils.js +4 -5
- package/dist/webgpu/index.js +1 -1
- package/dist/webgpu/p5.RendererWebGPU.js +529 -208
- package/dist/webgpu/shaders/color.js +32 -17
- package/dist/webgpu/shaders/filters/base.js +18 -7
- package/dist/webgpu/shaders/font.js +52 -40
- package/dist/webgpu/shaders/line.js +50 -36
- package/dist/webgpu/shaders/material.js +90 -83
- package/dist/webgpu/strands_wgslBackend.js +5 -2
- package/lib/p5.esm.js +5576 -7811
- package/lib/p5.esm.min.js +1 -1
- package/lib/p5.js +5576 -7811
- package/lib/p5.min.js +1 -1
- package/lib/p5.webgpu.esm.js +786 -453
- package/lib/p5.webgpu.js +786 -453
- package/lib/p5.webgpu.min.js +1 -1
- package/package.json +13 -13
- package/types/global.d.ts +16905 -16783
- package/types/p5.d.ts +11142 -11081
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as Color } from './creating_reading-
|
|
2
|
-
import { a2 as NORMAL, aA as WORD, ax as BASELINE, av as LEFT, v as CENTER, p as CORNER, J as INCLUDE } from './constants-
|
|
1
|
+
import { C as Color } from './creating_reading-ZXzcZEsb.js';
|
|
2
|
+
import { a2 as NORMAL, aA as WORD, ax as BASELINE, av as LEFT, v as CENTER, p as CORNER, J as INCLUDE } from './constants-DQyACdzq.js';
|
|
3
3
|
import Filters from './image/filters.js';
|
|
4
4
|
import { Vector } from './math/p5.Vector.js';
|
|
5
5
|
import { Shape } from './shape/custom_shapes.js';
|
|
@@ -108,8 +108,6 @@ class Image {
|
|
|
108
108
|
* values.
|
|
109
109
|
*
|
|
110
110
|
* @example
|
|
111
|
-
* <div>
|
|
112
|
-
* <code>
|
|
113
111
|
* function setup() {
|
|
114
112
|
* createCanvas(100, 100);
|
|
115
113
|
*
|
|
@@ -136,11 +134,8 @@ class Image {
|
|
|
136
134
|
*
|
|
137
135
|
* describe('A black square drawn in the middle of a gray square.');
|
|
138
136
|
* }
|
|
139
|
-
* </code>
|
|
140
|
-
* </div>
|
|
141
137
|
*
|
|
142
|
-
*
|
|
143
|
-
* <code>
|
|
138
|
+
* @example
|
|
144
139
|
* function setup() {
|
|
145
140
|
* createCanvas(100, 100);
|
|
146
141
|
*
|
|
@@ -171,8 +166,6 @@ class Image {
|
|
|
171
166
|
*
|
|
172
167
|
* describe('A black square drawn in the middle of a gray square.');
|
|
173
168
|
* }
|
|
174
|
-
* </code>
|
|
175
|
-
* </div>
|
|
176
169
|
*/
|
|
177
170
|
loadPixels() {
|
|
178
171
|
// Renderer2D.prototype.loadPixels.call(this);
|
|
@@ -213,8 +206,6 @@ class Image {
|
|
|
213
206
|
* @param {Integer} [h] height of the subsection to update.
|
|
214
207
|
*
|
|
215
208
|
* @example
|
|
216
|
-
* <div>
|
|
217
|
-
* <code>
|
|
218
209
|
* function setup() {
|
|
219
210
|
* createCanvas(100, 100);
|
|
220
211
|
*
|
|
@@ -241,11 +232,8 @@ class Image {
|
|
|
241
232
|
*
|
|
242
233
|
* describe('A black square drawn in the middle of a gray square.');
|
|
243
234
|
* }
|
|
244
|
-
* </code>
|
|
245
|
-
* </div>
|
|
246
235
|
*
|
|
247
|
-
*
|
|
248
|
-
* <code>
|
|
236
|
+
* @example
|
|
249
237
|
* function setup() {
|
|
250
238
|
* createCanvas(100, 100);
|
|
251
239
|
*
|
|
@@ -277,8 +265,6 @@ class Image {
|
|
|
277
265
|
*
|
|
278
266
|
* describe('A black square drawn in the middle of a gray square.');
|
|
279
267
|
* }
|
|
280
|
-
* </code>
|
|
281
|
-
* </div>
|
|
282
268
|
*/
|
|
283
269
|
updatePixels(x, y, w, h) {
|
|
284
270
|
// Renderer2D.prototype.updatePixels.call(this, x, y, w, h);
|
|
@@ -339,8 +325,6 @@ class Image {
|
|
|
339
325
|
* @return {p5.Image} subsection as a <a href="#/p5.Image">p5.Image</a> object.
|
|
340
326
|
*
|
|
341
327
|
* @example
|
|
342
|
-
* <div>
|
|
343
|
-
* <code>
|
|
344
328
|
* let img;
|
|
345
329
|
*
|
|
346
330
|
* async function setup() {
|
|
@@ -362,11 +346,8 @@ class Image {
|
|
|
362
346
|
*
|
|
363
347
|
* describe('Two identical mountain landscapes shown side-by-side.');
|
|
364
348
|
* }
|
|
365
|
-
* </code>
|
|
366
|
-
* </div>
|
|
367
349
|
*
|
|
368
|
-
*
|
|
369
|
-
* <code>
|
|
350
|
+
* @example
|
|
370
351
|
* let img;
|
|
371
352
|
*
|
|
372
353
|
* async function setup() {
|
|
@@ -390,11 +371,8 @@ class Image {
|
|
|
390
371
|
*
|
|
391
372
|
* describe('A mountain landscape with an olive green square in its center.');
|
|
392
373
|
* }
|
|
393
|
-
* </code>
|
|
394
|
-
* </div>
|
|
395
374
|
*
|
|
396
|
-
*
|
|
397
|
-
* <code>
|
|
375
|
+
* @example
|
|
398
376
|
* let img;
|
|
399
377
|
*
|
|
400
378
|
* async function setup() {
|
|
@@ -414,8 +392,6 @@ class Image {
|
|
|
414
392
|
*
|
|
415
393
|
* describe('A mountain landscape drawn on top of another mountain landscape.');
|
|
416
394
|
* }
|
|
417
|
-
* </code>
|
|
418
|
-
* </div>
|
|
419
395
|
*/
|
|
420
396
|
/**
|
|
421
397
|
* @return {p5.Image} whole <a href="#/p5.Image">p5.Image</a>
|
|
@@ -496,8 +472,6 @@ class Image {
|
|
|
496
472
|
* <a href="#/p5.Image">p5.Image</a> to copy.
|
|
497
473
|
*
|
|
498
474
|
* @example
|
|
499
|
-
* <div>
|
|
500
|
-
* <code>
|
|
501
475
|
* function setup() {
|
|
502
476
|
* createCanvas(100, 100);
|
|
503
477
|
*
|
|
@@ -520,11 +494,8 @@ class Image {
|
|
|
520
494
|
*
|
|
521
495
|
* describe('Four black dots arranged in a square drawn on a gray background.');
|
|
522
496
|
* }
|
|
523
|
-
* </code>
|
|
524
|
-
* </div>
|
|
525
497
|
*
|
|
526
|
-
*
|
|
527
|
-
* <code>
|
|
498
|
+
* @example
|
|
528
499
|
* function setup() {
|
|
529
500
|
* createCanvas(100, 100);
|
|
530
501
|
*
|
|
@@ -550,11 +521,8 @@ class Image {
|
|
|
550
521
|
*
|
|
551
522
|
* describe('Four black dots arranged in a square drawn on a gray background.');
|
|
552
523
|
* }
|
|
553
|
-
* </code>
|
|
554
|
-
* </div>
|
|
555
524
|
*
|
|
556
|
-
*
|
|
557
|
-
* <code>
|
|
525
|
+
* @example
|
|
558
526
|
* function setup() {
|
|
559
527
|
* createCanvas(100, 100);
|
|
560
528
|
*
|
|
@@ -579,11 +547,8 @@ class Image {
|
|
|
579
547
|
*
|
|
580
548
|
* describe('A square with a horiztonal color gradient from black to white drawn on a gray background.');
|
|
581
549
|
* }
|
|
582
|
-
* </code>
|
|
583
|
-
* </div>
|
|
584
550
|
*
|
|
585
|
-
*
|
|
586
|
-
* <code>
|
|
551
|
+
* @example
|
|
587
552
|
* let img;
|
|
588
553
|
*
|
|
589
554
|
* async function setup() {
|
|
@@ -603,8 +568,6 @@ class Image {
|
|
|
603
568
|
*
|
|
604
569
|
* describe('An image of a mountain landscape.');
|
|
605
570
|
* }
|
|
606
|
-
* </code>
|
|
607
|
-
* </div>
|
|
608
571
|
*/
|
|
609
572
|
set(x, y, imgOrCol) {
|
|
610
573
|
// Renderer2D.prototype.set.call(this, x, y, imgOrCol);
|
|
@@ -692,8 +655,6 @@ class Image {
|
|
|
692
655
|
* @param {Number} height resized image height.
|
|
693
656
|
*
|
|
694
657
|
* @example
|
|
695
|
-
* <div>
|
|
696
|
-
* <code>
|
|
697
658
|
* let img;
|
|
698
659
|
*
|
|
699
660
|
* async function setup() {
|
|
@@ -713,11 +674,8 @@ class Image {
|
|
|
713
674
|
*
|
|
714
675
|
* describe('Two images of a mountain landscape. One copy of the image is squeezed horizontally.');
|
|
715
676
|
* }
|
|
716
|
-
* </code>
|
|
717
|
-
* </div>
|
|
718
677
|
*
|
|
719
|
-
*
|
|
720
|
-
* <code>
|
|
678
|
+
* @example
|
|
721
679
|
* let img;
|
|
722
680
|
*
|
|
723
681
|
* async function setup() {
|
|
@@ -737,11 +695,8 @@ class Image {
|
|
|
737
695
|
*
|
|
738
696
|
* describe('Two images of a mountain landscape. The small copy of the image covers the top-left corner of the larger image.');
|
|
739
697
|
* }
|
|
740
|
-
* </code>
|
|
741
|
-
* </div>
|
|
742
698
|
*
|
|
743
|
-
*
|
|
744
|
-
* <code>
|
|
699
|
+
* @example
|
|
745
700
|
* let img;
|
|
746
701
|
*
|
|
747
702
|
* async function setup() {
|
|
@@ -761,8 +716,6 @@ class Image {
|
|
|
761
716
|
*
|
|
762
717
|
* describe('Two images of a mountain landscape. The small copy of the image covers the top-left corner of the larger image.');
|
|
763
718
|
* }
|
|
764
|
-
* </code>
|
|
765
|
-
* </div>
|
|
766
719
|
*/
|
|
767
720
|
resize(width, height) {
|
|
768
721
|
// Copy contents to a temporary canvas, resize the original
|
|
@@ -873,8 +826,6 @@ class Image {
|
|
|
873
826
|
* @param {Integer} dh destination image height.
|
|
874
827
|
*
|
|
875
828
|
* @example
|
|
876
|
-
* <div>
|
|
877
|
-
* <code>
|
|
878
829
|
* let img;
|
|
879
830
|
*
|
|
880
831
|
* async function setup() {
|
|
@@ -896,11 +847,8 @@ class Image {
|
|
|
896
847
|
*
|
|
897
848
|
* describe('An image of a mountain landscape. A square region is outlined in white. A larger square contains a pixelated view of the outlined region.');
|
|
898
849
|
* }
|
|
899
|
-
* </code>
|
|
900
|
-
* </div>
|
|
901
850
|
*
|
|
902
|
-
*
|
|
903
|
-
* <code>
|
|
851
|
+
* @example
|
|
904
852
|
* let mountains;
|
|
905
853
|
* let bricks;
|
|
906
854
|
*
|
|
@@ -922,8 +870,6 @@ class Image {
|
|
|
922
870
|
*
|
|
923
871
|
* describe('An image of a brick wall drawn at the top-left of an image of a mountain landscape.');
|
|
924
872
|
* }
|
|
925
|
-
* </code>
|
|
926
|
-
* </div>
|
|
927
873
|
*/
|
|
928
874
|
/**
|
|
929
875
|
* @param {Integer} sx
|
|
@@ -1030,8 +976,6 @@ class Image {
|
|
|
1030
976
|
* @param {p5.Image} srcImage source image.
|
|
1031
977
|
*
|
|
1032
978
|
* @example
|
|
1033
|
-
* <div>
|
|
1034
|
-
* <code>
|
|
1035
979
|
* let photo;
|
|
1036
980
|
* let maskImage;
|
|
1037
981
|
*
|
|
@@ -1049,8 +993,6 @@ class Image {
|
|
|
1049
993
|
*
|
|
1050
994
|
* describe('An image of a mountain landscape. The right side of the image has a faded patch of white.');
|
|
1051
995
|
* }
|
|
1052
|
-
* </code>
|
|
1053
|
-
* </div>
|
|
1054
996
|
*/
|
|
1055
997
|
// TODO: - Accept an array of alpha values.
|
|
1056
998
|
mask(p5Image) {
|
|
@@ -1146,8 +1088,6 @@ class Image {
|
|
|
1146
1088
|
* @param {Number} [filterParam] parameter unique to each filter.
|
|
1147
1089
|
*
|
|
1148
1090
|
* @example
|
|
1149
|
-
* <div>
|
|
1150
|
-
* <code>
|
|
1151
1091
|
* let img;
|
|
1152
1092
|
*
|
|
1153
1093
|
* async function setup() {
|
|
@@ -1164,11 +1104,8 @@ class Image {
|
|
|
1164
1104
|
*
|
|
1165
1105
|
* describe('A blue brick wall.');
|
|
1166
1106
|
* }
|
|
1167
|
-
* </code>
|
|
1168
|
-
* </div>
|
|
1169
1107
|
*
|
|
1170
|
-
*
|
|
1171
|
-
* <code>
|
|
1108
|
+
* @example
|
|
1172
1109
|
* let img;
|
|
1173
1110
|
*
|
|
1174
1111
|
* async function setup() {
|
|
@@ -1185,11 +1122,8 @@ class Image {
|
|
|
1185
1122
|
*
|
|
1186
1123
|
* describe('A brick wall drawn in grayscale.');
|
|
1187
1124
|
* }
|
|
1188
|
-
* </code>
|
|
1189
|
-
* </div>
|
|
1190
1125
|
*
|
|
1191
|
-
*
|
|
1192
|
-
* <code>
|
|
1126
|
+
* @example
|
|
1193
1127
|
* let img;
|
|
1194
1128
|
*
|
|
1195
1129
|
* async function setup() {
|
|
@@ -1206,11 +1140,8 @@ class Image {
|
|
|
1206
1140
|
*
|
|
1207
1141
|
* describe('A brick wall drawn in black and white.');
|
|
1208
1142
|
* }
|
|
1209
|
-
* </code>
|
|
1210
|
-
* </div>
|
|
1211
1143
|
*
|
|
1212
|
-
*
|
|
1213
|
-
* <code>
|
|
1144
|
+
* @example
|
|
1214
1145
|
* let img;
|
|
1215
1146
|
*
|
|
1216
1147
|
* async function setup() {
|
|
@@ -1227,11 +1158,8 @@ class Image {
|
|
|
1227
1158
|
*
|
|
1228
1159
|
* describe('A red brick wall.');
|
|
1229
1160
|
* }
|
|
1230
|
-
* </code>
|
|
1231
|
-
* </div>
|
|
1232
1161
|
*
|
|
1233
|
-
*
|
|
1234
|
-
* <code>
|
|
1162
|
+
* @example
|
|
1235
1163
|
* let img;
|
|
1236
1164
|
*
|
|
1237
1165
|
* async function setup() {
|
|
@@ -1248,11 +1176,8 @@ class Image {
|
|
|
1248
1176
|
*
|
|
1249
1177
|
* describe('An image of a red brick wall drawn with a limited color palette.');
|
|
1250
1178
|
* }
|
|
1251
|
-
* </code>
|
|
1252
|
-
* </div>
|
|
1253
1179
|
*
|
|
1254
|
-
*
|
|
1255
|
-
* <code>
|
|
1180
|
+
* @example
|
|
1256
1181
|
* let img;
|
|
1257
1182
|
*
|
|
1258
1183
|
* async function setup() {
|
|
@@ -1269,11 +1194,8 @@ class Image {
|
|
|
1269
1194
|
*
|
|
1270
1195
|
* describe('A blurry image of a red brick wall.');
|
|
1271
1196
|
* }
|
|
1272
|
-
* </code>
|
|
1273
|
-
* </div>
|
|
1274
1197
|
*
|
|
1275
|
-
*
|
|
1276
|
-
* <code>
|
|
1198
|
+
* @example
|
|
1277
1199
|
* let img;
|
|
1278
1200
|
*
|
|
1279
1201
|
* async function setup() {
|
|
@@ -1290,11 +1212,8 @@ class Image {
|
|
|
1290
1212
|
*
|
|
1291
1213
|
* describe('A red brick wall with bright lines between each brick.');
|
|
1292
1214
|
* }
|
|
1293
|
-
* </code>
|
|
1294
|
-
* </div>
|
|
1295
1215
|
*
|
|
1296
|
-
*
|
|
1297
|
-
* <code>
|
|
1216
|
+
* @example
|
|
1298
1217
|
* let img;
|
|
1299
1218
|
*
|
|
1300
1219
|
* async function setup() {
|
|
@@ -1311,8 +1230,6 @@ class Image {
|
|
|
1311
1230
|
*
|
|
1312
1231
|
* describe('A red brick wall with faint lines between each brick.');
|
|
1313
1232
|
* }
|
|
1314
|
-
* </code>
|
|
1315
|
-
* </div>
|
|
1316
1233
|
*/
|
|
1317
1234
|
filter(operation, value) {
|
|
1318
1235
|
Filters.apply(this.canvas, Filters[operation], value);
|
|
@@ -1360,8 +1277,6 @@ class Image {
|
|
|
1360
1277
|
* http://blogs.adobe.com/webplatform/2013/01/28/blending-features-in-canvas/
|
|
1361
1278
|
*
|
|
1362
1279
|
* @example
|
|
1363
|
-
* <div>
|
|
1364
|
-
* <code>
|
|
1365
1280
|
* let mountains;
|
|
1366
1281
|
* let bricks;
|
|
1367
1282
|
*
|
|
@@ -1382,11 +1297,8 @@ class Image {
|
|
|
1382
1297
|
*
|
|
1383
1298
|
* describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears faded on the right of the image.');
|
|
1384
1299
|
* }
|
|
1385
|
-
* </code>
|
|
1386
|
-
* </div>
|
|
1387
1300
|
*
|
|
1388
|
-
*
|
|
1389
|
-
* <code>
|
|
1301
|
+
* @example
|
|
1390
1302
|
* let mountains;
|
|
1391
1303
|
* let bricks;
|
|
1392
1304
|
*
|
|
@@ -1408,11 +1320,8 @@ class Image {
|
|
|
1408
1320
|
*
|
|
1409
1321
|
* describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears transparent on the right of the image.');
|
|
1410
1322
|
* }
|
|
1411
|
-
* </code>
|
|
1412
|
-
* </div>
|
|
1413
1323
|
*
|
|
1414
|
-
*
|
|
1415
|
-
* <code>
|
|
1324
|
+
* @example
|
|
1416
1325
|
* let mountains;
|
|
1417
1326
|
* let bricks;
|
|
1418
1327
|
*
|
|
@@ -1434,8 +1343,6 @@ class Image {
|
|
|
1434
1343
|
*
|
|
1435
1344
|
* describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears washed out on the right of the image.');
|
|
1436
1345
|
* }
|
|
1437
|
-
* </code>
|
|
1438
|
-
* </div>
|
|
1439
1346
|
*/
|
|
1440
1347
|
/**
|
|
1441
1348
|
* @param {Integer} sx
|
|
@@ -1510,8 +1417,6 @@ class Image {
|
|
|
1510
1417
|
* Defaults to 'png'.
|
|
1511
1418
|
*
|
|
1512
1419
|
* @example
|
|
1513
|
-
* <div>
|
|
1514
|
-
* <code>
|
|
1515
1420
|
* let img;
|
|
1516
1421
|
*
|
|
1517
1422
|
* async function setup() {
|
|
@@ -1536,8 +1441,6 @@ class Image {
|
|
|
1536
1441
|
* img.save('rockies', 'png');
|
|
1537
1442
|
* }
|
|
1538
1443
|
* }
|
|
1539
|
-
* </code>
|
|
1540
|
-
* </div>
|
|
1541
1444
|
*/
|
|
1542
1445
|
save(filename, extension) {
|
|
1543
1446
|
if (this.gifProperties) {
|
|
@@ -1581,8 +1484,6 @@ class Image {
|
|
|
1581
1484
|
* Restarts an animated GIF at its first frame.
|
|
1582
1485
|
*
|
|
1583
1486
|
* @example
|
|
1584
|
-
* <div>
|
|
1585
|
-
* <code>
|
|
1586
1487
|
* let gif;
|
|
1587
1488
|
*
|
|
1588
1489
|
* async function setup() {
|
|
@@ -1605,8 +1506,6 @@ class Image {
|
|
|
1605
1506
|
* function mousePressed() {
|
|
1606
1507
|
* gif.reset();
|
|
1607
1508
|
* }
|
|
1608
|
-
* </code>
|
|
1609
|
-
* </div>
|
|
1610
1509
|
*/
|
|
1611
1510
|
reset() {
|
|
1612
1511
|
if (this.gifProperties) {
|
|
@@ -1627,8 +1526,6 @@ class Image {
|
|
|
1627
1526
|
* @return {Number} index of the GIF's current frame.
|
|
1628
1527
|
*
|
|
1629
1528
|
* @example
|
|
1630
|
-
* <div>
|
|
1631
|
-
* <code>
|
|
1632
1529
|
* let gif;
|
|
1633
1530
|
*
|
|
1634
1531
|
* async function setup() {
|
|
@@ -1650,8 +1547,6 @@ class Image {
|
|
|
1650
1547
|
* // Display the current frame.
|
|
1651
1548
|
* text(index, 10, 90);
|
|
1652
1549
|
* }
|
|
1653
|
-
* </code>
|
|
1654
|
-
* </div>
|
|
1655
1550
|
*/
|
|
1656
1551
|
getCurrentFrame() {
|
|
1657
1552
|
if (this.gifProperties) {
|
|
@@ -1666,8 +1561,6 @@ class Image {
|
|
|
1666
1561
|
* @param {Number} index index of the frame to display.
|
|
1667
1562
|
*
|
|
1668
1563
|
* @example
|
|
1669
|
-
* <div>
|
|
1670
|
-
* <code>
|
|
1671
1564
|
* let gif;
|
|
1672
1565
|
* let frameSlider;
|
|
1673
1566
|
*
|
|
@@ -1698,8 +1591,6 @@ class Image {
|
|
|
1698
1591
|
* // Display the image.
|
|
1699
1592
|
* image(gif, 0, 0);
|
|
1700
1593
|
* }
|
|
1701
|
-
* </code>
|
|
1702
|
-
* </div>
|
|
1703
1594
|
*/
|
|
1704
1595
|
setFrame(index) {
|
|
1705
1596
|
if (this.gifProperties) {
|
|
@@ -1723,8 +1614,6 @@ class Image {
|
|
|
1723
1614
|
* @return {Number} number of frames in the GIF.
|
|
1724
1615
|
*
|
|
1725
1616
|
* @example
|
|
1726
|
-
* <div>
|
|
1727
|
-
* <code>
|
|
1728
1617
|
* let gif;
|
|
1729
1618
|
*
|
|
1730
1619
|
* async function setup() {
|
|
@@ -1745,8 +1634,6 @@ class Image {
|
|
|
1745
1634
|
* let index = gif.getCurrentFrame();
|
|
1746
1635
|
* text(`${index} / ${total}`, 30, 90);
|
|
1747
1636
|
* }
|
|
1748
|
-
* </code>
|
|
1749
|
-
* </div>
|
|
1750
1637
|
*/
|
|
1751
1638
|
numFrames() {
|
|
1752
1639
|
if (this.gifProperties) {
|
|
@@ -1759,8 +1646,6 @@ class Image {
|
|
|
1759
1646
|
* <a href="#/p5.Image/pause">img.pause()</a>.
|
|
1760
1647
|
*
|
|
1761
1648
|
* @example
|
|
1762
|
-
* <div>
|
|
1763
|
-
* <code>
|
|
1764
1649
|
* let gif;
|
|
1765
1650
|
*
|
|
1766
1651
|
* async function setup() {
|
|
@@ -1786,8 +1671,6 @@ class Image {
|
|
|
1786
1671
|
* function mouseReleased() {
|
|
1787
1672
|
* gif.play();
|
|
1788
1673
|
* }
|
|
1789
|
-
* </code>
|
|
1790
|
-
* </div>
|
|
1791
1674
|
*/
|
|
1792
1675
|
play() {
|
|
1793
1676
|
if (this.gifProperties) {
|
|
@@ -1802,8 +1685,6 @@ class Image {
|
|
|
1802
1685
|
* <a href="#/p5.Image/play">img.play()</a>.
|
|
1803
1686
|
*
|
|
1804
1687
|
* @example
|
|
1805
|
-
* <div>
|
|
1806
|
-
* <code>
|
|
1807
1688
|
* let gif;
|
|
1808
1689
|
*
|
|
1809
1690
|
* async function setup() {
|
|
@@ -1831,8 +1712,6 @@ class Image {
|
|
|
1831
1712
|
* function mouseReleased() {
|
|
1832
1713
|
* gif.play();
|
|
1833
1714
|
* }
|
|
1834
|
-
* </code>
|
|
1835
|
-
* </div>
|
|
1836
1715
|
*/
|
|
1837
1716
|
pause() {
|
|
1838
1717
|
if (this.gifProperties) {
|
|
@@ -1853,8 +1732,6 @@ class Image {
|
|
|
1853
1732
|
* @param {Number} [index] index of the frame that will have its delay modified.
|
|
1854
1733
|
*
|
|
1855
1734
|
* @example
|
|
1856
|
-
* <div>
|
|
1857
|
-
* <code>
|
|
1858
1735
|
* let gifFast;
|
|
1859
1736
|
* let gifSlow;
|
|
1860
1737
|
*
|
|
@@ -1883,11 +1760,8 @@ class Image {
|
|
|
1883
1760
|
* image(gifFast, 0, 0);
|
|
1884
1761
|
* image(gifSlow, 50, 0);
|
|
1885
1762
|
* }
|
|
1886
|
-
* </code>
|
|
1887
|
-
* </div>
|
|
1888
1763
|
*
|
|
1889
|
-
*
|
|
1890
|
-
* <code>
|
|
1764
|
+
* @example
|
|
1891
1765
|
* let gif;
|
|
1892
1766
|
*
|
|
1893
1767
|
* async function setup() {
|
|
@@ -1906,8 +1780,6 @@ class Image {
|
|
|
1906
1780
|
* // Display the image.
|
|
1907
1781
|
* image(gif, 0, 0);
|
|
1908
1782
|
* }
|
|
1909
|
-
* </code>
|
|
1910
|
-
* </div>
|
|
1911
1783
|
*/
|
|
1912
1784
|
delay(d, index) {
|
|
1913
1785
|
if (this.gifProperties) {
|
|
@@ -2160,8 +2032,6 @@ function image(p5, fn){
|
|
|
2160
2032
|
* pixel values.
|
|
2161
2033
|
*
|
|
2162
2034
|
* @example
|
|
2163
|
-
* <div>
|
|
2164
|
-
* <code>
|
|
2165
2035
|
* let img;
|
|
2166
2036
|
*
|
|
2167
2037
|
* async function setup() {
|
|
@@ -2175,11 +2045,8 @@ function image(p5, fn){
|
|
|
2175
2045
|
*
|
|
2176
2046
|
* describe('An image of a brick wall.');
|
|
2177
2047
|
* }
|
|
2178
|
-
* </code>
|
|
2179
|
-
* </div>
|
|
2180
2048
|
*
|
|
2181
|
-
*
|
|
2182
|
-
* <code>
|
|
2049
|
+
* @example
|
|
2183
2050
|
* let img;
|
|
2184
2051
|
*
|
|
2185
2052
|
* async function setup() {
|
|
@@ -2196,11 +2063,8 @@ function image(p5, fn){
|
|
|
2196
2063
|
*
|
|
2197
2064
|
* describe('A grayscale image of a brick wall.');
|
|
2198
2065
|
* }
|
|
2199
|
-
* </code>
|
|
2200
|
-
* </div>
|
|
2201
2066
|
*
|
|
2202
|
-
*
|
|
2203
|
-
* <code>
|
|
2067
|
+
* @example
|
|
2204
2068
|
* function setup() {
|
|
2205
2069
|
* createCanvas(100, 100);
|
|
2206
2070
|
*
|
|
@@ -2227,8 +2091,6 @@ function image(p5, fn){
|
|
|
2227
2091
|
*
|
|
2228
2092
|
* describe('A black square drawn in the middle of a gray square.');
|
|
2229
2093
|
* }
|
|
2230
|
-
* </code>
|
|
2231
|
-
* </div>
|
|
2232
2094
|
*
|
|
2233
2095
|
* @class p5.Image
|
|
2234
2096
|
* @param {Number} width
|
|
@@ -2246,8 +2108,6 @@ function image(p5, fn){
|
|
|
2246
2108
|
* @readOnly
|
|
2247
2109
|
*
|
|
2248
2110
|
* @example
|
|
2249
|
-
* <div>
|
|
2250
|
-
* <code>
|
|
2251
2111
|
* let img;
|
|
2252
2112
|
*
|
|
2253
2113
|
* async function setup() {
|
|
@@ -2268,8 +2128,6 @@ function image(p5, fn){
|
|
|
2268
2128
|
*
|
|
2269
2129
|
* describe('An image of a mountain landscape with a white circle drawn in the middle.');
|
|
2270
2130
|
* }
|
|
2271
|
-
* </code>
|
|
2272
|
-
* </div>
|
|
2273
2131
|
*/
|
|
2274
2132
|
|
|
2275
2133
|
/**
|
|
@@ -2282,8 +2140,6 @@ function image(p5, fn){
|
|
|
2282
2140
|
* @readOnly
|
|
2283
2141
|
*
|
|
2284
2142
|
* @example
|
|
2285
|
-
* <div>
|
|
2286
|
-
* <code>
|
|
2287
2143
|
* let img;
|
|
2288
2144
|
*
|
|
2289
2145
|
* async function setup() {
|
|
@@ -2304,8 +2160,6 @@ function image(p5, fn){
|
|
|
2304
2160
|
*
|
|
2305
2161
|
* describe('An image of a mountain landscape with a white circle drawn in the middle.');
|
|
2306
2162
|
* }
|
|
2307
|
-
* </code>
|
|
2308
|
-
* </div>
|
|
2309
2163
|
*/
|
|
2310
2164
|
|
|
2311
2165
|
/**
|
|
@@ -2336,8 +2190,6 @@ function image(p5, fn){
|
|
|
2336
2190
|
* @name pixels
|
|
2337
2191
|
*
|
|
2338
2192
|
* @example
|
|
2339
|
-
* <div>
|
|
2340
|
-
* <code>
|
|
2341
2193
|
* function setup() {
|
|
2342
2194
|
* createCanvas(100, 100);
|
|
2343
2195
|
*
|
|
@@ -2368,11 +2220,8 @@ function image(p5, fn){
|
|
|
2368
2220
|
*
|
|
2369
2221
|
* describe('A black square drawn in the middle of a gray square.');
|
|
2370
2222
|
* }
|
|
2371
|
-
* </code>
|
|
2372
|
-
* </div>
|
|
2373
2223
|
*
|
|
2374
|
-
*
|
|
2375
|
-
* <code>
|
|
2224
|
+
* @example
|
|
2376
2225
|
* function setup() {
|
|
2377
2226
|
* createCanvas(100, 100);
|
|
2378
2227
|
*
|
|
@@ -2404,8 +2253,6 @@ function image(p5, fn){
|
|
|
2404
2253
|
*
|
|
2405
2254
|
* describe('A red square drawn in the middle of a gray square.');
|
|
2406
2255
|
* }
|
|
2407
|
-
* </code>
|
|
2408
|
-
* </div>
|
|
2409
2256
|
*/
|
|
2410
2257
|
}
|
|
2411
2258
|
|