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: rmstruct.c,v 1.4 2009/05/13 22:50:40 rmagick Exp $ */
2
- /*============================================================================\
3
- | Copyright (C) 2009 by Timothy P. Hunter
4
- | Name: rmstruct.c
5
- | Author: Tim Hunter
6
- | Purpose: Contains various Struct class methods.
7
- \============================================================================*/
1
+ /**************************************************************************//**
2
+ * Contains various Struct 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 rmstruct.c
9
+ * @version $Id: rmstruct.c,v 1.5 2009/12/20 02:33:34 baror Exp $
10
+ * @author Tim Hunter
11
+ ******************************************************************************/
8
12
 
9
13
  #include "rmagick.h"
10
14
 
@@ -21,12 +25,17 @@ static VALUE StyleType_new(StyleType);
21
25
 
22
26
 
23
27
 
24
- /*
25
- Extern: Import_AffineMatrix
26
- Purpose: Given a C AffineMatrix, create the equivalent
27
- AffineMatrix object.
28
- Notes: am = Magick::AffineMatrix.new(sx, rx, ry, sy, tx, ty)
29
- */
28
+ /**
29
+ * Given a C AffineMatrix, create the equivalent AffineMatrix object.
30
+ *
31
+ * No Ruby usage (internal function)
32
+ *
33
+ * Notes:
34
+ * - am = Magick::AffineMatrix.new(sx, rx, ry, sy, tx, ty)
35
+ *
36
+ * @param affine the C AffineMatrix
37
+ * @return a Ruby AffineMatrix object
38
+ */
30
39
  VALUE
31
40
  Import_AffineMatrix(AffineMatrix *affine)
32
41
  {
@@ -42,11 +51,17 @@ Import_AffineMatrix(AffineMatrix *affine)
42
51
  }
43
52
 
44
53
 
45
- /*
46
- Extern: Export_AffineMatrix
47
- Purpose: Convert a Magick::AffineMatrix object to a AffineMatrix structure.
48
- Notes: If not initialized, the defaults are [sx,rx,ry,sy,tx,ty] = [1,0,0,1,0,0]
49
- */
54
+ /**
55
+ * Convert a Magick::AffineMatrix object to a AffineMatrix structure.
56
+ *
57
+ * No Ruby usage (internal function)
58
+ *
59
+ * Notes:
60
+ * - If not initialized, the defaults are [sx,rx,ry,sy,tx,ty] = [1,0,0,1,0,0]
61
+ *
62
+ * @param am The C AffineMatrix to modify
63
+ * @param st the Ruby AffineMatrix object
64
+ */
50
65
  void
51
66
  Export_AffineMatrix(AffineMatrix *am, VALUE st)
52
67
  {
@@ -73,11 +88,14 @@ Export_AffineMatrix(AffineMatrix *am, VALUE st)
73
88
  }
74
89
 
75
90
 
76
- /*
77
- Extern: ChromaticityInfo_new(pp)
78
- Purpose: Create a Magick::ChromaticityInfo object from a
79
- ChromaticityInfo structure.
80
- */
91
+ /**
92
+ * Create a Magick::ChromaticityInfo object from a ChromaticityInfo structure.
93
+ *
94
+ * No Ruby usage (internal function)
95
+ *
96
+ * @param ci the C ChromaticityInfo
97
+ * @return a Ruby Magick::ChromaticityInfo object
98
+ */
81
99
  VALUE
82
100
  ChromaticityInfo_new(ChromaticityInfo *ci)
83
101
  {
@@ -96,11 +114,15 @@ ChromaticityInfo_new(ChromaticityInfo *ci)
96
114
  }
97
115
 
98
116
 
99
- /*
100
- Extern: Export_ChromaticityInfo
101
- Purpose: Extract the elements from a Magick::ChromaticityInfo
102
- and store in a ChromaticityInfo structure.
103
- */
117
+ /**
118
+ * Extract the elements from a Magick::ChromaticityInfo and store in a
119
+ * ChromaticityInfo structure.
120
+ *
121
+ * No Ruby usage (internal function)
122
+ *
123
+ * @param ci the C ChromaticityInfo structure to modify
124
+ * @param chrom the Ruby Magick::ChromaticityInfo object
125
+ */
104
126
  void
