rmagick 2.12.2 → 2.13.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rmagick might be problematic. Click here for more details.

@@ -1,10 +1,14 @@
1
- /* $Id: rmdraw.c,v 1.82 2009/09/11 22:29:30 rmagick Exp $ */
2
- /*============================================================================\
3
- | Copyright (C) 2009 by Timothy P. Hunter
4
- | Name: rmdraw.c
5
- | Author: Tim Hunter
6
- | Purpose: Contains Draw class methods.
7
- \============================================================================*/
1
+ /**************************************************************************//**
2
+ * Contains Draw class methods.
3
+ *
4
+ * Copyright © 2002 - 2009 by Timothy P. Hunter
5
+ *
6
+ * Changes since Nov. 2009 copyright © by Benjamin Thomas and Omer Bar-or
7
+ *
8
+ * @file rmdraw.c
9
+ * @version $Id: rmdraw.c,v 1.83 2009/12/20 02:33:33 baror Exp $
10
+ * @author Tim Hunter
11
+ ******************************************************************************/
8
12
 
9
13
  #include "rmagick.h"
10
14
  #include "float.h"
@@ -13,14 +17,21 @@ static void mark_Draw(void *);
13
17
  static void destroy_Draw(void *);
14
18
  static VALUE new_DrawOptions(void);
15
19
 
20
+ /** Method that gets type metrics */
16
21
  typedef MagickBooleanType (get_type_metrics_func_t)(Image *, const DrawInfo *, TypeMetric *);
17
22
  static VALUE get_type_metrics(int, VALUE *, VALUE, get_type_metrics_func_t);
18
23
 
19
24
 
20
- /*
21
- Method: Draw#affine=
22
- Purpose: set the affine matrix from an Magick::AffineMatrix
23
- */
25
+ /**
26
+ * Set the affine matrix from an Magick::AffineMatrix.
27
+ *
28
+ * Ruby usage:
29
+ * - @verbatim Draw#affine= @endverbatim
30
+ *
31
+ * @param self this object
32
+ * @param matrix the affine matrix to set
33
+ * @return self
34
+ */
24
35
  VALUE
25
36
  Draw_affine_eq(VALUE self, VALUE matrix)
26
37
  {
@@ -33,10 +44,16 @@ Draw_affine_eq(VALUE self, VALUE matrix)
33
44
  }
34
45
 
35
46
 
36
- /*
37
- Method: Draw#align=
38
- Purpose: set the text alignment
39
- */
47
+ /**
48
+ * Set the text alignment.
49
+ *
50
+ * Ruby usage:
51
+ * - @verbatim Draw#align= @endverbatim
52
+ *
53
+ * @param self this object
54
+ * @param align the alignment
55
+ * @return self
56
+ */
40
57
  VALUE
41
58
  Draw_align_eq(VALUE self, VALUE align)
42
59
  {
@@ -49,10 +66,16 @@ Draw_align_eq(VALUE self, VALUE align)
49
66
  }
50
67
 
51
68
 
52
- /*
53
- Method: Draw#decorate=
54
- Purpose: decorate attribute writer
55
- */
69
+ /**
70
+ * Decorate attribute writer.
71
+ *
72
+ * Ruby usage:
73
+ * - @verbatim Draw#decorate= @endverbatim
74
+ *
75
+ * @param self this object
76
+ * @param decorate the decorate
77
+ * @return self
78
+ */
56
79
  VALUE
57
80
  Draw_decorate_eq(VALUE self, VALUE decorate)
58
81
  {
@@ -65,10 +88,16 @@ Draw_decorate_eq(VALUE self, VALUE decorate)
65
88
  }
66
89
 
67
90
 
68
- /*
69
- Method: Draw#density=
70
- Purpose: density attribute writer
71
- */
91
+ /**
92
+ * Density attribute writer.
93
+ *
94
+ * Ruby usage:
95
+ * - @verbatim Draw#density= @endverbatim
96
+ *
97
+ * @param self this object
98
+ * @param density the density
99
+ * @return self
100
+ */
72
101
  VALUE
73
102
  Draw_density_eq(VALUE self, VALUE density)
74
103
  {
@@ -82,10 +111,16 @@ Draw_density_eq(VALUE self, VALUE density)
82
111
  }
83
112
 
84
113
 
85
- /*
86
- Method: Draw#encoding=
87
- Purpose: encoding attribute writer
88
- */
114
+ /**
115
+ * Encoding attribute writer.
116
+ *
117
+ * Ruby usage:
118
+ * - @verbatim Draw#encoding= @endverbatim
119
+ *
120
+ * @param self this object
121
+ * @param encoding the encoding
122
+ * @return self
123
+ */
89
124
  VALUE
90
125
  Draw_encoding_eq(VALUE self, VALUE encoding)
91
126
  {
@@ -99,10 +134,16 @@ Draw_encoding_eq(VALUE self, VALUE encoding)
99
134
  }
100
135
 
101
136
 
102
- /*
103
- Method: Draw#fill=
104
- Purpose: fill attribute writer
105
- */
137
+ /**
138
+ * Fill attribute writer.
139
+ *
140
+ * Ruby usage:
141
+ * - @verbatim Draw#fill= @endverbatim
142
+ *
143
+ * @param self this object
144
+ * @param fill the fill
145
+ * @return self
146
+ */
106
147
  VALUE
107
148
  Draw_fill_eq(VALUE self, VALUE fill)
108
149
  {
@@ -115,11 +156,18 @@ Draw_fill_eq(VALUE self, VALUE fill)
115
156
  }
116
157
 
117
158
 
