-
Notifications
You must be signed in to change notification settings - Fork 0
/
CanvasRenderingContext2D.cljs
1253 lines (859 loc) · 40.4 KB
/
CanvasRenderingContext2D.cljs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(ns web.canvas.CanvasRenderingContext2D
"The CanvasRenderingContext2D interface, part of the Canvas API,
the 2D rendering context for the drawing surface of a `<canvas>`
It is used for drawing shapes, text, images, and other objects."
(:refer-clojure :exclude [filter]))
(defn add-hit-region
"Method.
The `web.canvas.CanvasRenderingContext2D` method addHitRegion()
a hit region to the bitmap.
`void ctx.addHitRegion(options);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/addHitRegion`"
[this options]
(-> this (.addHitRegion options)))
(defn arc
"Method.
The CanvasRenderingContext2D.arc() method of the Canvas 2D API
a circular arc to the current sub-path.
`void ctx.arc(x, y, radius, startAngle, endAngle [, anticlockwise]);
The arc() method creates a circular arc centered at (x, y) with a radius of radius. The path starts at startAngle and ends at endAngle, and travels in the direction given by anticlockwise (defaulting to clockwise).`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/arc`"
[this & args]
(-> this .-arc (.apply this (clj->js args))))
(defn arc-to
"Method.
The CanvasRenderingContext2D.arcTo() method of the Canvas 2D
adds a circular arc to the current sub-path, using the given
points and radius. The arc is automatically connected to the
latest point with a straight line, if necessary for the specified
`void ctx.arcTo(x1, y1, x2, y2, radius);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/arcTo`"
[this x1 y1 x2 y2 radius]
(-> this (.arcTo x1 y1 x2 y2 radius)))
(defn begin-path
"Method.
The CanvasRenderingContext2D.beginPath() method of the Canvas
API starts a new path by emptying the list of sub-paths. Call
method when you want to create a new path.
`void ctx.beginPath();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/beginPath`"
[this ]
(-> this (.beginPath)))
(defn bezier-curve-to
"Method.
The CanvasRenderingContext2D.bezierCurveTo() method of the Canvas
API adds a cubic Bézier curve to the current sub-path. It requires
points: the first two are control points and the third one is
end point. The starting point is the latest point in the current
which can be changed using `moveTo()` before creating the Bézier
`void ctx.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/bezierCurveTo`"
[this cp1x cp1y cp2x cp2y x y]
(-> this (.bezierCurveTo cp1x cp1y cp2x cp2y x y)))
(defn clear-hit-regions
"Method.
The `web.canvas.CanvasRenderingContext2D` method clearHitRegions()
all hit regions from the canvas.
`void ctx.clearHitRegions();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/clearHitRegions`"
[this ]
(-> this (.clearHitRegions)))
(defn clear-rect
"Method.
The CanvasRenderingContext2D.clearRect() method of the Canvas
API erases the pixels in a rectangular area by setting them to
black.
`void ctx.clearRect(x, y, width, height);
The clearRect() method sets the pixels in a rectangular area to transparent black (rgba(0,0,0,0)). The rectangle's corner is at (x, y), and its size is specified by width and height.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/clearRect`"
[this & args]
(-> this .-clearRect (.apply this (clj->js args))))
(defn clip
"Method.
The CanvasRenderingContext2D.clip() method of the Canvas 2D API
the current or given path into the current clipping region. It
any previous clipping region.
`void ctx.clip([fillRule]);
void ctx.clip(path [, fillRule]);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/clip`"
[this & args]
(-> this .-clip (.apply this (clj->js args))))
(defn close-path
"Method.
The CanvasRenderingContext2D.closePath() method of the Canvas
API attempts to add a straight line from the current point to
start of the current sub-path. If the shape has already been
or has only one point, this function does nothing.
`void ctx.closePath();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/closePath`"
[this ]
(-> this (.closePath)))
(defn create-image-data
"Method.
The CanvasRenderingContext2D.createImageData() method of the
2D API creates a new, blank `web.canvas.ImageData` object with
specified dimensions. All of the pixels in the new object are
black.
`ImageData ctx.createImageData(width, height);
ImageData ctx.createImageData(imagedata);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createImageData`"
[this & args]
(-> this .-createImageData (.apply this (clj->js args))))
(defn create-linear-gradient
"Method.
The CanvasRenderingContext2D.createLinearGradient() method of
Canvas 2D API creates a gradient along the line connecting two
coordinates.
`CanvasGradient ctx.createLinearGradient(x0, y0, x1, y1);
The createLinearGradient() method is specified by four parameters defining the start and end points of the gradient line.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createLinearGradient`"
[this & args]
(-> this .-createLinearGradient (.apply this (clj->js args))))
(defn create-pattern
"Method.
The CanvasRenderingContext2D.createPattern() method of the Canvas
API creates a pattern using the specified image and repetition.
method returns a `web.canvas.CanvasPattern`.
`CanvasPattern ctx.createPattern(image, repetition);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createPattern`"
[this image repetition]
(-> this (.createPattern image repetition)))
(defn create-radial-gradient
"Method.
The CanvasRenderingContext2D.createRadialGradient() method of
Canvas 2D API creates a radial gradient using the size and coordinates
two circles.
`CanvasGradient ctx.createRadialGradient(x0, y0, r0, x1, y1, r1);
The createRadialGradient() method is specified by six parameters, three defining the gradient's start circle, and three defining the end circle.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createRadialGradient`"
[this & args]
(-> this .-createRadialGradient (.apply this (clj->js args))))
(defn draw-focus-if-needed
"Method.
The CanvasRenderingContext2D.drawFocusIfNeeded() method of the
2D API draws a focus ring around the current or given path, if
specified element is focused.
`void ctx.drawFocusIfNeeded(element);
void ctx.drawFocusIfNeeded(path, element);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawFocusIfNeeded`"
[this & args]
(-> this .-drawFocusIfNeeded (.apply this (clj->js args))))
(defn draw-image
"Method.
The CanvasRenderingContext2D.drawImage() method of the Canvas
API provides different ways to draw an image onto the canvas.
`void ctx.drawImage(image, dx, dy);
void ctx.drawImage(image, dx, dy, dWidth, dHeight);
void ctx.drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage`"
[this & args]
(-> this .-drawImage (.apply this (clj->js args))))
(defn draw-widget-as-on-screen
"Method.
The non-standard and internal only CanvasRenderingContext2D.drawWidgetAsOnScreen()
of the Canvas 2D API renders the root widget of a window into
canvas. Unlike `drawWindow()`, this API uses the operating system
snapshot the widget on-screen, rather than reading from Gecko's
compositor.
`void ctx.drawWidgetAsOnScreen(window);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawWidgetAsOnScreen`"
[this window]
(-> this (.drawWidgetAsOnScreen window)))
(defn draw-window
"Method.
The non-standard and internal only CanvasRenderingContext2D.drawWindow()
of the Canvas 2D API renders a region of a window into the canvas.
contents of the window's viewport are rendered, ignoring viewport
and scrolling.
`void ctx.drawWindow(window, x, y, w, h, bgColor [, flags]);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawWindow`"
[this & args]
(-> this .-drawWindow (.apply this (clj->js args))))
(defn ellipse
"Method.
The CanvasRenderingContext2D.ellipse() method of the Canvas 2D
adds an elliptical arc to the current sub-path.
`void ctx.ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle [, anticlockwise]);
The ellipse() method creates an elliptical arc centered at (x, y) with the radii radiusX and radiusY. The path starts at startAngle and ends at endAngle, and travels in the direction given by anticlockwise (defaulting to clockwise).`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/ellipse`"
[this & args]
(-> this .-ellipse (.apply this (clj->js args))))
(defn fill
"Method.
The CanvasRenderingContext2D.fill() method of the Canvas 2D API
the current or given path with the current `fillStyle`.
`void ctx.fill([fillRule]);
void ctx.fill(path [, fillRule]);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fill`"
[this & args]
(-> this .-fill (.apply this (clj->js args))))
(defn fill-rect
"Method.
The CanvasRenderingContext2D.fillRect() method of the Canvas
API draws a rectangle that is filled according to the current
`void ctx.fillRect(x, y, width, height);
The fillRect() method draws a filled rectangle whose starting point is at (x, y) and whose size is specified by width and height. The fill style is determined by the current fillStyle attribute.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillRect`"
[this & args]
(-> this .-fillRect (.apply this (clj->js args))))
(defn fill-text
"Method.
The `web.canvas.CanvasRenderingContext2D` method fillText(),
of the Canvas 2D API, draws a text string at the specified coordinates,
the string's characters with the current `fillStyle`. An optional
allows specifying a maximum width for the rendered text, which
user agent will achieve by condensing the text or by using a
font size.
`CanvasRenderingContext2D.fillText(text, x, y [, maxWidth]);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillText`"
[this & args]
(-> this .-fillText (.apply this (clj->js args))))
(defn get-image-data
"Method.
The `web.canvas.CanvasRenderingContext2D` method getImageData()
the Canvas 2D API returns an `web.canvas.ImageData` object representing
underlying pixel data for a specified portion of the canvas.
`ctx.getImageData(sx, sy, sw, sh);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/getImageData`"
[this sx sy sw sh]
(-> this (.getImageData sx sy sw sh)))
(defn get-line-dash
"Method.
The getLineDash() method of the Canvas 2D API's `web.canvas.CanvasRenderingContext2D`
gets the current line dash pattern.
`ctx.getLineDash();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/getLineDash`"
[this ]
(-> this (.getLineDash)))
(defn is-point-in-path
"Method.
The CanvasRenderingContext2D.isPointInPath() method of the Canvas
API reports whether or not the specified point is contained in
current path.
`ctx.isPointInPath(x, y [, fillRule]);
ctx.isPointInPath(path, x, y [, fillRule]);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/isPointInPath`"
[this & args]
(-> this .-isPointInPath (.apply this (clj->js args))))
(defn is-point-in-stroke
"Method.
The CanvasRenderingContext2D.isPointInStroke() method of the
2D API reports whether or not the specified point is inside the
contained by the stroking of a path.
`ctx.isPointInStroke(x, y);
ctx.isPointInStroke(path, x, y);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/isPointInStroke`"
[this & args]
(-> this .-isPointInStroke (.apply this (clj->js args))))
(defn line-to
"Method.
The `web.canvas.CanvasRenderingContext2D` method lineTo(), part
the Canvas 2D API, adds a straight line to the current sub-path
connecting the sub-path's last point to the specified (x, y)
`ctx.lineTo(x, y);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineTo`"
[this x y]
(-> this (.lineTo x y)))
(defn measure-text
"Method.
The CanvasRenderingContext2D.measureText() method returns a `web.canvas.TextMetrics`
that contains information about the measured text (such as its
for example).
`ctx.measureText(text);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/measureText`"
[this text]
(-> this (.measureText text)))
(defn move-to
"Method.
The CanvasRenderingContext2D.moveTo() method of the Canvas 2D
begins a new sub-path at the point specified by the given (x,
coordinates.
`void ctx.moveTo(x, y);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/moveTo`"
[this x y]
(-> this (.moveTo x y)))
(defn put-image-data
"Method.
The CanvasRenderingContext2D.putImageData() method of the Canvas
API paints data from the given `web.canvas.ImageData` object
the canvas. If a dirty rectangle is provided, only the pixels
that rectangle are painted. This method is not affected by the
transformation matrix.
`void ctx.putImageData(imageData, dx, dy);
void ctx.putImageData(imageData, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/putImageData`"
[this & args]
(-> this .-putImageData (.apply this (clj->js args))))
(defn quadratic-curve-to
"Method.
The CanvasRenderingContext2D.quadraticCurveTo() method of the
2D API adds a quadratic Bézier curve to the current sub-path.
requires two points: the first one is a control point and the
one is the end point. The starting point is the latest point
the current path, which can be changed using `moveTo()` before
the quadratic Bézier curve.
`void ctx.quadraticCurveTo(cpx, cpy, x, y);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/quadraticCurveTo`"
[this cpx cpy x y]
(-> this (.quadraticCurveTo cpx cpy x y)))
(defn rect
"Method.
The CanvasRenderingContext2D.rect() method of the Canvas 2D API
a rectangle to the current path.
`void ctx.rect(x, y, width, height);
The rect() method creates a rectangular path whose starting point is at (x, y) and whose size is specified by width and height.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/rect`"
[this & args]
(-> this .-rect (.apply this (clj->js args))))
(defn remove-hit-region
"Method.
The `web.canvas.CanvasRenderingContext2D` method removeHitRegion()
a given hit region from the canvas.
`void ctx.removeHitRegion(id);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/removeHitRegion`"
[this id]
(-> this (.removeHitRegion id)))
(defn reset-transform
"Method.
The CanvasRenderingContext2D.resetTransform() method of the Canvas
API resets the current transform to the identity matrix.
`void ctx.resetTransform();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/resetTransform`"
[this ]
(-> this (.resetTransform)))
(defn restore
"Method.
The CanvasRenderingContext2D.restore() method of the Canvas 2D
restores the most recently saved canvas state by popping the
entry in the drawing state stack. If there is no saved state,
method does nothing.
`void ctx.restore();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/restore`"
[this ]
(-> this (.restore)))
(defn rotate
"Method.
The CanvasRenderingContext2D.rotate() method of the Canvas 2D
adds a rotation to the transformation matrix.
`void ctx.rotate(angle);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/rotate`"
[this angle]
(-> this (.rotate angle)))
(defn save
"Method.
The CanvasRenderingContext2D.save() method of the Canvas 2D API
the entire state of the canvas by pushing the current state onto
stack.
`void ctx.save();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/save`"
[this ]
(-> this (.save)))
(defn scale
"Method.
The CanvasRenderingContext2D.scale() method of the Canvas 2D
adds a scaling transformation to the canvas units horizontally
vertically.
`void ctx.scale(x, y);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/scale`"
[this x y]
(-> this (.scale x y)))
(defn scroll-path-into-view
"Method.
The CanvasRenderingContext2D.scrollPathIntoView() method of the
2D API scrolls the current or given path into view. It is similar
`Element.scrollIntoView()`.
`void ctx.scrollPathIntoView();
void ctx.scrollPathIntoView(path);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/scrollPathIntoView`"
[this & args]
(-> this .-scrollPathIntoView (.apply this (clj->js args))))
(defn set-line-dash
"Method.
The setLineDash() method of the Canvas 2D API's `web.canvas.CanvasRenderingContext2D`
sets the line dash pattern used when stroking lines. It uses
array of values that specify alternating lengths of lines and
which describe the pattern.
`ctx.setLineDash(segments);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash`"
[this segments]
(-> this (.setLineDash segments)))
(defn set-transform
"Method.
The CanvasRenderingContext2D.setTransform() method of the Canvas
API resets (overrides) the current transformation to the identity
and then invokes a transformation described by the arguments
this method. This lets you scale, rotate, translate (move), and
the context.
`void ctx.setTransform(a, b, c, d, e, f);
The transformation matrix is described by: [acebdf001]\\\\left[ \\\\begin{array}{ccc} a & c & e \\\\\\\\ b & d & f \\\\\\\\ 0 & 0 & 1 \\\\end{array} \\\\right]`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setTransform`"
[this & args]
(-> this .-setTransform (.apply this (clj->js args))))
(defn stroke
"Method.
The CanvasRenderingContext2D.stroke() method of the Canvas 2D
strokes (outlines) the current or given path with the current
style.
`void ctx.stroke();
void ctx.stroke(path);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/stroke`"
[this & args]
(-> this .-stroke (.apply this (clj->js args))))
(defn stroke-rect
"Method.
The CanvasRenderingContext2D.strokeRect() method of the Canvas
API draws a rectangle that is stroked (outlined) according to
current `strokeStyle` and other context settings.
`void ctx.strokeRect(x, y, width, height);
The strokeRect() method draws a stroked rectangle whose starting point is at (x, y) and whose size is specified by width and height.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/strokeRect`"
[this & args]
(-> this .-strokeRect (.apply this (clj->js args))))
(defn stroke-text
"Method.
The `web.canvas.CanvasRenderingContext2D` method strokeText(),
of the Canvas 2D API, strokes — that is, draws the outlines of
the characters of a text string at the specified coordinates.
optional parameter allows specifying a maximum width for the
text, which the user agent will achieve by condensing the text
by using a lower font size.
`CanvasRenderingContext2D.strokeText(text, x, y [, maxWidth]);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/strokeText`"
[this & args]
(-> this .-strokeText (.apply this (clj->js args))))
(defn transform
"Method.
The CanvasRenderingContext2D.transform() method of the Canvas
API multiplies the current transformation with the matrix described
the arguments of this method. This lets you scale, rotate, translate
and skew the context.
`void ctx.transform(a, b, c, d, e, f);
The transformation matrix is described by: [acebdf001]\\\\left[ \\\\begin{array}{ccc} a & c & e \\\\\\\\ b & d & f \\\\\\\\ 0 & 0 & 1 \\\\end{array} \\\\right]`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/transform`"
[this & args]
(-> this .-transform (.apply this (clj->js args))))
(defn translate
"Method.
The CanvasRenderingContext2D.translate() method of the Canvas
API adds a translation transformation to the current matrix.
`void ctx.translate(x, y);
The translate() method adds a translation transformation to the current matrix by moving the canvas and its origin x units horizontally and y units vertically on the grid.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/translate`"
[this & args]
(-> this .-translate (.apply this (clj->js args))))
(defn canvas
"Property.
The CanvasRenderingContext2D.canvas property, part of the Canvas
is a read-only reference to the `web.canvas.HTMLCanvasElement`
that is associated with a given context. It might be `js.null`
there is no associated `<canvas>` element.
`ctx.canvas;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/canvas`"
[this]
(-> this (.-canvas)))
(defn set-canvas!
"Property.
The CanvasRenderingContext2D.canvas property, part of the Canvas
is a read-only reference to the `web.canvas.HTMLCanvasElement`
that is associated with a given context. It might be `js.null`
there is no associated `<canvas>` element.
`ctx.canvas;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/canvas`"
[this val]
(aset this "canvas" val))
(defn current-transform
"Property.
The CanvasRenderingContext2D.currentTransform property of the
2D API returns or sets a `web.dom.DOMMatrix` (current specification)
`web.deprecated.SVGMatrix` (old specification) object for the
transformation matrix.
`ctx.currentTransform [= value];
value
A `web.dom.DOMMatrix` or `web.deprecated.SVGMatrix` object to use as the current transformation matrix.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/currentTransform`"
[this]
(-> this (.-currentTransform)))
(defn set-current-transform!
"Property.
The CanvasRenderingContext2D.currentTransform property of the
2D API returns or sets a `web.dom.DOMMatrix` (current specification)
`web.deprecated.SVGMatrix` (old specification) object for the
transformation matrix.
`ctx.currentTransform [= value];
value
A `web.dom.DOMMatrix` or `web.deprecated.SVGMatrix` object to use as the current transformation matrix.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/currentTransform`"
[this val]
(aset this "currentTransform" val))
(defn direction
"Property.
The CanvasRenderingContext2D.direction property of the Canvas
API specifies the current text direction used to draw text.
`ctx.direction = \\\"ltr\\\" || \\\"rtl\\\" || \\\"inherit\\\";`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/direction`"
[this]
(-> this (.-direction)))
(defn set-direction!
"Property.
The CanvasRenderingContext2D.direction property of the Canvas
API specifies the current text direction used to draw text.
`ctx.direction = \\\"ltr\\\" || \\\"rtl\\\" || \\\"inherit\\\";`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/direction`"
[this val]
(aset this "direction" val))
(defn fill-style
"Property.
The CanvasRenderingContext2D.fillStyle property of the Canvas
API specifies the color, gradient, or pattern to use inside shapes.
default style is #000 (black).
`ctx.fillStyle = color;
ctx.fillStyle = gradient;
ctx.fillStyle = pattern;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle`"
[this]
(-> this (.-fillStyle)))
(defn set-fill-style!
"Property.
The CanvasRenderingContext2D.fillStyle property of the Canvas
API specifies the color, gradient, or pattern to use inside shapes.
default style is #000 (black).
`ctx.fillStyle = color;
ctx.fillStyle = gradient;
ctx.fillStyle = pattern;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle`"
[this val]
(aset this "fillStyle" val))
(defn filter
"Property.
The CanvasRenderingContext2D.filter property of the Canvas 2D
provides filter effects such as blurring and grayscaling. It
similar to the CSS `filter` property and accepts the same values.
`ctx.filter = \\\"<filter-function1> [<filter-function2>] [<filter-functionN>]\\\";
ctx.filter = \\\"none\\\";`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/filter`"
[this]
(-> this (.-filter)))
(defn set-filter!
"Property.
The CanvasRenderingContext2D.filter property of the Canvas 2D
provides filter effects such as blurring and grayscaling. It
similar to the CSS `filter` property and accepts the same values.
`ctx.filter = \\\"<filter-function1> [<filter-function2>] [<filter-functionN>]\\\";
ctx.filter = \\\"none\\\";`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/filter`"
[this val]
(aset this "filter" val))
(defn font
"Property.
The CanvasRenderingContext2D.font property of the Canvas 2D API
the current text style to use when drawing text. This string
the same syntax as the CSS font specifier.
`ctx.font = value;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/font`"
[this]
(-> this (.-font)))
(defn set-font!
"Property.
The CanvasRenderingContext2D.font property of the Canvas 2D API
the current text style to use when drawing text. This string
the same syntax as the CSS font specifier.
`ctx.font = value;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/font`"
[this val]
(aset this "font" val))
(defn global-alpha
"Property.
The CanvasRenderingContext2D.globalAlpha property of the Canvas
API specifies the alpha (transparency) value that is applied
shapes and images before they are drawn onto the canvas.
`ctx.globalAlpha = value;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalAlpha`"
[this]
(-> this (.-globalAlpha)))
(defn set-global-alpha!
"Property.
The CanvasRenderingContext2D.globalAlpha property of the Canvas
API specifies the alpha (transparency) value that is applied
shapes and images before they are drawn onto the canvas.
`ctx.globalAlpha = value;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalAlpha`"
[this val]
(aset this "globalAlpha" val))
(defn global-composite-operation
"Property.
The CanvasRenderingContext2D.globalCompositeOperation property
the Canvas 2D API sets the type of compositing operation to apply
drawing new shapes.
`ctx.globalCompositeOperation = type;
type is a `js.String` identifying which of the compositing or blending mode operations to use.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation`"
[this]
(-> this (.-globalCompositeOperation)))
(defn set-global-composite-operation!
"Property.
The CanvasRenderingContext2D.globalCompositeOperation property
the Canvas 2D API sets the type of compositing operation to apply
drawing new shapes.
`ctx.globalCompositeOperation = type;
type is a `js.String` identifying which of the compositing or blending mode operations to use.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation`"
[this val]
(aset this "globalCompositeOperation" val))
(defn image-smoothing-enabled
"Property.
The imageSmoothingEnabled property of the `web.canvas.CanvasRenderingContext2D`
part of the Canvas API, determines whether scaled images are
(true, default) or not (false). On getting the imageSmoothingEnabled
the last value it was set to is returned.
`ctx.imageSmoothingEnabled = value;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/imageSmoothingEnabled`"
[this]
(-> this (.-imageSmoothingEnabled)))
(defn set-image-smoothing-enabled!
"Property.
The imageSmoothingEnabled property of the `web.canvas.CanvasRenderingContext2D`
part of the Canvas API, determines whether scaled images are
(true, default) or not (false). On getting the imageSmoothingEnabled
the last value it was set to is returned.
`ctx.imageSmoothingEnabled = value;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/imageSmoothingEnabled`"
[this val]
(aset this "imageSmoothingEnabled" val))
(defn image-smoothing-quality
"Property.
The imageSmoothingQuality property of the `web.canvas.CanvasRenderingContext2D`
part of the Canvas API, lets you set the quality of image smoothing.
`ctx.imageSmoothingQuality = \\\"low\\\" || \\\"medium\\\" || \\\"high\\\"`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/imageSmoothingQuality`"
[this]
(-> this (.-imageSmoothingQuality)))
(defn set-image-smoothing-quality!
"Property.
The imageSmoothingQuality property of the `web.canvas.CanvasRenderingContext2D`
part of the Canvas API, lets you set the quality of image smoothing.
`ctx.imageSmoothingQuality = \\\"low\\\" || \\\"medium\\\" || \\\"high\\\"`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/imageSmoothingQuality`"
[this val]
(aset this "imageSmoothingQuality" val))
(defn line-cap
"Property.
The CanvasRenderingContext2D.lineCap property of the Canvas 2D
determines the shape used to draw the end points of lines.
`ctx.lineCap = \\\"butt\\\" || \\\"round\\\" || \\\"square\\\";`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineCap`"
[this]
(-> this (.-lineCap)))
(defn set-line-cap!
"Property.
The CanvasRenderingContext2D.lineCap property of the Canvas 2D
determines the shape used to draw the end points of lines.
`ctx.lineCap = \\\"butt\\\" || \\\"round\\\" || \\\"square\\\";`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineCap`"
[this val]
(aset this "lineCap" val))
(defn line-dash-offset
"Property.
The CanvasRenderingContext2D.lineDashOffset property of the Canvas
API sets the line dash offset, or \\\"phase.\\\"
`ctx.lineDashOffset = value;
value
A float specifying the amount of the line dash offset. The default value is 0.0.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset`"
[this]
(-> this (.-lineDashOffset)))
(defn set-line-dash-offset!
"Property.
The CanvasRenderingContext2D.lineDashOffset property of the Canvas
API sets the line dash offset, or \\\"phase.\\\"
`ctx.lineDashOffset = value;
value
A float specifying the amount of the line dash offset. The default value is 0.0.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset`"
[this val]
(aset this "lineDashOffset" val))
(defn line-join
"Property.
The CanvasRenderingContext2D.lineJoin property of the Canvas
API determines the shape used to join two line segments where
meet.
`ctx.lineJoin = \\\"bevel\\\" || \\\"round\\\" || \\\"miter\\\";`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin`"
[this]
(-> this (.-lineJoin)))
(defn set-line-join!
"Property.
The CanvasRenderingContext2D.lineJoin property of the Canvas
API determines the shape used to join two line segments where
meet.
`ctx.lineJoin = \\\"bevel\\\" || \\\"round\\\" || \\\"miter\\\";`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin`"
[this val]
(aset this "lineJoin" val))
(defn line-width
"Property.