105
127
  Export_ChromaticityInfo(ChromaticityInfo *ci, VALUE chrom)
106
128
  {
@@ -157,10 +179,15 @@ Export_ChromaticityInfo(ChromaticityInfo *ci, VALUE chrom)
157
179
  }
158
180
 
159
181
 
160
- /*
161
- Method: Magick::Chromaticity#to_s
162
- Purpose: Create a string representation of a Magick::Chromaticity
163
- */
182
+ /**
183
+ * Create a string representation of a Magick::Chromaticity.
184
+ *
185
+ * Ruby usage:
186
+ * - @verbatim Magick::Chromaticity#to_s @endverbatim
187
+ *
188
+ * @param self this object
189
+ * @return the string
190
+ */
164
191
  VALUE
165
192
  ChromaticityInfo_to_s(VALUE self)
166
193
  {
@@ -180,10 +207,14 @@ ChromaticityInfo_to_s(VALUE self)
180
207
  }
181
208
 
182
209
 
183
- /*
184
- External: Import_ColorInfo
185
- Purpose: Convert a ColorInfo structure to a Magick::Color
186
- */
210
+ /**
211
+ * Convert a ColorInfo structure to a Magick::Color.
212
+ *
213
+ * No Ruby usage (internal function)
214
+ *
215
+ * @param ci the C ColorInfo structure
216
+ * @return a Ruby Magick::Color object
217
+ */
187
218
  VALUE
188
219
  Import_ColorInfo(const ColorInfo *ci)
189
220
  {
@@ -203,10 +234,14 @@ Import_ColorInfo(const ColorInfo *ci)
203
234
  }
204
235
 
205
236
 
206
- /*
207
- External: Export_ColorInfo
208
- Purpose: Convert a Magick::Color to a ColorInfo structure
209
- */
237
+ /**
238
+ * Convert a Magick::Color to a ColorInfo structure.
239
+ *
240
+ * No Ruby usage (internal function)
241
+ *
242
+ * @param ci the C ColorInfo structure to modify
243
+ * @param st the Ruby Magick::Color object
244
+ */
210
245
  void
211
246
  Export_ColorInfo(ColorInfo *ci, VALUE st)
212
247
  {
@@ -249,12 +284,18 @@ Export_ColorInfo(ColorInfo *ci, VALUE st)
249
284
  }
250
285
 
251
286
 
252
- /*
253
- Extern: Color_to_MagickPixelPacket
254
- Purpose: Convert either a String color name or
255
- a Magick::Pixel to a MagickPixelPacket
256
- Notes: The channel values in a MagickPixelPacket are doubles.
257
- */
287
+ /**
288
+ * Convert either a String color name or a Magick::Pixel to a MagickPixelPacket.
289
+ *
290
+ * No Ruby usage (internal function)
291
+ *
292
+ * Notes:
293
+ * - The channel values in a MagickPixelPacket are doubles.
294
+ *
295
+ * @param image the Image
296
+ * @param mpp The MagickPixelPacket to modify
297
+ * @param color the name of the color
298
+ */
258
299
  void
259
300
  Color_to_MagickPixelPacket(Image *image, MagickPixelPacket *mpp, VALUE color)
260
301
  {
@@ -272,10 +313,14 @@ Color_to_MagickPixelPacket(Image *image, MagickPixelPacket *mpp, VALUE color)
272
313
  }
273
314
 
274
315
 
275
- /*
276
- Static: destroy_ColorInfo
277
- Purpose: free the storage allocated by Export_ColorInfo, above.
278
- */
316
+ /**
317
+ * Free the storage allocated by Export_ColorInfo.
318
+ *
319
+ * No Ruby usage (internal function)
320
+ *
321
+ * @param ci the ColorInfo object
322
+ * @see Export_ColorInfo
323
+ */
279
324
  static void
280
325
  destroy_ColorInfo(ColorInfo *ci)
281
326
  {
@@ -284,10 +329,15 @@ destroy_ColorInfo(ColorInfo *ci)
284
329
  }
285
330
 
286
331
 