118
- /*
119
- Method: Draw#fill_pattern=
120
- Purpose: Accept an image as a fill pattern
121
- Notes: See also stroke_pattern=, tile=
122
- */
159
+ /**
160
+ * Accept an image as a fill pattern.
161
+ *
162
+ * Ruby usage:
163
+ * - @verbatim Draw#fill_pattern= @endverbatim
164
+ *
165
+ * @param self this object
166
+ * @param pattern the fill pattern
167
+ * @return self
168
+ * @see Draw_stroke_pattern_eq
169
+ * @see Draw_tile_eq
170
+ */
123
171
  VALUE
124
172
  Draw_fill_pattern_eq(VALUE self, VALUE pattern)
125
173
  {
@@ -148,10 +196,16 @@ Draw_fill_pattern_eq(VALUE self, VALUE pattern)
148
196
  }
149
197
 
150
198
 
151
- /*
152
- Method: Draw#font=
153
- Purpose: font attribute writer
154
- */
199
+ /**
200
+ * Font attribute writer.
201
+ *
202
+ * Ruby usage:
203
+ * - @verbatim Draw#font= @endverbatim
204
+ *
205
+ * @param self this object
206
+ * @param font the font
207
+ * @return self
208
+ */
155
209
  VALUE
156
210
  Draw_font_eq(VALUE self, VALUE font)
157
211
  {
@@ -165,10 +219,16 @@ Draw_font_eq(VALUE self, VALUE font)
165
219
  }
166
220
 
167
221
 
168
- /*
169
- Method: Draw#font_family=
170
- Purpose: font_family attribute writer
171
- */
222
+ /**
223
+ * Font family attribute writer.
224
+ *
225
+ * Ruby usage:
226
+ * - @verbatim Draw#family= @endverbatim
227
+ *
228
+ * @param self this object
229
+ * @param family the family
230
+ * @return self
231
+ */
172
232
  VALUE
173
233
  Draw_font_family_eq(VALUE self, VALUE family)
174
234
  {
@@ -182,10 +242,16 @@ Draw_font_family_eq(VALUE self, VALUE family)
182
242
  }
183
243
 
184
244
 
185
- /*
186
- Method: Draw#font_stretch=
187
- Purpose: font_stretch attribute writer
188
- */
245
+ /**
246
+ * Font_stretch attribute writer.
247
+ *
248
+ * Ruby usage:
249
+ * - @verbatim Draw#font_stretch= @endverbatim
250
+ *
251
+ * @param self this object
252
+ * @param stretch the font_stretch
253
+ * @return self
254
+ */
189
255
  VALUE
190
256
  Draw_font_stretch_eq(VALUE self, VALUE stretch)
191
257
  {
@@ -198,10 +264,16 @@ Draw_font_stretch_eq(VALUE self, VALUE stretch)
198
264
  }
199
265
 
200
266
 
201
- /*
202
- Method: Draw#font_style=
203
- Purpose: font_style attribute writer
204
- */
267
+ /**
268
+ * Font_style attribute writer.
269
+ *
270
+ * Ruby usage:
271
+ * - @verbatim Draw#font_style= @endverbatim
272
+ *
273
+ * @param self this object
274
+ * @param style the font_style
275
+ * @return self
276
+ */
205
277
  VALUE
206
278
  Draw_font_style_eq(VALUE self, VALUE style)
207
279
  {
@@ -214,12 +286,20 @@ Draw_font_style_eq(VALUE self, VALUE style)
214
286
  }
215
287
 
216
288
 
217
- /*
218
- Method: Draw#font_weight=
219
- Purpose: font_weight attribute writer
220
- Notes: The font weight can be one of the font weight constants
221
- or a number between 100 and 900
222
- */
289
+ /**
290
+ * Font_weight attribute writer.
291
+ *
292
+ * Ruby usage:
293
+ * - @verbatim Draw#font_weight= @endverbatim
294
+ *
295
+ * Notes:
296
+ * - The font weight can be one of the font weight constants or a number
297
+ * between 100 and 900
298
+ *
299
+ * @param self this object
300
+ * @param weight the font_weight
301
+ * @return self
302
+ */
223
303
  VALUE
224
304
  Draw_font_weight_eq(VALUE self, VALUE weight)
225
305
  {
@@ -270,21 +350,29 @@ Draw_font_weight_eq(VALUE self, VALUE weight)
270
350
  }
271
351
 
272
352
 
273
- /*
274
- Method: Draw#gravity=
275
- Purpose: gravity attribute writer
276
- Notes: From Magick++'s Image.h header file:
277
- Gravity affects text placement in bounding area according to rules:
278
- NorthWestGravity text bottom-left corner placed at top-left
279
- NorthGravity text bottom-center placed at top-center
280
- NorthEastGravity text bottom-right corner placed at top-right
281
- WestGravity text left-center placed at left-center
282
- CenterGravity text center placed at center
283
- EastGravity text right-center placed at right-center
284
- SouthWestGravity text top-left placed at bottom-left
285
- SouthGravity text top-center placed at bottom-center
286
- SouthEastGravity text top-right placed at bottom-right
287
- */
353
+ /**
354
+ * Gravity attribute writer.
355
+ *
356
+ * Ruby usage:
357
+ * - @verbatim Draw#gravity= @endverbatim
358
+ *
359
+ * Notes:
360
+ * - From Magick++'s Image.h header file:
361
+ * Gravity affects text placement in bounding area according to rules:
362
+ * - NorthWestGravity text bottom-left corner placed at top-left
363
+ * - NorthGravity text bottom-center placed at top-center
364
+ * - NorthEastGravity text bottom-right corner placed at top-right
365
+ * - WestGravity text left-center placed at left-center
366
+ * - CenterGravity text center placed at center
367
+ * - EastGravity text right-center placed at right-center
368
+ * - SouthWestGravity text top-left placed at bottom-left
369
+ * - SouthGravity text top-center placed at bottom-center
370
+ * - SouthEastGravity text top-right placed at bottom-right
371
+ *
372
+ * @param self this object
373
+ * @param grav the gravity
374
+ * @return self
375
+ */
288
376
  VALUE
