-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathluamagick.c
8544 lines (7999 loc) · 255 KB
/
luamagick.c
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
#include <lauxlib.h>
#include <lua.h>
#include <wand/MagickWand.h>
static const char drawing_wand_meta_name[] = "luamagick drawing wand";
static int drawing_error(lua_State *L, DrawingWand *wand) {
ExceptionType severity;
char *error = DrawGetException(wand, &severity);
lua_pushnil(L);
lua_pushstring(L, error);
MagickRelinquishMemory(error);
return 2;
}
static DrawingWand *check_drawing_wand(lua_State *L, int k) {
void *ud = luaL_checkudata(L, k, drawing_wand_meta_name);
luaL_argcheck(L, ud != NULL, k, "drawing wand expected");
return *(DrawingWand **)ud;
}
static int wrap_drawing_wand(lua_State *L, DrawingWand *wand) {
DrawingWand **p = lua_newuserdata(L, sizeof(*p));
luaL_getmetatable(L, drawing_wand_meta_name);
lua_setmetatable(L, -2);
*p = wand;
return 1;
}
static int new_drawing_wand(lua_State *L) {
return wrap_drawing_wand(L, NewDrawingWand());
}
static const char magick_wand_meta_name[] = "luamagick magick wand";
static int magick_error(lua_State *L, MagickWand *wand) {
ExceptionType severity;
char *error = MagickGetException(wand, &severity);
lua_pushnil(L);
lua_pushstring(L, error);
MagickRelinquishMemory(error);
return 2;
}
static MagickWand *check_magick_wand(lua_State *L, int k) {
void *ud = luaL_checkudata(L, k, magick_wand_meta_name);
luaL_argcheck(L, ud != NULL, k, "magick wand expected");
return *(MagickWand **)ud;
}
static int wrap_magick_wand(lua_State *L, MagickWand *wand) {
MagickWand **p = lua_newuserdata(L, sizeof(*p));
luaL_getmetatable(L, magick_wand_meta_name);
lua_setmetatable(L, -2);
*p = wand;
return 1;
}
static int new_magick_wand(lua_State *L) {
return wrap_magick_wand(L, NewMagickWand());
}
static const char pixel_wand_meta_name[] = "luamagick pixel wand";
static int pixel_error(lua_State *L, PixelWand *wand) {
ExceptionType severity;
char *error = PixelGetException(wand, &severity);
lua_pushnil(L);
lua_pushstring(L, error);
MagickRelinquishMemory(error);
return 2;
}
static PixelWand *check_pixel_wand(lua_State *L, int k) {
void *ud = luaL_checkudata(L, k, pixel_wand_meta_name);
luaL_argcheck(L, ud != NULL, k, "pixel wand expected");
return *(PixelWand **)ud;
}
static int wrap_pixel_wand(lua_State *L, PixelWand *wand) {
PixelWand **p = lua_newuserdata(L, sizeof(*p));
luaL_getmetatable(L, pixel_wand_meta_name);
lua_setmetatable(L, -2);
*p = wand;
return 1;
}
static int new_pixel_wand(lua_State *L) {
return wrap_pixel_wand(L, NewPixelWand());
}
static int drawing_annotation(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
double arg3 = luaL_checknumber(L, 3);
const char *arg4 = luaL_checkstring(L, 4);
DrawAnnotation(arg1, arg2, arg3, arg4);
return 0;
}
static int drawing_arc(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
double arg3 = luaL_checknumber(L, 3);
double arg4 = luaL_checknumber(L, 4);
double arg5 = luaL_checknumber(L, 5);
double arg6 = luaL_checknumber(L, 6);
double arg7 = luaL_checknumber(L, 7);
DrawArc(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
return 0;
}
static int drawing_circle(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
double arg3 = luaL_checknumber(L, 3);
double arg4 = luaL_checknumber(L, 4);
double arg5 = luaL_checknumber(L, 5);
DrawCircle(arg1, arg2, arg3, arg4, arg5);
return 0;
}
static int drawing_clear(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
ClearDrawingWand(arg1);
return 0;
}
static int drawing_clear_exception(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
if (DrawClearException(arg1) != MagickTrue) {
return drawing_error(L, arg1);
}
lua_pushboolean(L, 1);
return 1;
}
static int drawing_clone(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
return wrap_drawing_wand(L, CloneDrawingWand(arg1));
}
static int drawing_color(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
double arg3 = luaL_checknumber(L, 3);
PaintMethod arg4 = luaL_checknumber(L, 4);
DrawColor(arg1, arg2, arg3, arg4);
return 0;
}
static int drawing_comment(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
const char *arg2 = luaL_checkstring(L, 2);
DrawComment(arg1, arg2);
return 0;
}
static int drawing_composite(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
CompositeOperator arg2 = luaL_checknumber(L, 2);
double arg3 = luaL_checknumber(L, 3);
double arg4 = luaL_checknumber(L, 4);
double arg5 = luaL_checknumber(L, 5);
double arg6 = luaL_checknumber(L, 6);
MagickWand *arg7 = check_magick_wand(L, 7);
if (DrawComposite(arg1, arg2, arg3, arg4, arg5, arg6, arg7) != MagickTrue) {
return drawing_error(L, arg1);
}
lua_pushboolean(L, 1);
return 1;
}
static int drawing_ellipse(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
double arg3 = luaL_checknumber(L, 3);
double arg4 = luaL_checknumber(L, 4);
double arg5 = luaL_checknumber(L, 5);
double arg6 = luaL_checknumber(L, 6);
double arg7 = luaL_checknumber(L, 7);
DrawEllipse(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
return 0;
}
static int drawing_get_border_color(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
PixelWand *arg2 = check_pixel_wand(L, 2);
DrawGetBorderColor(arg1, arg2);
return 0;
}
static int drawing_get_clip_path(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
char *value = DrawGetClipPath(arg1);
lua_pushstring(L, value);
MagickRelinquishMemory(value);
return 1;
}
static int drawing_get_clip_rule(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
lua_pushnumber(L, DrawGetClipRule(arg1));
return 1;
}
static int drawing_get_clip_units(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
lua_pushnumber(L, DrawGetClipUnits(arg1));
return 1;
}
static int drawing_get_density(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
char *value = DrawGetDensity(arg1);
lua_pushstring(L, value);
MagickRelinquishMemory(value);
return 1;
}
static int drawing_get_exception_type(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
lua_pushnumber(L, DrawGetExceptionType(arg1));
return 1;
}
static int drawing_get_fill_alpha(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
lua_pushnumber(L, DrawGetFillAlpha(arg1));
return 1;
}
static int drawing_get_fill_color(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
PixelWand *arg2 = check_pixel_wand(L, 2);
DrawGetFillColor(arg1, arg2);
return 0;
}
static int drawing_get_fill_opacity(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
lua_pushnumber(L, DrawGetFillOpacity(arg1));
return 1;
}
static int drawing_get_fill_rule(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
lua_pushnumber(L, DrawGetFillRule(arg1));
return 1;
}
static int drawing_get_font(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
char *value = DrawGetFont(arg1);
lua_pushstring(L, value);
MagickRelinquishMemory(value);
return 1;
}
static int drawing_get_font_family(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
char *value = DrawGetFontFamily(arg1);
lua_pushstring(L, value);
MagickRelinquishMemory(value);
return 1;
}
static int drawing_get_font_size(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
lua_pushnumber(L, DrawGetFontSize(arg1));
return 1;
}
static int drawing_get_font_stretch(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
lua_pushnumber(L, DrawGetFontStretch(arg1));
return 1;
}
static int drawing_get_font_style(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
lua_pushnumber(L, DrawGetFontStyle(arg1));
return 1;
}
static int drawing_get_font_weight(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
lua_pushnumber(L, DrawGetFontWeight(arg1));
return 1;
}
static int drawing_get_gravity(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
lua_pushnumber(L, DrawGetGravity(arg1));
return 1;
}
static int drawing_get_opacity(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
lua_pushnumber(L, DrawGetOpacity(arg1));
return 1;
}
static int drawing_get_stroke_alpha(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
lua_pushnumber(L, DrawGetStrokeAlpha(arg1));
return 1;
}
static int drawing_get_stroke_antialias(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
if (DrawGetStrokeAntialias(arg1) != MagickTrue) {
return drawing_error(L, arg1);
}
lua_pushboolean(L, 1);
return 1;
}
static int drawing_get_stroke_color(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
PixelWand *arg2 = check_pixel_wand(L, 2);
DrawGetStrokeColor(arg1, arg2);
return 0;
}
static int drawing_get_stroke_dash_offset(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
lua_pushnumber(L, DrawGetStrokeDashOffset(arg1));
return 1;
}
static int drawing_get_stroke_line_cap(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
lua_pushnumber(L, DrawGetStrokeLineCap(arg1));
return 1;
}
static int drawing_get_stroke_line_join(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
lua_pushnumber(L, DrawGetStrokeLineJoin(arg1));
return 1;
}
static int drawing_get_stroke_miter_limit(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
lua_pushnumber(L, DrawGetStrokeMiterLimit(arg1));
return 1;
}
static int drawing_get_stroke_opacity(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
lua_pushnumber(L, DrawGetStrokeOpacity(arg1));
return 1;
}
static int drawing_get_stroke_width(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
lua_pushnumber(L, DrawGetStrokeWidth(arg1));
return 1;
}
static int drawing_get_text_alignment(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
lua_pushnumber(L, DrawGetTextAlignment(arg1));
return 1;
}
static int drawing_get_text_antialias(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
if (DrawGetTextAntialias(arg1) != MagickTrue) {
return drawing_error(L, arg1);
}
lua_pushboolean(L, 1);
return 1;
}
static int drawing_get_text_decoration(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
lua_pushnumber(L, DrawGetTextDecoration(arg1));
return 1;
}
static int drawing_get_text_direction(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
lua_pushnumber(L, DrawGetTextDirection(arg1));
return 1;
}
static int drawing_get_text_encoding(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
char *value = DrawGetTextEncoding(arg1);
lua_pushstring(L, value);
MagickRelinquishMemory(value);
return 1;
}
static int drawing_get_text_interline_spacing(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
lua_pushnumber(L, DrawGetTextInterlineSpacing(arg1));
return 1;
}
static int drawing_get_text_interword_spacing(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
lua_pushnumber(L, DrawGetTextInterwordSpacing(arg1));
return 1;
}
static int drawing_get_text_kerning(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
lua_pushnumber(L, DrawGetTextKerning(arg1));
return 1;
}
static int drawing_get_text_under_color(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
PixelWand *arg2 = check_pixel_wand(L, 2);
DrawGetTextUnderColor(arg1, arg2);
return 0;
}
static int drawing_get_vector_graphics(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
char *value = DrawGetVectorGraphics(arg1);
lua_pushstring(L, value);
MagickRelinquishMemory(value);
return 1;
}
static int drawing_line(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
double arg3 = luaL_checknumber(L, 3);
double arg4 = luaL_checknumber(L, 4);
double arg5 = luaL_checknumber(L, 5);
DrawLine(arg1, arg2, arg3, arg4, arg5);
return 0;
}
static int drawing_matte(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
double arg3 = luaL_checknumber(L, 3);
PaintMethod arg4 = luaL_checknumber(L, 4);
DrawMatte(arg1, arg2, arg3, arg4);
return 0;
}
static int drawing_path_close(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
DrawPathClose(arg1);
return 0;
}
static int drawing_path_curve_to_absolute(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
double arg3 = luaL_checknumber(L, 3);
double arg4 = luaL_checknumber(L, 4);
double arg5 = luaL_checknumber(L, 5);
double arg6 = luaL_checknumber(L, 6);
double arg7 = luaL_checknumber(L, 7);
DrawPathCurveToAbsolute(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
return 0;
}
static int drawing_path_curve_to_quadratic_bezier_absolute(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
double arg3 = luaL_checknumber(L, 3);
double arg4 = luaL_checknumber(L, 4);
double arg5 = luaL_checknumber(L, 5);
DrawPathCurveToQuadraticBezierAbsolute(arg1, arg2, arg3, arg4, arg5);
return 0;
}
static int drawing_path_curve_to_quadratic_bezier_relative(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
double arg3 = luaL_checknumber(L, 3);
double arg4 = luaL_checknumber(L, 4);
double arg5 = luaL_checknumber(L, 5);
DrawPathCurveToQuadraticBezierRelative(arg1, arg2, arg3, arg4, arg5);
return 0;
}
static int drawing_path_curve_to_quadratic_bezier_smooth_absolute(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
double arg3 = luaL_checknumber(L, 3);
DrawPathCurveToQuadraticBezierSmoothAbsolute(arg1, arg2, arg3);
return 0;
}
static int drawing_path_curve_to_quadratic_bezier_smooth_relative(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
double arg3 = luaL_checknumber(L, 3);
DrawPathCurveToQuadraticBezierSmoothRelative(arg1, arg2, arg3);
return 0;
}
static int drawing_path_curve_to_relative(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
double arg3 = luaL_checknumber(L, 3);
double arg4 = luaL_checknumber(L, 4);
double arg5 = luaL_checknumber(L, 5);
double arg6 = luaL_checknumber(L, 6);
double arg7 = luaL_checknumber(L, 7);
DrawPathCurveToRelative(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
return 0;
}
static int drawing_path_curve_to_smooth_absolute(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
double arg3 = luaL_checknumber(L, 3);
double arg4 = luaL_checknumber(L, 4);
double arg5 = luaL_checknumber(L, 5);
DrawPathCurveToSmoothAbsolute(arg1, arg2, arg3, arg4, arg5);
return 0;
}
static int drawing_path_curve_to_smooth_relative(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
double arg3 = luaL_checknumber(L, 3);
double arg4 = luaL_checknumber(L, 4);
double arg5 = luaL_checknumber(L, 5);
DrawPathCurveToSmoothRelative(arg1, arg2, arg3, arg4, arg5);
return 0;
}
static int drawing_path_elliptic_arc_absolute(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
double arg3 = luaL_checknumber(L, 3);
double arg4 = luaL_checknumber(L, 4);
int arg5 = lua_toboolean(L, 5);
int arg6 = lua_toboolean(L, 6);
double arg7 = luaL_checknumber(L, 7);
double arg8 = luaL_checknumber(L, 8);
DrawPathEllipticArcAbsolute(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
return 0;
}
static int drawing_path_elliptic_arc_relative(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
double arg3 = luaL_checknumber(L, 3);
double arg4 = luaL_checknumber(L, 4);
int arg5 = lua_toboolean(L, 5);
int arg6 = lua_toboolean(L, 6);
double arg7 = luaL_checknumber(L, 7);
double arg8 = luaL_checknumber(L, 8);
DrawPathEllipticArcRelative(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
return 0;
}
static int drawing_path_finish(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
DrawPathFinish(arg1);
return 0;
}
static int drawing_path_line_to_absolute(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
double arg3 = luaL_checknumber(L, 3);
DrawPathLineToAbsolute(arg1, arg2, arg3);
return 0;
}
static int drawing_path_line_to_horizontal_absolute(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
DrawPathLineToHorizontalAbsolute(arg1, arg2);
return 0;
}
static int drawing_path_line_to_horizontal_relative(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
DrawPathLineToHorizontalRelative(arg1, arg2);
return 0;
}
static int drawing_path_line_to_relative(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
double arg3 = luaL_checknumber(L, 3);
DrawPathLineToRelative(arg1, arg2, arg3);
return 0;
}
static int drawing_path_line_to_vertical_absolute(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
DrawPathLineToVerticalAbsolute(arg1, arg2);
return 0;
}
static int drawing_path_line_to_vertical_relative(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
DrawPathLineToVerticalRelative(arg1, arg2);
return 0;
}
static int drawing_path_move_to_absolute(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
double arg3 = luaL_checknumber(L, 3);
DrawPathMoveToAbsolute(arg1, arg2, arg3);
return 0;
}
static int drawing_path_move_to_relative(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
double arg3 = luaL_checknumber(L, 3);
DrawPathMoveToRelative(arg1, arg2, arg3);
return 0;
}
static int drawing_path_start(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
DrawPathStart(arg1);
return 0;
}
static int drawing_point(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
double arg3 = luaL_checknumber(L, 3);
DrawPoint(arg1, arg2, arg3);
return 0;
}
static int drawing_pop_clip_path(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
DrawPopClipPath(arg1);
return 0;
}
static int drawing_pop_defs(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
DrawPopDefs(arg1);
return 0;
}
static int drawing_pop_graphic_context(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
DrawPopGraphicContext(arg1);
return 0;
}
static int drawing_pop_pattern(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
if (DrawPopPattern(arg1) != MagickTrue) {
return drawing_error(L, arg1);
}
lua_pushboolean(L, 1);
return 1;
}
static int drawing_push_clip_path(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
const char *arg2 = luaL_checkstring(L, 2);
DrawPushClipPath(arg1, arg2);
return 0;
}
static int drawing_push_defs(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
DrawPushDefs(arg1);
return 0;
}
static int drawing_push_graphic_context(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
DrawPushGraphicContext(arg1);
return 0;
}
static int drawing_push_pattern(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
const char *arg2 = luaL_checkstring(L, 2);
double arg3 = luaL_checknumber(L, 3);
double arg4 = luaL_checknumber(L, 4);
double arg5 = luaL_checknumber(L, 5);
double arg6 = luaL_checknumber(L, 6);
if (DrawPushPattern(arg1, arg2, arg3, arg4, arg5, arg6) != MagickTrue) {
return drawing_error(L, arg1);
}
lua_pushboolean(L, 1);
return 1;
}
static int drawing_rectangle(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
double arg3 = luaL_checknumber(L, 3);
double arg4 = luaL_checknumber(L, 4);
double arg5 = luaL_checknumber(L, 5);
DrawRectangle(arg1, arg2, arg3, arg4, arg5);
return 0;
}
static int drawing_render(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
if (DrawRender(arg1) != MagickTrue) {
return drawing_error(L, arg1);
}
lua_pushboolean(L, 1);
return 1;
}
static int drawing_reset_vector_graphics(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
DrawResetVectorGraphics(arg1);
return 0;
}
static int drawing_rotate(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
DrawRotate(arg1, arg2);
return 0;
}
static int drawing_round_rectangle(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
double arg3 = luaL_checknumber(L, 3);
double arg4 = luaL_checknumber(L, 4);
double arg5 = luaL_checknumber(L, 5);
double arg6 = luaL_checknumber(L, 6);
double arg7 = luaL_checknumber(L, 7);
DrawRoundRectangle(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
return 0;
}
static int drawing_scale(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
double arg3 = luaL_checknumber(L, 3);
DrawScale(arg1, arg2, arg3);
return 0;
}
static int drawing_set_border_color(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
PixelWand *arg2 = check_pixel_wand(L, 2);
DrawSetBorderColor(arg1, arg2);
return 0;
}
static int drawing_set_clip_path(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
const char *arg2 = luaL_checkstring(L, 2);
if (DrawSetClipPath(arg1, arg2) != MagickTrue) {
return drawing_error(L, arg1);
}
lua_pushboolean(L, 1);
return 1;
}
static int drawing_set_clip_rule(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
FillRule arg2 = luaL_checknumber(L, 2);
DrawSetClipRule(arg1, arg2);
return 0;
}
static int drawing_set_clip_units(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
ClipPathUnits arg2 = luaL_checknumber(L, 2);
DrawSetClipUnits(arg1, arg2);
return 0;
}
static int drawing_set_density(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
const char *arg2 = luaL_checkstring(L, 2);
if (DrawSetDensity(arg1, arg2) != MagickTrue) {
return drawing_error(L, arg1);
}
lua_pushboolean(L, 1);
return 1;
}
static int drawing_set_fill_alpha(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
DrawSetFillAlpha(arg1, arg2);
return 0;
}
static int drawing_set_fill_color(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
PixelWand *arg2 = check_pixel_wand(L, 2);
DrawSetFillColor(arg1, arg2);
return 0;
}
static int drawing_set_fill_opacity(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
DrawSetFillOpacity(arg1, arg2);
return 0;
}
static int drawing_set_fill_pattern_url(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
const char *arg2 = luaL_checkstring(L, 2);
if (DrawSetFillPatternURL(arg1, arg2) != MagickTrue) {
return drawing_error(L, arg1);
}
lua_pushboolean(L, 1);
return 1;
}
static int drawing_set_fill_rule(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
FillRule arg2 = luaL_checknumber(L, 2);
DrawSetFillRule(arg1, arg2);
return 0;
}
static int drawing_set_font(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
const char *arg2 = luaL_checkstring(L, 2);
if (DrawSetFont(arg1, arg2) != MagickTrue) {
return drawing_error(L, arg1);
}
lua_pushboolean(L, 1);
return 1;
}
static int drawing_set_font_family(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
const char *arg2 = luaL_checkstring(L, 2);
if (DrawSetFontFamily(arg1, arg2) != MagickTrue) {
return drawing_error(L, arg1);
}
lua_pushboolean(L, 1);
return 1;
}
static int drawing_set_font_resolution(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
double arg3 = luaL_checknumber(L, 3);
if (DrawSetFontResolution(arg1, arg2, arg3) != MagickTrue) {
return drawing_error(L, arg1);
}
lua_pushboolean(L, 1);
return 1;
}
static int drawing_set_font_size(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
DrawSetFontSize(arg1, arg2);
return 0;
}
static int drawing_set_font_stretch(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
StretchType arg2 = luaL_checknumber(L, 2);
DrawSetFontStretch(arg1, arg2);
return 0;
}
static int drawing_set_font_style(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
StyleType arg2 = luaL_checknumber(L, 2);
DrawSetFontStyle(arg1, arg2);
return 0;
}
static int drawing_set_font_weight(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
size_t arg2 = luaL_checknumber(L, 2);
DrawSetFontWeight(arg1, arg2);
return 0;
}
static int drawing_set_gravity(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
GravityType arg2 = luaL_checknumber(L, 2);
DrawSetGravity(arg1, arg2);
return 0;
}
static int drawing_set_opacity(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
DrawSetOpacity(arg1, arg2);
return 0;
}
static int drawing_set_stroke_alpha(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
DrawSetStrokeAlpha(arg1, arg2);
return 0;
}
static int drawing_set_stroke_antialias(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
int arg2 = lua_toboolean(L, 2);
DrawSetStrokeAntialias(arg1, arg2);
return 0;
}
static int drawing_set_stroke_color(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
PixelWand *arg2 = check_pixel_wand(L, 2);
DrawSetStrokeColor(arg1, arg2);
return 0;
}
static int drawing_set_stroke_dash_offset(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
DrawSetStrokeDashOffset(arg1, arg2);
return 0;
}
static int drawing_set_stroke_line_cap(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
LineCap arg2 = luaL_checknumber(L, 2);
DrawSetStrokeLineCap(arg1, arg2);
return 0;
}
static int drawing_set_stroke_line_join(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
LineJoin arg2 = luaL_checknumber(L, 2);
DrawSetStrokeLineJoin(arg1, arg2);
return 0;
}
static int drawing_set_stroke_miter_limit(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
size_t arg2 = luaL_checknumber(L, 2);
DrawSetStrokeMiterLimit(arg1, arg2);
return 0;
}
static int drawing_set_stroke_opacity(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
DrawSetStrokeOpacity(arg1, arg2);
return 0;
}
static int drawing_set_stroke_pattern_url(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
const char *arg2 = luaL_checkstring(L, 2);
if (DrawSetStrokePatternURL(arg1, arg2) != MagickTrue) {
return drawing_error(L, arg1);
}
lua_pushboolean(L, 1);
return 1;
}
static int drawing_set_stroke_width(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
double arg2 = luaL_checknumber(L, 2);
DrawSetStrokeWidth(arg1, arg2);
return 0;
}
static int drawing_set_text_alignment(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
AlignType arg2 = luaL_checknumber(L, 2);
DrawSetTextAlignment(arg1, arg2);
return 0;
}
static int drawing_set_text_antialias(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
int arg2 = lua_toboolean(L, 2);
DrawSetTextAntialias(arg1, arg2);
return 0;
}
static int drawing_set_text_decoration(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);
DecorationType arg2 = luaL_checknumber(L, 2);
DrawSetTextDecoration(arg1, arg2);
return 0;
}
static int drawing_set_text_direction(lua_State *L) {
DrawingWand *arg1 = check_drawing_wand(L, 1);