287
- /*
288
- Method: Color#to_s
289
- Purpose: Return a string representation of a Magick::Color object
290
- */
332
+ /**
333
+ * Return a string representation of a Magick::Color object.
334
+ *
335
+ * Ruby usage:
336
+ * - @verbatim Color#to_s @endverbatim
337
+ *
338
+ * @param self this object
339
+ * @return the string
340
+ */
291
341
  VALUE
292
342
  Color_to_s(VALUE self)
293
343
  {
@@ -311,13 +361,19 @@ Color_to_s(VALUE self)
311
361
  }
312
362
 
313
363
 
314
- /*
315
- Static: ComplianceType_name
316
- Purpose: Return the string representation of a ComplianceType value
317
- Notes: xMagick will OR multiple compliance types so we have to
318
- arbitrarily pick one name. Set the compliance argument
319
- to the selected value.
320
- */
364
+ /**
365
+ * Return the string representation of a ComplianceType value.
366
+ *
367
+ * No Ruby usage (internal function)
368
+ *
369
+ * Notes:
370
+ * - xMagick will OR multiple compliance types so we have to arbitrarily pick
371
+ * one name.
372
+ * - Set the compliance argument to the selected value.
373
+ *
374
+ * @param c the ComplianceType value
375
+ * @return the string
376
+ */
321
377
  static const char *
322
378
  ComplianceType_name(ComplianceType *c)
323
379
  {
@@ -354,10 +410,14 @@ ComplianceType_name(ComplianceType *c)
354
410
  }
355
411
 
356
412
 
357
- /*
358
- * Static: ComplianceType_new
359
- Purpose: construct a ComplianceType enum object for the specified value
360
- */
413
+ /**
414
+ * Construct a ComplianceType enum object for the specified value.
415
+ *
416
+ * No Ruby usage (internal function)
417
+ *
418
+ * @param compliance the C ComplianceType value
419
+ * @return the Ruby ComplianceType enum object
420
+ */
361
421
  static VALUE
362
422
  ComplianceType_new(ComplianceType compliance)
363
423
  {
@@ -370,10 +430,14 @@ ComplianceType_new(ComplianceType compliance)
370
430
  }
371
431
 
372
432
 
373
- /*
374
- External: Import_TypeInfo
375
- Purpose: Convert a TypeInfo structure to a Magick::Font
376
- */
433
+ /**
434
+ * Convert a TypeInfo structure to a Magick::Font.
435
+ *
436
+ * No Ruby usage (internal function)
437
+ *
438
+ * @param ti the C TypeInfo structure
439
+ * @return a Ruby Magick::Font object
440
+ */
377
441
  VALUE
378
442
  Import_TypeInfo(const TypeInfo *ti)
379
443
  {
@@ -397,10 +461,14 @@ Import_TypeInfo(const TypeInfo *ti)
397
461
  }
398
462
 
399
463
 
400
- /*
401
- External: Export_TypeInfo
402
- Purpose: Convert a Magick::Font to a TypeInfo structure
403
- */
464
+ /**
465
+ * Convert a Magick::Font to a TypeInfo structure.
466
+ *
467
+ * No Ruby usage (internal function)
468
+ *
469
+ * @param ti the C TypeInfo structure to modify
470
+ * @param st the Ruby Magick::Font object
471
+ */
404
472
  void
405
473
  Export_TypeInfo(TypeInfo *ti, VALUE st)
406
474
  {
@@ -446,10 +514,14 @@ Export_TypeInfo(TypeInfo *ti, VALUE st)
446
514
  }
447
515
 
448
516
 
449
- /*
450
- Static: destroy_TypeInfo
451
- Purpose: free the storage allocated by Export_TypeInfo, above.
452
- */
517
+ /**
518
+ * Free the storage allocated by Export_TypeInfo.
519
+ *
520
+ * No Ruby usage (internal function)
521
+ *
522
+ * @param ti the TypeInfo object
523
+ * @see Export_TypeInfo
524
+ */
453
525
  static void
454
526
  destroy_TypeInfo(TypeInfo *ti)
455
527
  {
@@ -468,10 +540,14 @@ destroy_TypeInfo(TypeInfo *ti)
468
540
  }
469
541
 
470
542
 