289
377
  Draw_gravity_eq(VALUE self, VALUE grav)
290
378
  {
@@ -298,11 +386,19 @@ Draw_gravity_eq(VALUE self, VALUE grav)
298
386
  }
299
387
 
300
388
 
301
- /*
302
- Method: Draw#kerning=float
303
- Purpose: space between two letters
304
- Notes: new for 6.4.7-8
305
- */
389
+ /**
390
+ * Space between two letters.
391
+ *
392
+ * Ruby usage:
393
+ * - @verbatim Draw#gravity=float @endverbatim
394
+ *
395
+ * Notes:
396
+ * - New for ImageMagick 6.4.7-8
397
+ *
398
+ * @param self this object
399
+ * @param kerning the kerning
400
+ * @return self
401
+ */
306
402
  VALUE
307
403
  Draw_kerning_eq(VALUE self, VALUE kerning)
308
404
  {
@@ -322,11 +418,19 @@ Draw_kerning_eq(VALUE self, VALUE kerning)
322
418
  }
323
419
 
324
420
 
325
- /*
326
- Method: Draw#interline_spacing
327
- Purpose: space between two liness
328
- Notes: new for 6.5.5-8
329
- */
421
+ /**
422
+ * Space between two lines.
423
+ *
424
+ * Ruby usage:
425
+ * - @verbatim Draw#interline_spacing= @endverbatim
426
+ *
427
+ * Notes:
428
+ * - New for ImageMagick 6.5.5-8
429
+ *
430
+ * @param self this object
431
+ * @param spacing the spacing
432
+ * @return self
433
+ */
330
434
  VALUE
331
435
  Draw_interline_spacing_eq(VALUE self, VALUE spacing)
332
436
  {
@@ -346,11 +450,19 @@ Draw_interline_spacing_eq(VALUE self, VALUE spacing)
346
450
  }
347
451
 
348
452
 
349
- /*
350
- Method: Draw#interword_spacing
351
- Purpose: space between two words
352
- Notes: new for 6.4.8-0
353
- */
453
+ /**
454
+ * Space between two words.
455
+ *
456
+ * Ruby usage:
457
+ * - @verbatim Draw#interword_spacing= @endverbatim
458
+ *
459
+ * Notes:
460
+ * - New for ImageMagick 6.4.8-0
461
+ *
462
+ * @param self this object
463
+ * @param spacing the spacing
464
+ * @return self
465
+ */
354
466
  VALUE
355
467
  Draw_interword_spacing_eq(VALUE self, VALUE spacing)
356
468
  {
@@ -370,11 +482,18 @@ Draw_interword_spacing_eq(VALUE self, VALUE spacing)
370
482
  }
371
483
 
372
484
 
373
- /*
374
- Static: image_to_str
375
- Purpose: Convert an image to a blob and the blob to a String
376
- Notes: Returns Qnil if there is no image
377
- */
485
+ /**
486
+ * Convert an image to a blob and the blob to a String.
487
+ *
488
+ * No Ruby usage (internal function)
489
+ *
490
+ * Notes:
491
+ * - Returns Qnil if there is no image
492
+ *
493
+ * @param image the Image to convert
494
+ * @return Ruby string representation of image
495
+ * @see str_to_image
496
+ */
378
497
  static VALUE
379
498
  image_to_str(Image *image)
380
499
  {
@@ -400,11 +519,18 @@ image_to_str(Image *image)
400
519
  }
401
520
 
402
521
 
403
- /*
404
- Static: str_to_image
405
- Purpose: Undo the image_to_str, above.
406
- Notes: Returns NULL if the argument is Qnil
407
- */
522
+ /**
523
+ * Undo the image_to_str, above.
524
+ *
525
+ * No Ruby usage (internal function)
526
+ *
527
+ * Notes:
528
+ * - Returns NULL if the argument is Qnil
529
+ *
530
+ * @param str the Ruby string to convert
531
+ * @return Image represented by str
532
+ * @see image_to_str
533
+ */
408
534
  static
409
535
  Image *str_to_image(VALUE str)
410
536
  {
@@ -426,19 +552,24 @@ Image *str_to_image(VALUE str)
426
552
  }
427
553
 
428
554
 
429
- /*
430
- Method: Draw#marshal_dump
431
- Purpose: Custom marshal for Draw objects
432
- Notes: Instead of trying to replicate Ruby's support for cross-system
433
- marshalling, exploit it. Convert the Draw fields to Ruby objects
434
- and store them in a hash. Let Ruby marshal the hash.
435
-
436
- Commented out code that dumps/loads fields that are used internally
437
- by ImageMagick and shouldn't be marshaled. I left the code as
438
- placeholders so I'll know which fields have been deliberately
439
- omitted.
440
- To do: Handle gradients when christy gets the new gradient support added (23Dec08)
441
- */
555
+ /**
556
+ * Custom marshal for Draw objects.
557
+ *
558
+ * Ruby usage:
559
+ * - @verbatim Draw#marshal_dump @endverbatim
560
+ *
561
+ * Notes:
562
+ * - Instead of trying to replicate Ruby's support for cross-system
563
+ * marshalling, exploit it. Convert the Draw fields to Ruby objects and
564
+ * store them in a hash. Let Ruby marshal the hash.
565
+ * - Commented out code that dumps/loads fields that are used internally by
566
+ * ImageMagick and shouldn't be marshaled. I left the code as placeholders
567
+ * so I'll know which fields have been deliberately omitted.
568
+ *
569
+ * @param self this object
570
+ * @return the marshalled object (as a Ruby hash)
571
+ * @todo Handle gradients when christy gets the new gradient support added (23Dec08)
572
+ */
442
573
  VALUE
443
574
  Draw_marshal_dump(VALUE self)
444
575
  {
@@ -515,11 +646,19 @@ Draw_marshal_dump(VALUE self)
515
646
  }
516
647
 
517
648
 
518
- /*
519
- Method: Draw#marshal_load
520
- Purpose: Support Marsal.load
521
- Notes: On entry all fields are all-bits-0
522
- */
649
+ /**
650
+ * Support Marsal.load.
651
+ *
652
+ * Ruby usage:
653
+ * - @verbatim Draw#marshal_load @endverbatim
654
+ *
655
+ * Notes:
656
+ * - On entry all fields are all-bits-0
657
+ *
658
+ * @param self this object
659
+ * @param ddraw the marshalled object
660
+ * @return self, once marshalled
661
+ */
523
662
  VALUE
524
663
  Draw_marshal_load(VALUE self, VALUE ddraw)
525
664
  {
@@ -590,10 +729,16 @@ Draw_marshal_load(VALUE self, VALUE ddraw)
590
729
  }
591
730
 
592
731
 
593
- /*
594
- Method: Draw#pointsize=
595
- Purpose: pointsize attribute writer
596
- */
732
+ /**
733
+ * Pointsize attribute writer.
734
+ *
735
+ * Ruby usage:
736
+ * - @verbatim Draw#pointsize= @endverbatim
737
+ *
738
+ * @param self this object
739
+ * @param pointsize the pointsize
740
+ * @return self
741
+ */
597
742
  VALUE
598
743
  Draw_pointsize_eq(VALUE self, VALUE pointsize)
599
744
  {
@@ -606,12 +751,21 @@ Draw_pointsize_eq(VALUE self, VALUE pointsize)
606
751
  }
607
752
 
608
753
 
609
- /*
610
- Method: Magick::Draw#rotation=degrees
611
- Purpose: set rotation attribute value
612
- Notes: Taken from Magick++'s Magick::Image::annotate method
613
- Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002
614
- */
754
+ /**
755
+ * Set rotation attribute value.
756
+ *
757
+ * Ruby usage:
758
+ * - @verbatim Magick::Draw#rotation= @endverbatim
759
+ *
760
+ * Notes:
761
+ * - Argument should be in degrees
762
+ * - Taken from Magick++'s Magick::Image::annotate method.
763
+ * Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002
764
+ *
765
+ * @param self this object
766
+ * @param deg the number of degrees
767
+ * @return self
768
+ */
615
769
  VALUE
616
770
  Draw_rotation_eq(VALUE self, VALUE deg)
617
771
  {
@@ -649,10 +803,16 @@ Draw_rotation_eq(VALUE self, VALUE deg)
649
803
  }
650
804
 
651
805
 
652
- /*
653
- Method: Draw#stroke=
654
- Purpose: stroke attribute writer
655
- */
806
+ /**
807
+ * Stroke attribute writer.
808
+ *
809
+ * Ruby usage:
810
+ * - @verbatim Draw#stroke= @endverbatim
811
+ *
812
+ * @param self this object
813
+ * @param stroke the stroke
814
+ * @return self
815
+ */
656
816
  VALUE
657
817
  Draw_stroke_eq(VALUE self, VALUE stroke)
658
818
  {
@@ -665,11 +825,17 @@ Draw_stroke_eq(VALUE self, VALUE stroke)
665
825
  }
666
826
 
667
827
 
668
- /*
669
- Method: Draw#stroke_pattern=
670
- Purpose: Accept an image as a stroke pattern
671
- Notes: See also fill_pattern=
672
- */
828
+ /**
829
+ * Accept an image as a stroke pattern.
830
+ *
831
+ * Ruby usage:
832
+ * - @verbatim Draw#stroke_pattern= @endverbatim
833
+ *
834
+ * @param self this object
835
+ * @param pattern the pattern
836
+ * @return self
837
+ * @see Draw_fill_pattern_eq
838
+ */
673
839
  VALUE
674
840
  Draw_stroke_pattern_eq(VALUE self, VALUE pattern)
675
841
  {
@@ -699,10 +865,16 @@ Draw_stroke_pattern_eq(VALUE self, VALUE pattern)
699
865
  }
700
866
 
701
867
 
702
- /*
703
- Method: Draw#stroke_width=
704
- Purpose: stroke_width attribute writer
705
- */
868
+ /**
869
+ * Stroke_width attribute writer.
870
+ *
871
+ * Ruby usage:
872
+ * - @verbatim Draw#stroke_width= @endverbatim
873
+ *
874
+ * @param self this object
875
+ * @param stroke_width the stroke_width
876
+ * @return self
877
+ */
706
878
  VALUE
707
879
  Draw_stroke_width_eq(VALUE self, VALUE stroke_width)
708
880
  {
@@ -715,10 +887,16 @@ Draw_stroke_width_eq(VALUE self, VALUE stroke_width)
715
887
  }
716
888
 