471
- /*
472
- External: Font_to_s
473
- Purpose: implement the Font#to_s method
474
- */
543
+ /**
544
+ * Implement the Font#to_s method.
545
+ *
546
+ * No Ruby usage (internal function)
547
+ *
548
+ * @param self this object
549
+ * @return the string
550
+ */
475
551
  VALUE
476
552
  Font_to_s(VALUE self)
477
553
  {
@@ -513,10 +589,14 @@ Font_to_s(VALUE self)
513
589
  }
514
590
 
515
591
 
516
- /*
517
- Extern: Import_PointInfo(pp)
518
- Purpose: Create a Magick::Point object from a PointInfo structure.
519
- */
592
+ /**
593
+ * Create a Magick::Point object from a PointInfo structure.
594
+ *
595
+ * No Ruby usage (internal function)
596
+ *
597
+ * @param p the C PointInfo structure
598
+ * @return a Ruby Magick::Point object
599
+ */
520
600
  VALUE
521
601
  Import_PointInfo(PointInfo *p)
522
602
  {
@@ -525,10 +605,14 @@ Import_PointInfo(PointInfo *p)
525
605
  }
526
606
 
527
607
 
528
- /*
529
- Extern: Export_PointInfo
530
- Purpose: Convert a Magick::Point object to a PointInfo structure
531
- */
608
+ /**
609
+ * Convert a Magick::Point object to a PointInfo structure.
610
+ *
611
+ * No Ruby usage (internal function)
612
+ *
613
+ * @param pi the C PointInfo structure to modify
614
+ * @param sp the Ruby Magick::Point object
615
+ */
532
616
  void
533
617
  Export_PointInfo(PointInfo *pi, VALUE sp)
534
618
  {
@@ -547,10 +631,14 @@ Export_PointInfo(PointInfo *pi, VALUE sp)
547
631
  }
548
632
 
549
633
 
550
- /*
551
- Extern: Import_PrimaryInfo(pp)
552
- Purpose: Create a Magick::PrimaryInfo object from a PrimaryInfo structure.
553
- */
634
+ /**
635
+ * Create a Magick::PrimaryInfo object from a PrimaryInfo structure.
636
+ *
637
+ * No Ruby usage (internal function)
638
+ *
639
+ * @param p the C PrimaryInfo structure
640
+ * @return a Ruby Magick::PrimaryInfo object
641
+ */
554
642
  VALUE
555
643
  Import_PrimaryInfo(PrimaryInfo *p)
556
644
  {
@@ -559,10 +647,14 @@ Import_PrimaryInfo(PrimaryInfo *p)
559
647
  }
560
648
 
561
649
 
562
- /*
563
- Extern: Export_PrimaryInfo
564
- Purpose: Convert a Magick::PrimaryInfo object to a PrimaryInfo structure
565
- */
650
+ /**
651
+ * Convert a Magick::PrimaryInfo object to a PrimaryInfo structure.
652
+ *
653
+ * No Ruby usage (internal function)
654
+ *
655
+ * @param pi the C PrimaryInfo structure to modify
656
+ * @param sp the Ruby Magick::PrimaryInfo object
657
+ */
566
658
  void
567
659
  Export_PrimaryInfo(PrimaryInfo *pi, VALUE sp)
568
660
  {
@@ -583,10 +675,15 @@ Export_PrimaryInfo(PrimaryInfo *pi, VALUE sp)
583
675
  }
584
676
 
585
677
 
586
- /*
587
- Method: Magick::PrimaryInfo#to_s
588
- Purpose: Create a string representation of a Magick::PrimaryInfo
589
- */
678
+ /**
679
+ * Create a string representation of a Magick::PrimaryInfo.
680
+ *
681
+ * Ruby usage:
682
+ * - @verbatim Magick::PrimaryInfo#to_s @endverbatim
683
+ *
684
+ * @param self this object
685
+ * @return the string
686
+ */
590
687
  VALUE
591
688
  PrimaryInfo_to_s(VALUE self)
592
689
  {
@@ -599,10 +696,14 @@ PrimaryInfo_to_s(VALUE self)
599
696
  }
600
697
 
601
698
 
602
- /*
603
- External: Import_RectangleInfo
604
- Purpose: Convert a RectangleInfo structure to a Magick::Rectangle
605
- */
699
+ /**
700
+ * Convert a RectangleInfo structure to a Magick::Rectangle.
701
+ *
702
+ * No Ruby usage (internal function)
703
+ *
704
+ * @param rect the C RectangleInfo structure
705
+ * @return a Ruby Magick::Rectangle object
706
+ */
606
707
  VALUE
607
708
  Import_RectangleInfo(RectangleInfo *rect)
608
709
  {
@@ -619,10 +720,14 @@ Import_RectangleInfo(RectangleInfo *rect)
619
720
  }
620
721
 
621
722
 
622
- /*
623
- External: Export_RectangleInfo
624
- Purpose: Convert a Magick::Rectangle to a RectangleInfo structure.
625
- */
723
+ /**
724
+ * Convert a Magick::Rectangle to a RectangleInfo structure.
725
+ *
726
+ * No Ruby usage (internal function)
727
+ *
728
+ * @param rect the C RectangleInfo structure to modify
729
+ * @param sr the Ruby Magick::Rectangle object
730
+ */
626
731
  void
627
732
  Export_RectangleInfo(RectangleInfo *rect, VALUE sr)
628
733
  {
@@ -645,10 +750,15 @@ Export_RectangleInfo(RectangleInfo *rect, VALUE sr)
645
750
  }
646
751
 
647
752
 
648
- /*
649
- Method: Magick::Rectangle#to_s
650
- Purpose: Create a string representation of a Magick::Rectangle
651
- */
753
+ /**
754
+ * Create a string representation of a Magick::Rectangle.
755
+ *
756
+ * Ruby usage:
757
+ * - @verbatim Magick::Rectangle#to_s @endverbatim
758
+ *
759
+ * @param self this object
760
+ * @return the string
761
+ */
652
762
  VALUE
653
763
  RectangleInfo_to_s(VALUE self)
654
764
  {
@@ -662,10 +772,14 @@ RectangleInfo_to_s(VALUE self)
662
772
  }
663
773
 
664
774
 
665
- /*
666
- External: Import_SegmentInfo
667
- Purpose: Convert a SegmentInfo structure to a Magick::Segment
668
- */
775
+ /**
776
+ * Convert a SegmentInfo structure to a Magick::Segment.
777
+ *
778
+ * No Ruby usage (internal function)
779
+ *
780
+ * @param segment the C SegmentInfo structure
781
+ * @return a Ruby Magick::Segment object
782
+ */
669
783
  VALUE
670
784
  Import_SegmentInfo(SegmentInfo *segment)
671
785
  {
@@ -679,10 +793,14 @@ Import_SegmentInfo(SegmentInfo *segment)
679
793
  }
680
794
 
681
795
 
682
- /*
683
- External: Export_SegmentInfo
684
- Purpose: Convert a Magick::Segment to a SegmentInfo structure.
685
- */
796
+ /**
797
+ * Convert a Magick::Segment to a SegmentInfo structure.
798
+ *
799
+ * No Ruby usage (internal function)
800
+ *
801
+ * @param segment the C SegmentInfo structure to modify
802
+ * @param s the Ruby Magick::Segment object
803
+ */
686
804
  void
687
805
  Export_SegmentInfo(SegmentInfo *segment, VALUE s)
688
806
  {
@@ -706,10 +824,15 @@ Export_SegmentInfo(SegmentInfo *segment, VALUE s)
706
824
  }
707
825
 
708
826
 
709
- /*
710
- Method: Magick::SegmentInfo#to_s
711
- Purpose: Create a string representation of a Magick::Segment
712
- */
827
+ /**
828
+ * Create a string representation of a Magick::Segment.
829
+ *
830
+ * Ruby usage:
831
+ * - @verbatim Magick::SegmentInfo#to_s @endverbatim
832
+ *
833
+ * @param self this object
834
+ * @return the string
835
+ */
713
836
  VALUE
714
837
  SegmentInfo_to_s(VALUE self)
715
838
  {
@@ -723,10 +846,14 @@ SegmentInfo_to_s(VALUE self)
723
846
  }
724
847
 
725
848
 