717
889
 
718
- /*
719
- Method: Draw#text_antialias=
720
- Purpose: text_antialias attribute writer
721
- */
890
+ /**
891
+ * Text_antialias attribute writer.
892
+ *
893
+ * Ruby usage:
894
+ * - @verbatim Draw#text_antialias= @endverbatim
895
+ *
896
+ * @param self this object
897
+ * @param text_antialias the text_antialias
898
+ * @return self
899
+ */
722
900
  VALUE
723
901
  Draw_text_antialias_eq(VALUE self, VALUE text_antialias)
724
902
  {
@@ -731,10 +909,16 @@ Draw_text_antialias_eq(VALUE self, VALUE text_antialias)
731
909
  }
732
910
 
733
911
 
734
- /*
735
- Method: Draw#tile=
736
- Purpose: tile attribute writer
737
- */
912
+ /**
913
+ * Tile attribute writer.
914
+ *
915
+ * Ruby usage:
916
+ * - @verbatim Draw#tile= @endverbatim
917
+ *
918
+ * @param self this object
919
+ * @param image the image to tile
920
+ * @return self
921
+ */
738
922
  VALUE
739
923
  Draw_tile_eq(VALUE self, VALUE image)
740
924
  {
@@ -742,10 +926,16 @@ Draw_tile_eq(VALUE self, VALUE image)
742
926
  }
743
927
 
744
928
 
745
- /*
746
- Method: Draw#undercolor=
747
- Purpose: undercolor attribute writer
748
- */
929
+ /**
930
+ * Undercolor attribute writer.
931
+ *
932
+ * Ruby usage:
933
+ * - @verbatim Draw#undercolor= @endverbatim
934
+ *
935
+ * @param self this object
936
+ * @param undercolor the undercolor
937
+ * @return self
938
+ */
749
939
  VALUE
750
940
  Draw_undercolor_eq(VALUE self, VALUE undercolor)
751
941
  {
@@ -758,14 +948,25 @@ Draw_undercolor_eq(VALUE self, VALUE undercolor)
758
948
  }
759
949
 
760
950
 