726
- /*
727
- Static: StretchType_name
728
- Purpose: Return the string representation of a StretchType value
729
- */
849
+ /**
850
+ * Return the string representation of a StretchType value.
851
+ *
852
+ * No Ruby usage (internal function)
853
+ *
854
+ * @param stretch the StretchType value
855
+ * @return the string
856
+ */
730
857
  static const char *
731
858
  StretchType_name(StretchType stretch)
732
859
  {
@@ -749,10 +876,14 @@ StretchType_name(StretchType stretch)
749
876
  }
750
877
 
751
878
 
752
- /*
753
- Static: StretchType_new
754
- Purpose: Construct a StretchType enum for a specified StretchType value
755
- */
879
+ /**
880
+ * Construct a StretchType enum for a specified StretchType value.
881
+ *
882
+ * No Ruby usage (internal function)
883
+ *
884
+ * @param stretch the C StretchType value
885
+ * @return a Ruby StretchType enum
886
+ */
756
887
  static VALUE
757
888
  StretchType_new(StretchType stretch)
758
889
  {
@@ -761,10 +892,14 @@ StretchType_new(StretchType stretch)
761
892
  }
762
893
 
763
894
 
764
- /*
765
- Static: StyleType_name
766
- Purpose: Return the string representation of a StyleType value
767
- */
895
+ /**
896
+ * Return the string representation of a StyleType value.
897
+ *
898
+ * No Ruby usage (internal function)
899
+ *
900
+ * @param style the StyleType value
901
+ * @return the string
902
+ */
768
903
  static const char *
769
904
  StyleType_name(StyleType style)
770
905
  {
@@ -781,10 +916,14 @@ StyleType_name(StyleType style)
781
916
  }
782
917
 
783
918
 
784
- /*
785
- Static: StyleType_new
786
- Purpose: Construct a StyleType enum for a specified StyleType value
787
- */
919
+ /**
920
+ * Construct a StyleType enum for a specified StyleType value.
921
+ *
922
+ * No Ruby usage (internal function)
923
+ *
924
+ * @param style the C StyleType value
925
+ * @return a Ruby StyleType enum
926
+ */
788
927
  static VALUE
789
928
  StyleType_new(StyleType style)
790
929
  {
@@ -793,10 +932,14 @@ StyleType_new(StyleType style)
793
932
  }
794
933
 
795
934
 
796
- /*
797
- External: Import_TypeMetric
798
- Purpose: Convert a TypeMetric structure to a Magick::TypeMetric
799
- */
935
+ /**
936
+ * Convert a TypeMetric structure to a Magick::TypeMetric.
937
+ *
938
+ * No Ruby usage (internal function)
939
+ *
940
+ * @param tm the C TypeMetric structure
941
+ * @return a Ruby Magick::TypeMetric object
942
+ */
800
943
  VALUE
801
944
  Import_TypeMetric(TypeMetric *tm)
802
945
  {
@@ -822,10 +965,14 @@ Import_TypeMetric(TypeMetric *tm)
822
965
  }
823
966
 
824
967
 
825
- /*
826
- External: Export_TypeMetric
827
- Purpose: Convert a Magick::TypeMetric to a TypeMetric structure.
828
- */
968
+ /**
969
+ * Convert a Magick::TypeMetric to a TypeMetric structure.
970
+ *
971
+ * No Ruby usage (internal function)
972
+ *
973
+ * @param tm the C TypeMetric structure to modify
974
+ * @param st the Ruby Magick::TypeMetric object
975
+ */
829
976
  void
830
977
  Export_TypeMetric(TypeMetric *tm, VALUE st)
831
978
  {
@@ -863,10 +1010,15 @@ Export_TypeMetric(TypeMetric *tm, VALUE st)
863
1010
  }
864
1011
 
865
1012
 
866
- /*
867
- Method: Magick::TypeMetric#to_s
868
- Purpose: Create a string representation of a Magick::TypeMetric
869
- */
1013
+ /**
1014
+ * Create a string representation of a Magick::TypeMetric.
1015
+ *
1016
+ * Ruby usage:
1017
+ * - @verbatim Magick::TypeMetric#to_s @endverbatim
1018
+ *
1019
+ * @param self this object
1020
+ * @return the string
1021
+ */
870
1022
  VALUE
871
1023
  TypeMetric_to_s(VALUE self)
872
1024
  {