761
- /*
762
- Method: Draw#annotate(img, w, h, x, y, text) <{optional parms}>
763
- Purpose: annotates an image with text
764
- Returns: self
765
- Notes: Additional Draw attribute methods may be called in the
766
- optional block, which is executed in the context of an
767
- Draw object.
768
- */
951
+ /**
952
+ * Annotates an image with text.
953
+ *
954
+ * Ruby usage:
955
+ * - @verbatim Draw#annotate(img, w, h, x, y, text) <{optional parms}> @endverbatim
956
+ *
957
+ * Notes:
958
+ * - Additional Draw attribute methods may be called in the optional block,
959
+ * which is executed in the context of an Draw object.
960
+ *
961
+ * @param self this object
962
+ * @param image_arg the image
963
+ * @param width_arg the width
964
+ * @param height_arg the height
965
+ * @param x_arg x position
966
+ * @param y_arg y position
967
+ * @param text the annotation text
968
+ * @return self
969
+ */
769
970
  VALUE Draw_annotate(
770
971
  VALUE self,
771
972
  VALUE image_arg,
@@ -836,10 +1037,17 @@ VALUE Draw_annotate(
836
1037
  }
837
1038
 
838
1039
 
839
- /*
840
- Method: Draw#clone
841
- Notes: see dup, init_copy
842
- */
1040
+ /**
1041
+ * Clones this object.
1042
+ *
1043
+ * Ruby usage:
1044
+ * - @verbatim Draw#clone @endverbatim
1045
+ *
1046
+ * @param self this object
1047
+ * @return the clone
1048
+ * @see Draw_dup
1049
+ * @see Draw_init_copy
1050
+ */
843
1051
  VALUE
844
1052
  Draw_clone(VALUE self)
845
1053
  {
@@ -855,12 +1063,23 @@ Draw_clone(VALUE self)
855
1063
  }
856
1064
 
857
1065
 
858
- /*
859
- Method: Draw#composite(x,y,width,height,img,operator=OverCompositeOp)
860
- Purpose: Implement the "image" drawing primitive
861
- Notes: The "img" argument can be either an ImageList object
862
- or an Image argument.
863
- */
1066
+ /**
1067
+ * Implement the "image" drawing primitive.
1068
+ *
1069
+ * Ruby usage:
1070
+ * - @verbatim Draw#composite(x,y,width,height,img) @endverbatim
1071
+ * - @verbatim Draw#composite(x,y,width,height,img,operator) @endverbatim
1072
+ *
1073
+ * Notes:
1074
+ * - Default operator is overComposite
1075
+ * - The "img" argument can be either an ImageList object or an Image
1076
+ * argument.
1077
+ *
1078
+ * @param argc number of input arguments
1079
+ * @param argv array of input arguments
1080
+ * @param self this object
1081
+ * @return self
1082
+ */
864
1083
  VALUE
865
1084
  Draw_composite(int argc, VALUE *argv, VALUE self)
866
1085
  {
@@ -1124,11 +1343,16 @@ Draw_composite(int argc, VALUE *argv, VALUE self)
1124
1343
  }
1125
1344
 
1126
1345
 
1127
- /*
1128
- Method: Draw#draw(i)
1129
- Purpose: Execute the stored drawing primitives on the current image
1130
- image
1131
- */
1346
+ /**
1347
+ * Execute the stored drawing primitives on the current image.
1348
+ *
1349
+ * Ruby usage:
1350
+ * - @verbatim Draw#draw(i) @endverbatim
1351
+ *
1352
+ * @param self this object
1353
+ * @param image_arg the image argument
1354
+ * @return self
1355
+ */
1132
1356
  VALUE
1133
1357
  Draw_draw(VALUE self, VALUE image_arg)
1134
1358
  {
@@ -1157,11 +1381,20 @@ Draw_draw(VALUE self, VALUE image_arg)
1157
1381
  }
1158
1382
 
1159
1383
 
1160
- /*
1161
- Methods: Draw#dup
1162
- Purpose: Copy a Draw object
1163
- Notes: Constructs a new Draw object, then calls initialize_copy
1164
- */
1384
+ /**
1385
+ * Copy a Draw object.
1386
+ *
1387
+ * Ruby usage:
1388
+ * - @verbatim Draw#dup @endverbatim
1389
+ *
1390
+ * Notes:
1391
+ * - Constructs a new Draw object, then calls initialize_copy.
1392
+ *
1393
+ * @param self this object
1394
+ * @return the duplicate
1395
+ * @see Draw_clone
1396
+ * @see Draw_init_copy
1397
+ */
1165
1398
  VALUE
1166
1399
  Draw_dup(VALUE self)
1167
1400
  {
@@ -1179,14 +1412,23 @@ Draw_dup(VALUE self)
1179
1412
  }
1180
1413
 
1181
1414
 
1182
- /*
1183
- Method: Draw#get_type_metrics([image, ]text)
1184
- Draw#get_multiline_type_metrics([image, ]text)
1185
- Purpose: returns measurements for a given font and text string
1186
- Notes: If the image argument has been omitted, use a dummy
1187
- image, but make sure the text has none of the special
1188
- characters that refer to image attributes.
1189
- */
1415
+ /**
1416
+ * Returns measurements for a given font and text string.
1417
+ *
1418
+ * Ruby usage:
1419
+ * - @verbatim Draw#get_type_metrics(text) @endverbatim
1420
+ * - @verbatim Draw#get_type_metrics(image, text) @endverbatim
1421
+ *
1422
+ * Notes:
1423
+ * - If the image argument has been omitted, use a dummy image, but make sure
1424
+ * the text has none of the special characters that refer to image
1425
+ * attributes.
1426
+ *
1427
+ * @param argc number of input arguments
1428
+ * @param argv array of input arguments
1429
+ * @param self this object
1430
+ * @return the duplicate
1431
+ */
1190
1432
  VALUE
1191
1433
  Draw_get_type_metrics(
1192
1434
  int argc,
@@ -1197,6 +1439,23 @@ Draw_get_type_metrics(
1197
1439
  }
1198
1440
 
1199
1441
 
1442
+ /**
1443
+ * Returns measurements for a given font and text string.
1444
+ *
1445
+ * Ruby usage:
1446
+ * - @verbatim Draw#get_multiline_type_metrics(text) @endverbatim
1447
+ * - @verbatim Draw#get_multiline_type_metrics(image, text) @endverbatim
1448
+ *
1449
+ * Notes:
1450
+ * - If the image argument has been omitted, use a dummy image, but make sure
1451
+ * the text has none of the special characters that refer to image
1452
+ * attributes.
1453
+ *
1454
+ * @param argc number of input arguments
1455
+ * @param argv array of input arguments
1456
+ * @param self this object
1457
+ * @return the duplicate
1458
+ */
1200
1459
  VALUE
1201
1460
  Draw_get_multiline_type_metrics(
1202
1461
  int argc,
@@ -1207,10 +1466,18 @@ Draw_get_multiline_type_metrics(
1207
1466
  }
1208
1467
 
1209
1468
 
1210
- /*
1211
- Method: Draw#initialize_copy
1212
- Purpose: initialize clone, dup methods
1213
- */
1469
+ /**
1470
+ * Initialize clone, dup methods.
1471
+ *
1472
+ * Ruby usage:
1473
+ * - @verbatim Draw#initialize_copy @endverbatim
1474
+ *
1475
+ * @param self this object
1476
+ * @param orig the original object
1477
+ * @return self
1478
+ * @see Draw_clone
1479
+ * @see Draw_dup
1480
+ */
1214
1481
  VALUE Draw_init_copy(VALUE self, VALUE orig)
1215
1482
  {
1216
1483
  Draw *copy, *original;
@@ -1233,10 +1500,15 @@ VALUE Draw_init_copy(VALUE self, VALUE orig)
1233
1500
  }
1234
1501
 
1235
1502
 
1236
- /*
1237
- Method: Draw#initialize <{ info initializers }>
1238
- Purpose: Initialize Draw object
1239
- */
1503
+ /**
1504
+ * Initialize Draw object.
1505
+ *
1506
+ * Ruby usage:
1507
+ * - @verbatim Draw#initialize <{ info initializers }> @endverbatim
1508
+ *
1509
+ * @param self this object
1510
+ * @return self
1511
+ */
1240
1512
  VALUE
1241
1513
  Draw_initialize(VALUE self)
1242
1514
  {
@@ -1254,10 +1526,16 @@ Draw_initialize(VALUE self)
1254
1526
  }
1255
1527
 
1256
1528
 
1257
- /*
1258
- Method: inspect
1259
- Purpose: display the primitives
1260
- */
1529
+ /**
1530
+ * Display the primitives.
1531
+ *
1532
+ * Ruby usage:
1533
+ * - @verbatim Draw#inspect @endverbatim
1534
+ *
1535
+ * @param self this object
1536
+ * @return the draw primitives or the Ruby string "(no primitives defined)" if
1537
+ * they are not defined
1538
+ */
1261
1539
  VALUE
1262
1540
  Draw_inspect(VALUE self)
1263
1541
  {
@@ -1268,11 +1546,17 @@ Draw_inspect(VALUE self)
1268
1546
  }
1269
1547
 
1270
1548
 
1271
- /*
1272
- Method: Draw.new/Draw.allocate
1273
- Purpose: Create a new Draw object
1274
- Raises: ImageMagickError if no memory
1275
- */
1549
+ /**
1550
+ * Create a new Draw object.
1551
+ *
1552
+ * Ruby usage:
1553
+ * - @verbatim Draw.new @endverbatim
1554
+ * - @verbatim Draw.allocate @endverbatim
1555
+ *
1556
+ * @param class the Ruby Draw class
1557
+ * @return a new Draw object
1558
+ * @throw ImageMagickError if no memory
1559
+ */
1276
1560
  VALUE Draw_alloc(VALUE class)
1277
1561
  {
1278
1562
  Draw *draw;
@@ -1286,11 +1570,16 @@ VALUE Draw_alloc(VALUE class)
1286
1570
  }
1287
1571
 
1288
1572
 
1289
- /*
1290
- Method: Draw#primitive
1291
- Purpose: Add a drawing primitive to the list of primitives in the
1292
- Draw object
1293
- */
1573
+ /**
1574
+ * Add a drawing primitive to the list of primitives in the Draw object.
1575
+ *
1576
+ * Ruby usage:
1577
+ * - @verbatim Draw#primitive @endverbatim
1578
+ *
1579
+ * @param self this object
1580
+ * @param primitive the primitive to add
1581
+ * @return self
1582
+ */
1294
1583
  VALUE
1295
1584
  Draw_primitive(VALUE self, VALUE primitive)
1296
1585
  {
@@ -1313,10 +1602,13 @@ Draw_primitive(VALUE self, VALUE primitive)
1313
1602
  }
1314
1603
 
1315
1604
 
1316
- /*
1317
- Static: mark_Draw
1318
- Purpose: mark referenced objects
1319
- */
1605
+ /**
1606
+ * Mark referenced objects.
1607
+ *
1608
+ * No Ruby usage (internal function)
1609
+ *
1610
+ * @param drawptr pointer to a Draw object
1611
+ */
1320
1612
  static void
1321
1613
  mark_Draw(void *drawptr)
1322
1614
  {
@@ -1329,10 +1621,13 @@ mark_Draw(void *drawptr)
1329
1621
  }
1330
1622
 
1331
1623
 
1332
- /*
1333
- Static: destroy_Draw
1334
- Purpose: free the memory associated with an Draw object
1335
- */
1624
+ /**
1625
+ * Free the memory associated with an Draw object.
1626
+ *
1627
+ * No Ruby usage (internal function)
1628
+ *
1629
+ * @param drawptr pointer to a Draw object
1630
+ */
1336
1631
  static void
1337
1632
  destroy_Draw(void *drawptr)
1338
1633
  {
@@ -1358,10 +1653,13 @@ destroy_Draw(void *drawptr)
1358
1653
  }
1359
1654
 
1360
1655
 
1361
- /*
1362
- Static: new_DrawOptions
1363
- Purpose: Allocate & initialize a DrawOptions object.
1364
- */
1656
+ /**
1657
+ * Allocate & initialize a DrawOptions object.
1658
+ *
1659
+ * No Ruby usage (internal function)
1660
+ *
1661
+ * @return a new DrawOptions object
1662
+ */
1365
1663
  static VALUE
1366
1664
  new_DrawOptions(void)
1367
1665
  {
@@ -1369,13 +1667,20 @@ new_DrawOptions(void)
1369
1667
  }
1370
1668
 
1371
1669
 
1372
- /*
1373
- Method: DrawOptions#allocate
1374
- DarwOptions#new
1375
- Purpose: Create a DrawOptions object
1376
- Notes: The DrawOptions class is the same as the Draw class except
1377
- is has only the attribute writer functions.
1378
- */
1670
+ /**
1671
+ * Create a DrawOptions object.
1672
+ *
1673
+ * Ruby usage:
1674
+ * - @verbatim DrawOptions#allocate @endverbatim
1675
+ * - @verbatim DrawOptions#new @endverbatim
1676
+ *
1677
+ * Notes:
1678
+ * - The DrawOptions class is the same as the Draw class except is has only
1679
+ * the attribute writer functions
1680
+ *
1681
+ * @param class the Ruby DrawOptions class
1682
+ * @return a new DrawOptions object
1683
+ */
1379
1684
  VALUE
1380
1685
  DrawOptions_alloc(VALUE class)
1381
1686
  {
@@ -1390,10 +1695,15 @@ DrawOptions_alloc(VALUE class)
1390
1695
  }
1391
1696
 
1392
1697
 
1393
- /*
1394
- Method: DrawOptions#initialize
1395
- Purpose: Initialize a DrawOptions object
1396
- */
1698
+ /**
1699
+ * Initialize a DrawOptions object.
1700
+ *
1701
+ * Ruby usage:
1702
+ * - @verbatim DrawOptions#initialize @endverbatim
1703
+ *
1704
+ * @param self this object
1705
+ * @return self
1706
+ */
1397
1707
  VALUE
1398
1708
  DrawOptions_initialize(VALUE self)
1399
1709
  {
@@ -1418,13 +1728,20 @@ DrawOptions_initialize(VALUE self)
1418
1728
  }
1419
1729
 
1420
1730
 
1421
- /*
1422
- Extern: PolaroidOptions_alloc()
1423
- Purpose: Allocate a new Magick::PolaroidOptions object
1424
- Notes: Internally a PolaroidOptions object is the same as a Draw
1425
- object. The methods are implemented by Draw methods in
1426
- rmdraw.c.
1427
- */
1731
+ /**
1732
+ * Allocate a new Magick::PolaroidOptions object.
1733
+ *
1734
+ * Ruby usage:
1735
+ * - @verbatim Magick::PolaroidOptions#allocate @endverbatim
1736
+ * - @verbatim Magick::PolaroidOptions#new @endverbatim
1737
+ *
1738
+ * Notes:
1739
+ * - Internally a PolaroidOptions object is the same as a Draw object. The
1740
+ * methods are implemented by Draw methods in rmdraw.c.
1741
+ *
1742
+ * @param class the Ruby PoloradoidOptions class
1743
+ * @return a new DrawOptions object
1744
+ */
1428
1745
  VALUE
1429
1746
  PolaroidOptions_alloc(VALUE class)
1430
1747
  {
@@ -1446,10 +1763,15 @@ PolaroidOptions_alloc(VALUE class)
1446
1763
  }
1447
1764
 
1448
1765
 
1449
- /*
1450
- Method: Magick::PolaroidOptions#initialize
1451
- Purpose: Yield to an optional block
1452
- */
1766
+ /**
1767
+ * Yield to an optional block.
1768
+ *
1769
+ * Ruby usage:
1770
+ * - @verbatim Magick::PolaroidOptions#initialize @endverbatim
1771
+ *
1772
+ * @param self this object
1773
+ * @return self
1774
+ */
1453
1775
  VALUE
1454
1776
  PolaroidOptions_initialize(VALUE self)
1455
1777
  {
@@ -1473,11 +1795,13 @@ PolaroidOptions_initialize(VALUE self)
1473
1795
  }
1474
1796
 
1475
1797
 
1476
- /*
1477
- Extern: rm_polaroid_new
1478
- Purpose: allocate a PolaroidOptions instance
1479
- Notes: Internal use
1480
- */
1798
+ /**
1799
+ * Allocate a PolaroidOptions instance.
1800
+ *
1801
+ * No Ruby usage (internal function)
1802
+ *
1803
+ * @return new PolaroidOptions object
1804
+ */
1481
1805
  VALUE
1482
1806
  rm_polaroid_new(void)
1483
1807
  {
@@ -1485,10 +1809,16 @@ rm_polaroid_new(void)
1485
1809
  }
1486
1810
 
1487
1811
 
1488
- /*
1489
- Method: PolaroidOptions#shadow_color=
1490
- Purpose: Set the shadow color attribute
1491
- */
1812
+ /**
1813
+ * Set the shadow color attribute.
1814
+ *
1815
+ * Ruby usage:
1816
+ * - @verbatim PolaroidOptions#shadow_color= @endverbatim
1817
+ *
1818
+ * @param self this object
1819
+ * @param shadow the shadow color
1820
+ * @return self
1821
+ */
1492
1822
  VALUE
1493
1823
  PolaroidOptions_shadow_color_eq(VALUE self, VALUE shadow)
1494
1824
  {
@@ -1500,10 +1830,16 @@ PolaroidOptions_shadow_color_eq(VALUE self, VALUE shadow)
1500
1830
  }
1501
1831
 
1502
1832
 
1503
- /*
1504
- Method: PolaroidOptions#border_color=
1505
- Purpose: Set the border color attribute
1506
- */
1833
+ /**
1834
+ * Set the border color attribute.
1835
+ *
1836
+ * Ruby usage:
1837
+ * - @verbatim PolaroidOptions#border_color= @endverbatim
1838
+ *
1839
+ * @param self this object
1840
+ * @param border the border color
1841
+ * @return self
1842
+ */
1507
1843
  VALUE
1508
1844
  PolaroidOptions_border_color_eq(VALUE self, VALUE border)
1509
1845
  {
@@ -1515,6 +1851,14 @@ PolaroidOptions_border_color_eq(VALUE self, VALUE border)
1515
1851
  }
1516
1852
 
1517
1853
 
1854
+ /**
1855
+ * Create a dummy object of an image class.
1856
+ *
1857
+ * No Ruby usage (internal function)
1858
+ *
1859
+ * @param klass the class for which to create a dummy
1860
+ * @return the newly allocated dummy
1861
+ */
1518
1862
  static VALUE
1519
1863
  get_dummy_tm_img(VALUE klass)
1520
1864
  {
@@ -1547,11 +1891,22 @@ get_dummy_tm_img(VALUE klass)
1547
1891
  }
1548
1892
 
1549
1893
 
1550
- /*
1551
- * Static: get_type_metrics
1552
- * Purpose: Call a get-type-metrics function
1553
- * Notes: called by Draw_get_type_metrics and Draw_get_multiline_type_metrics
1554
- */
1894
+ /**
1895
+ * Call a get-type-metrics function.
1896
+ *
1897
+ * No Ruby usage (internal function)
1898
+ *
1899
+ * Notes:
1900
+ * - called by Draw_get_type_metrics and Draw_get_multiline_type_metrics
1901
+ *
1902
+ * @param argc number of input arguments
1903
+ * @param argv array of input arguments
1904
+ * @param self this object
1905
+ * @param getter which type metrics to get
1906
+ * @return the type metrics
1907
+ * @see Draw_get_type_metrics
1908
+ * @see Draw_get_multiline_type_metrics
1909
+ */
1555
1910
  static VALUE
1556
1911
  get_type_metrics(
1557
1912
  int argc,