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,10 @@
1
1
  require "mkmf"
2
2
  require "date"
3
3
 
4
- RMAGICK_VERS = "2.12.2"
4
+ RMAGICK_VERS = "2.13.1"
5
5
  MIN_RUBY_VERS = "1.8.5"
6
6
  MIN_RUBY_VERS_NO = MIN_RUBY_VERS.tr(".","").to_i
7
- MIN_IM_VERS = "6.3.5"
7
+ MIN_IM_VERS = "6.4.9"
8
8
  MIN_IM_VERS_NO = MIN_IM_VERS.tr(".","").to_i
9
9
 
10
10
 
@@ -73,6 +73,27 @@ def check_multiple_imagemagick_versions()
73
73
  end
74
74
 
75
75
 
76
+ # Ubuntu (maybe other systems) comes with a partial installation of
77
+ # ImageMagick in the prefix /usr (some libraries, no includes, and no
78
+ # binaries). This causes problems when /usr/lib is in the path (e.g., using
79
+ # the default Ruby installation).
80
+ def check_partial_imagemagick_versions()
81
+ prefix = config_string("prefix")
82
+ matches = [
83
+ prefix+"/lib/lib?agick*",
84
+ prefix+"/include/ImageMagick",
85
+ prefix+"/bin/Magick-config",
86
+ ].map do |file_glob|
87
+ Dir.glob(file_glob)
88
+ end
89
+ matches.delete_if { |arr| arr.empty? }
90
+ if 0 < matches.length and matches.length < 3
91
+ msg = "\nWarning: Found a partial ImageMagick installation. Your operating system likely has some built-in ImageMagick libraries but not all of ImageMagick. This will most likely cause problems at both compile and runtime.\nFound partial installation at: "+prefix+"\n"
92
+ Logging::message msg
93
+ message msg
94
+ end
95
+ end
96
+
76
97
 
77
98
 
78
99
  if RUBY_PLATFORM =~ /mswin/
@@ -115,6 +136,7 @@ if RUBY_PLATFORM !~ /mswin|mingw/
115
136
  end
116
137
 
117
138
  check_multiple_imagemagick_versions()
139
+ check_partial_imagemagick_versions()
118
140
 
119
141
  # Ensure minimum ImageMagick version
120
142
  unless checking_for("ImageMagick version >= #{MIN_IM_VERS}") do
@@ -182,7 +204,7 @@ end
182
204
 
183
205
  if RUBY_PLATFORM !~ /mswin|mingw/
184
206
 
185
- unless have_library("MagickCore", "InitializeMagick", headers) || have_library("Magick", "InitializeMagick", headers)
207
+ unless have_library("MagickCore", "InitializeMagick", headers) || have_library("Magick", "InitializeMagick", headers) || have_library("Magick++","InitializeMagick",headers)
186
208
  exit_failure "Can't install RMagick #{RMAGICK_VERS}. " +
187
209
  "Can't find the ImageMagick library or one of the dependent libraries. " +
188
210
  "Check the mkmf.log file for more detailed information.\n"
@@ -197,6 +219,7 @@ have_func("snprintf", headers)
197
219
  "AutoGammaImageChannel", # 6.5.5-1
198
220
  "AutoLevelImageChannel", # 6.5.5-1
199
221
  "BlueShiftImage", # 6.5.4-3
222
+ "ConstituteComponentTerminus", # 6.5.7-9
200
223
  "DeskewImage", # 6.4.2-5
201
224
  "EncipherImage", # 6.3.8-6
202
225
  "EqualizeImageChannel", # 6.3.6-9
@@ -210,6 +233,7 @@ have_func("snprintf", headers)
210
233
  "LevelColorsImageChannel", # 6.5.6-4
211
234
  "LevelizeImageChannel", # 6.4.2
212
235
  "LiquidRescaleImage", # 6.3.8-2
236
+ "MagickLibAddendum", # 6.5.9-1
213
237
  "OpaquePaintImageChannel", # 6.3.7-10
214
238
  "QueueAuthenticPixels", # 6.4.5-6
215
239
  "RemapImage", # 6.4.4-0
@@ -1,24 +1,34 @@
1
- /* $Id: rmagick.c,v 1.3 2009/02/28 23:50:35 rmagick Exp $ */
2
- /*============================================================================\
3
- | Copyright (C) 2009 by Timothy P. Hunter
4
- | Name: rmagick.c
5
- | Author: Tim Hunter
6
- | Purpose: Contains Magick module methods.
7
- \============================================================================*/
8
-
1
+ /**************************************************************************//**
2
+ * Contains Magick module methods.
3
+ *
4
+ * Copyright &copy; 2002 - 2009 by Timothy P. Hunter
5
+ *
6
+ * Changes since Nov. 2009 copyright &copy; by Benjamin Thomas and Omer Bar-or
7
+ *
8
+ * @file rmagick.c
9
+ * @version $Id: rmagick.c,v 1.4 2009/12/20 02:33:32 baror Exp $
10
+ * @author Tim Hunter
11
+ ******************************************************************************/
9
12
 
10
13
  #include "rmagick.h"
11
14
 
12
15
 
13
16
 
14
17
 
15
- /*
16
- Method: Magick::colors [ { |colorinfo| } ]
17
- Purpose: If called with the optional block, iterates over the colors,
18
- otherwise returns an array of Magick::Color objects
19
- Notes: There are 3 implementations
20
-
21
- */
18
+ /**
19
+ * If called with the optional block, iterates over the colors, otherwise
20
+ * returns an array of Magick::Color objects.
21
+ *
22
+ * Ruby usage:
23
+ * - @verbatim Magick::colors @endverbatim
24
+ * - @verbatim Magick::colors { |colorinfo| } @endverbatim
25
+ *
26
+ * Notes:
27
+ * - There are 3 implementations.
28
+ *
29
+ * @param class the class on which the method is run.
30
+ * @return either the input class (if a block was given) or the array of colors.
31
+ */
22
32
  VALUE
23
33
  Magick_colors(VALUE class)
24
34
  {
@@ -57,11 +67,17 @@ Magick_colors(VALUE class)
57
67
  }
58
68
 
59
69
 
60
- /*
61
- Method: Magick::fonts [ { |fontinfo| } ]
62
- Purpose: If called with the optional block, iterates over the fonts,
63
- otherwise returns an array of Magick::Font objects
64
- */
70
+ /**
71
+ * If called with the optional block, iterates over the fonts, otherwise returns
72
+ * an array of Magick::Font objects.
73
+ *
74
+ * Ruby usage:
75
+ * - @verbatim Magick::fonts @endverbatim
76
+ * - @verbatim Magick::fonts { |fontinfo| } @endverbatim
77
+ *
78
+ * @param class the class on which the method is run.
79
+ * @return either the input class (if a block was given) or the array of fonts.
80
+ */
65
81
  VALUE
66
82
  Magick_fonts(VALUE class)
67
83
  {
@@ -98,22 +114,20 @@ Magick_fonts(VALUE class)
98
114
  }
99
115
 
100
116
 
101
- /*
102
- Method: Magick.init_formats
103
- Purpose: Build the @@formats hash
104
-
105
- The hash keys are image formats. The hash values
106
- specify the format "mode string", i.e. a description of what
107
- ImageMagick can do with that format. The mode string is in the
108
- form "BRWA", where
109
- "B" is "*" if the format has native blob support, or " " otherwise.
110
- "R" is "r" if ImageMagick can read that format, or "-" otherwise.
111
- "W" is "w" if ImageMagick can write that format, or "-" otherwise.
112
- "A" is "+" if the format supports multi-image files, or "-" otherwise.
113
- Notes: Only called once.
114
- There are 3 implementations.
115
- */
116
-
117
+ /**
118
+ * Build the @@formats hash. The hash keys are image formats. The hash values
119
+ * specify the format "mode string", i.e. a description of what ImageMagick can
120
+ * do with that format. The mode string is in the form "BRWA", where
121
+ * - "B" is "*" if the format has native blob support, or " " otherwise.
122
+ * - "R" is "r" if ImageMagick can read that format, or "-" otherwise.
123
+ * - "W" is "w" if ImageMagick can write that format, or "-" otherwise.
124
+ * - "A" is "+" if the format supports multi-image files, or "-" otherwise.
125
+ *
126
+ * No Ruby usage (internal function)
127
+ *
128
+ * @param magick_info a MagickInfo object.
129
+ * @return the formats hash.
130
+ */
117
131
  static VALUE
118
132
  MagickInfo_to_format(const MagickInfo *magick_info)
119
133
  {
@@ -128,6 +142,26 @@ MagickInfo_to_format(const MagickInfo *magick_info)
128
142
  }
129
143
 
130
144
 
145
+ /**
146
+ * Build the @@formats hash. The hash keys are image formats. The hash values
147
+ * specify the format "mode string", i.e. a description of what ImageMagick can
148
+ * do with that format. The mode string is in the form "BRWA", where
149
+ * - "B" is "*" if the format has native blob support, or " " otherwise.
150
+ * - "R" is "r" if ImageMagick can read that format, or "-" otherwise.
151
+ * - "W" is "w" if ImageMagick can write that format, or "-" otherwise.
152
+ * - "A" is "+" if the format supports multi-image files, or "-" otherwise.
153
+ *
154
+ * Ruby usage:
155
+ * - @verbatim Magick.init_formats @endverbatim
156
+ *
157
+ * Notes:
158
+ * - Only called once.
159
+ * - There are 3 implementations.
160
+ *
161
+ * @param class the class on which the method is run.
162
+ * @return the formats hash.
163
+ * @see MagickInfo_to_format
164
+ */
131
165
  VALUE
132
166
  Magick_init_formats(VALUE class)
133
167
  {
@@ -156,11 +190,19 @@ Magick_init_formats(VALUE class)
156
190
  }
157
191
 
158
192
 
159
- /*
160
- Method: Magick.limit_resource(resource[, limit])
161
- Purpose: Get/set resource limits. If a limit is specified the old limit
162
- is set to the new value. Either way the current/old limit is returned.
163
- */
193
+ /**
194
+ * Get/set resource limits. If a limit is specified the old limit is set to the
195
+ * new value. Either way the current/old limit is returned.
196
+ *
197
+ * Ruby usage:
198
+ * - @verbatim Magick.limit_resource(resource) @endverbatim
199
+ * - @verbatim Magick.limit_resource(resource, limit) @endverbatim
200
+ *
201
+ * @param argc number of input arguments.
202
+ * @param argv array of input arguments.
203
+ * @param class the class on which the method is run.
204
+ * @return the current/old limit.
205
+ */
164
206
  VALUE
165
207
  Magick_limit_resource(int argc, VALUE *argv, VALUE class)
166
208
  {
@@ -249,13 +291,21 @@ Magick_limit_resource(int argc, VALUE *argv, VALUE class)
249
291
  }
250
292
 
251
293
 
252
- /*
253
- Method Magick.set_cache_threshold(megabytes)
254
- Purpose: sets the amount of free memory allocated for the
255
- pixel cache. Once this threshold is exceeded, all
256
- subsequent pixels cache operations are to/from disk.
257
- Notes: singleton method
258
- */
294
+ /**
295
+ * Set the amount of free memory allocated for the pixel cache. Once this
296
+ * threshold is exceeded, all subsequent pixels cache operations are to/from
297
+ * disk.
298
+ *
299
+ * Ruby usage:
300
+ * - @verbatim Magick.set_cache_threshold(megabytes) @endverbatim
301
+ *
302
+ * Notes:
303
+ * - singleton method
304
+ *
305
+ * @param class the class on which the method is run.
306
+ * @param threshold the number of megabytes to set.
307
+ * @return the class.
308
+ */
259
309
  VALUE
260
310
  Magick_set_cache_threshold(VALUE class, VALUE threshold)
261
311
  {
@@ -266,13 +316,36 @@ Magick_set_cache_threshold(VALUE class, VALUE threshold)
266
316
  }
267
317
 
268
318
 
269
- /*
270
- Method: Magick.set_log_event_mask(event,...) -> Magick
271
- Notes: "event" is one of "all", "annotate", "blob", "cache",
272
- "coder", "configure", "deprecate", "locale", "none",
273
- "render", "transform", "user", "x11". Multiple events
274
- can be specified. Event names may be capitalized.
275
- */
319
+ /**
320
+ * Set the log event mask.
321
+ *
322
+ * Ruby usage:
323
+ * - @verbatim Magick.set_log_event_mask(event) @endverbatim
324
+ * - @verbatim Magick.set_log_event_mask(event,...) @endverbatim
325
+ *
326
+ * Notes:
327
+ * - "event" is one of
328
+ * - "all"
329
+ * - "annotate"
330
+ * - "blob"
331
+ * - "cache"
332
+ * - "coder"
333
+ * - "configure"
334
+ * - "deprecate"
335
+ * - "locale"
336
+ * - "none"
337
+ * - "render"
338
+ * - "transform"
339
+ * - "user"
340
+ * - "x11"
341
+ * - Multiple events can be specified.
342
+ * - Event names may be capitalized.
343
+ *
344
+ * @param argc number of input arguments.
345
+ * @param argv array of input arguments.
346
+ * @param class the class on which the method is run.
347
+ * @return the class.
348
+ */
276
349
  VALUE
277
350
  Magick_set_log_event_mask(int argc, VALUE *argv, VALUE class)
278
351
  {
@@ -289,20 +362,29 @@ Magick_set_log_event_mask(int argc, VALUE *argv, VALUE class)
289
362
  return class;
290
363
  }
291
364
 
292
- /*
293
- Method: Magick.set_log_format(format) -> Magick
294
- Notes: Format is a string containing one or more of:
295
- %t - current time
296
- %r - elapsed time
297
- %u - user time
298
- %p - pid
299
- %m - module (source file name)
300
- %f - function name
301
- %l - line number
302
- %d - event domain (one of the events listed above)
303
- %e - event name
304
- Plus other characters, including \n, etc.
305
- */
365
+ /**
366
+ * Set the format for log messages.
367
+ *
368
+ * Ruby usage:
369
+ * - @verbatim Magick.set_log_format(format) @endverbatim
370
+ *
371
+ * Notes:
372
+ * - Format is a string containing one or more of:
373
+ * - %t - current time
374
+ * - %r - elapsed time
375
+ * - %u - user time
376
+ * - %p - pid
377
+ * - %m - module (source file name)
378
+ * - %f - function name
379
+ * - %l - line number
380
+ * - %d - event domain (one of the events listed above)
381
+ * - %e - event name
382
+ * - Plus other characters, including \\n, etc.
383
+ *
384
+ * @param class the class on which the method is run.
385
+ * @param format the format to set.
386
+ * @return the class.
387
+ */
306
388
  VALUE
307
389
  Magick_set_log_format(VALUE class, VALUE format)
308
390
  {
@@ -1,15 +1,19 @@
1
- /* $Id: rmagick.h,v 1.278 2009/09/15 22:09:44 rmagick Exp $ */
2
- /*=============================================================================
3
- | Copyright (C) 2009 by Timothy P. Hunter
4
- | Name: rmagick.h
5
- | Purpose: RMagick declarations and definitions
6
- | Author: Tim Hunter
7
- \============================================================================*/
1
+ /**************************************************************************//**
2
+ * RMagick declarations and definitions.
3
+ *
4
+ * Copyright &copy; 2002 - 2009 by Timothy P. Hunter
5
+ *
6
+ * Changes since Nov. 2009 copyright &copy; by Benjamin Thomas and Omer Bar-or
7
+ *
8
+ * @file rmagick.h
9
+ * @version $Id: rmagick.h,v 1.282 2010/02/16 06:50:28 baror Exp $
10
+ * @author Tim Hunter
11
+ ******************************************************************************/
8
12
 
9
13
  #ifndef _RMAGICK_H_
10
14
  #define _RMAGICK_H_
11
15
 
12
- // Suppress warnings about deprecated functions on Windows
16
+ //! Suppress warnings about deprecated functions on Windows
13
17
  #define _CRT_SECURE_NO_DEPRECATE 1
14
18
 
15
19
  #include <assert.h>
@@ -41,6 +45,7 @@
41
45
  #undef WORDS_BIGENDIAN
42
46
 
43
47
  #include "magick/MagickCore.h"
48
+ #include "magick/magick-config.h"
44
49
 
45
50
  // Undef ImageMagick's versions of these symbols
46
51
  #undef PACKAGE_STRING
@@ -49,12 +54,13 @@
49
54
  #include "extconf.h"
50
55
 
51
56
 
52
- // For quoting preprocessor symbols
57
+ //! For quoting preprocessor symbols
53
58
  #define Q2(q) #q
59
+ //! For quoting preprocessor symbols
54
60
  #define Q(q) Q2(q)
55
61
 
56
62
 
57
- // Trace new image creation in bang methods
63
+ //! Trace new image creation in bang methods
58
64
  #define UPDATE_DATA_PTR(_obj_, _new_) \
59
65
  do { (void) rm_trace_creation(_new_);\
60
66
  DATA_PTR(_obj_) = (void *)(_new_);\
@@ -63,76 +69,85 @@
63
69
 
64
70
  // Handle Quantum <-> Ruby Numeric object conversion
65
71
  #if (QuantumDepth == 8 || QuantumDepth == 16)
66
- #define QUANTUM2NUM(q) INT2FIX((q))
67
- #define NUM2QUANTUM(n) (Quantum)NUM2UINT((n))
72
+ #define QUANTUM2NUM(q) INT2FIX((q)) /**< Quantum -> Ruby Numeric conversion */
73
+ #define NUM2QUANTUM(n) (Quantum)NUM2UINT((n)) /**< Quantum <- Ruby Numeric conversion */
68
74
  #elif (QuantumDepth == 32)
69
- #define QUANTUM2NUM(q) UINT2NUM((q))
70
- #define NUM2QUANTUM(n) (Quantum)NUM2UINT((n))
75
+ #define QUANTUM2NUM(q) UINT2NUM((q)) /**< Quantum -> Ruby Numeric conversion */
76
+ #define NUM2QUANTUM(n) (Quantum)NUM2UINT((n)) /**< Quntum <- Ruby Numeric conversion */
71
77
  #elif (QuantumDepth == 64)
72
- #define QUANTUM2NUM(q) ULL2NUM((q))
73
- #define NUM2QUANTUM(n) (Quantum)NUM2ULL((n))
78
+ #define QUANTUM2NUM(q) ULL2NUM((q)) /**< Quantum -> Ruby Numeric conversion */
79
+ #define NUM2QUANTUM(n) (Quantum)NUM2ULL((n)) /**< Quntum <- Ruby Numeric conversion */
74
80
  #else
75
81
  #error Specified QuantumDepth is not supported.
76
82
  #endif
77
- // Convert user-supplied objects to Quantum
83
+ //! Convert user-supplied objects to Quantum
78
84
  #define APP2QUANTUM(n) rm_app2quantum((n))
79
85
 
86
+ //! degrees to radians conversion
80
87
  #undef DegreesToRadians // defined in ImageMagick.h in 6.0.2
81
- #define DegreesToRadians(x) ((x)*3.14159265358979323846/180.0)
88
+ #define DegreesToRadians(x) ((x)*3.14159265358979323846/180.0)
82
89
 
83
- #define PIXEL_INTENSITY(q) \
84
- ((Quantum)(0.299*(q)->red + 0.587*(q)->green + 0.114*(q)->blue + 0.5))
90
+ //! pixel intensity calculation
91
+ #define PIXEL_INTENSITY(q) ((Quantum)(0.299*(q)->red + 0.587*(q)->green + 0.114*(q)->blue + 0.5))
85
92
 
93
+ //! find maximum of longs
86
94
  #define LMAX(a,b) ((((long)(a))>((long)(b)))?((long)(a)):((long)(b)))
95
+ //! find maximum of floats
87
96
  #define FMAX(a,b) ((((double)(a))>((double)(b)))?((double)(a)):((double)(b)))
97
+ //! find minimum of floats
88
98
  #define FMIN(a,b) ((((double)(a))<=((double)(b)))?((double)(a)):((double)(b)))
89
- #define RMAGICK_PI 3.14159265358979
99
+
100
+ #define RMAGICK_PI 3.14159265358979 /**< pi */
101
+
102
+ //! round to Quantum
90
103
  #define ROUND_TO_QUANTUM(value) ((Quantum) ((value) > (Quantum)QuantumRange ? QuantumRange : (value) + 0.5))
91
104
 
92
105
 
93
106
  // Ruby 1.9.0 changed the name to rb_frame_this_func
94
107
  #if defined(HAVE_RB_FRAME_THIS_FUNC)
95
- #define THIS_FUNC() rb_frame_this_func()
108
+ #define THIS_FUNC() rb_frame_this_func() /**< get the Ruby function being called */
96
109
  #else
97
- #define THIS_FUNC() rb_frame_last_func()
110
+ #define THIS_FUNC() rb_frame_last_func() /**< get the Ruby function being called */
98
111
  #endif
99
112
 
100
113
  // GetReadFile doesn't exist in Ruby 1.9.0
101
114
  #if !defined(GetReadFile)
102
- #define GetReadFile(fptr) rb_io_stdio_file(fptr)
103
- #define GetWriteFile(fptr) rb_io_stdio_file(fptr)
115
+ #define GetReadFile(fptr) rb_io_stdio_file(fptr) /**< Ruby read file pointer */
116
+ #define GetWriteFile(fptr) rb_io_stdio_file(fptr) /**< Ruby write file pointer */
104
117
  #endif
105
118
 
106
119
  // rb_io_t replaces OpenFile in Ruby 1.9.0
107
120
  #if defined(HAVE_RB_IO_T)
108
121
  #undef OpenFile
109
- #define OpenFile rb_io_t
122
+ #define OpenFile rb_io_t /**< Ruby open file */
110
123
  #endif
111
124
 
112
125
  // These macros are required in 1.9.1 but aren't defined prior to 1.8.6.
113
126
  #if !defined(RSTRING_LEN)
114
- #define RSTRING_LEN(s) (RSTRING((s))->len)
127
+ #define RSTRING_LEN(s) (RSTRING((s))->len) /**< Ruby string length */
115
128
  #endif
116
129
  #if !defined(RSTRING_PTR)
117
- #define RSTRING_PTR(s) (RSTRING((s))->ptr)
130
+ #define RSTRING_PTR(s) (RSTRING((s))->ptr) /**< Ruby string pointer */
118
131
  #endif
119
132
 
120
133
  // Backport these two macros to 1.8
121
134
  #if !defined(RARRAY_LEN)
122
- #define RARRAY_LEN(a) RARRAY((a))->len
135
+ #define RARRAY_LEN(a) RARRAY((a))->len /**< Ruby array length */
123
136
  #endif
124
137
  // Matz says this macro is read-only! (see http://www.ruby-forum.com/topic/146072)
125
138
  #if !defined(RARRAY_PTR)
126
- #define RARRAY_PTR(a) RARRAY((a))->ptr
139
+ #define RARRAY_PTR(a) RARRAY((a))->ptr /**< Ruby array pointer */
127
140
  #endif
128
141
 
129
142
 
130
- // Convert a C string to a Ruby symbol. Used in marshal_dump/marshal_load methods
143
+ //! Convert a C string to a Ruby symbol. Used in marshal_dump/marshal_load methods
131
144
  #define CSTR2SYM(s) ID2SYM(rb_intern(s))
132
- // Convert a C string to a Ruby String, or nil if the ptr is NULL
145
+ //! Convert a C string to a Ruby String, or nil if the ptr is NULL
133
146
  #define MAGICK_STRING_TO_OBJ(f) (f) ? rb_str_new2(f) : Qnil
134
- // Copy the C string in a Ruby String object to ImageMagick memory, or set
135
- // the pointer to NULL if the object is nil.
147
+ /**
148
+ * Copy the C string in a Ruby String object to ImageMagick memory, or set the
149
+ * pointer to NULL if the object is nil.
150
+ */
136
151
  #define OBJ_TO_MAGICK_STRING(f, obj) \
137
152
  if ((obj) != Qnil)\
138
153
  magick_clone_string(&f, RSTRING_PTR(obj));\
@@ -140,167 +155,190 @@
140
155
  f = NULL;
141
156
 
142
157
 
143
- // IM 6.4.1 replaced AllocateImage with AcquireImage.
144
- // Both have the same signature.
158
+ /** ImageMagick 6.5.7 replaced DestroyConstitute with
159
+ * ConstituteComponentTerminus. Both have the same signature.
160
+ */
161
+ #if defined(HAVE_CONSTITUTECOMPONENTTERMINUS)
162
+ #define DestroyConstitute(void) ConstituteComponentTerminus(void)
163
+ #endif
164
+
165
+ /** ImageMagick 6.5.9 replaced MagickLibSubversion with
166
+ * MagickLibAddendum.
167
+ */
168
+ #if defined(HAVE_MAGICKLIBADDENDUM)
169
+ #define MagickLibSubversion MagickLibAddendum
170
+ #endif
171
+
172
+ /** IM 6.4.1 replaced AllocateImage with AcquireImage.
173
+ * Both have the same signature.
174
+ */
145
175
  #if !defined(HAVE_ACQUIREIMAGE)
146
176
  #define AcquireImage(info) AllocateImage(info)
147
177
  #endif
148
178
 
149
179
  // ImageLayerMethod replaced MagickLayerMethod starting with 6.3.6
150
180
  #if defined(HAVE_TYPE_IMAGELAYERMETHOD)
151
- #define LAYERMETHODTYPE ImageLayerMethod
152
- #define CLASS_LAYERMETHODTYPE Class_ImageLayerMethod
153
- #define LAYERMETHODTYPE_NAME ImageLayerMethod_name
154
- #define LAYERMETHODTYPE_NEW ImageLayerMethod_new
181
+ #define LAYERMETHODTYPE ImageLayerMethod /**< layer method */
182
+ #define CLASS_LAYERMETHODTYPE Class_ImageLayerMethod /**< layer method class */
183
+ #define LAYERMETHODTYPE_NAME ImageLayerMethod_name /**< layer method name */
184
+ #define LAYERMETHODTYPE_NEW ImageLayerMethod_new /**< new layer method */
155
185
  #else
156
- #define LAYERMETHODTYPE MagickLayerMethod
157
- #define CLASS_LAYERMETHODTYPE Class_MagickLayerMethod
158
- #define LAYERMETHODTYPE_NAME MagickLayerMethod_name
159
- #define LAYERMETHODTYPE_NEW MagickLayerMethod_new
186
+ #define LAYERMETHODTYPE MagickLayerMethod /**< layer method */
187
+ #define CLASS_LAYERMETHODTYPE Class_MagickLayerMethod /**< layer method class */
188
+ #define LAYERMETHODTYPE_NAME MagickLayerMethod_name /**< layer method name */
189
+ #define LAYERMETHODTYPE_NEW MagickLayerMethod_new /**< new layer method */
160
190
  #endif
161
191
 
162
192
 
163
- typedef ImageInfo Info; // Make type name match class name
164
- typedef PixelPacket Pixel;
193
+ typedef ImageInfo Info; /**< Make type name match class name */
194
+ typedef PixelPacket Pixel; /**< Make type name match class name */
165
195
 
166
- // Montage
196
+ //! Montage
167
197
  typedef struct
168
198
  {
169
- CompositeOperator compose;
170
- MontageInfo *info;
199
+ CompositeOperator compose; /**< compose operator */
200
+ MontageInfo *info; /**< montage info */
171
201
  } Montage;
172
202
 
173
203
  // Draw
204
+ //! tmp filename linked list
174
205
  struct TmpFile_Name
175
206
  {
176
- struct TmpFile_Name *next;
177
- char name[1];
207
+ struct TmpFile_Name *next; /**< the next tmp filename */
208
+ char name[1]; /**< expandable char array for this filename */
178
209
  };
179
210
 
211
+ //! Draw class.
180
212
  typedef struct
181
213
  {
182
- DrawInfo *info; // the DrawInfo struct
183
- VALUE primitives; // the primitive string
184
- struct TmpFile_Name *tmpfile_ary;
185
- PixelPacket shadow_color; // PolaroidOptions#shadow_color
214
+ DrawInfo *info; /**< the DrawInfo struct */
215
+ VALUE primitives; /**< the primitive string */
216
+ struct TmpFile_Name *tmpfile_ary; /**< the tmp filenames */
217
+ PixelPacket shadow_color; /**< PolaroidOptions#shadow_color */
186
218
  } Draw; // make the type match the class name
187
219
 
188
220
  // Enum
221
+ //! enumerator over Magick ids
189
222
  typedef struct
190
223
  {
191
- ID id;
192
- int val;
224
+ ID id; /**< the Magick id */
225
+ int val; /**< its value */
193
226
  } MagickEnum;
194
227
 
195
228
  #undef False // defined in deprecate.h in 6.0.2
196
229
  #undef True // defined in deprecate.h in 6.0.2
230
+ //! generic boolean
197
231
  typedef enum
198
232
  {
199
- False = 0,
200
- True = 1
233
+ False = 0, /**< false */
234
+ True = 1 /**< true */
201
235
  } rm_boolean;
202
236
 
237
+ //! enumerator over weight types
203
238
  typedef enum {
204
- AnyWeight,
205
- NormalWeight,
206
- BoldWeight,
207
- BolderWeight,
208
- LighterWeight
239
+ AnyWeight, /**< any */
240
+ NormalWeight, /**< normal */
241
+ BoldWeight, /**< bold */
242
+ BolderWeight, /**< bolder */
243
+ LighterWeight /**< lighter */
209
244
  } WeightType;
210
245
 
211
- // Draw#text_anchor AnchorType argument
246
+ //! Draw#text_anchor AnchorType argument
212
247
  typedef enum {
213
- StartAnchor = 1,
214
- MiddleAnchor = 2,
215
- EndAnchor = 3
248
+ StartAnchor = 1, /**< start */
249
+ MiddleAnchor = 2, /**< midle */
250
+ EndAnchor = 3 /**< end */
216
251
  } AnchorType;
217
252
 
218
253
 
254
+ //! dumped image
219
255
  typedef struct
220
256
  {
221
- unsigned char id; // Dumped image id = 0xd1
222
- unsigned char mj; // Major format number = 1
223
- unsigned char mi; // Minor format number = 0
224
- unsigned char len; // Length of image magick string
225
- char magick[MaxTextExtent]; // magick string
257
+ unsigned char id; /**< Dumped image id = 0xd1 */
258
+ unsigned char mj; /**< Major format number = 1 */
259
+ unsigned char mi; /**< Minor format number = 0 */
260
+ unsigned char len; /**< Length of image magick string */
261
+ char magick[MaxTextExtent]; /**< magick string */
226
262
  } DumpedImage;
227
263
 
228
- #define DUMPED_IMAGE_ID 0xd1
229
- #define DUMPED_IMAGE_MAJOR_VERS 1
230
- #define DUMPED_IMAGE_MINOR_VERS 0
264
+ #define DUMPED_IMAGE_ID 0xd1 /**< ID of Dumped image id */
265
+ #define DUMPED_IMAGE_MAJOR_VERS 1 /**< Dumped image major version */
266
+ #define DUMPED_IMAGE_MINOR_VERS 0 /**< Dumped image minor version */
231
267
 
232
- #define MAGICK_LOC "magick_location" // instance variable name in ImageMagickError class
268
+ #define MAGICK_LOC "magick_location" /**< instance variable name in ImageMagickError class */
233
269
 
234
- #define MAX_GEOM_STR 51 // max length of a geometry string
270
+ #define MAX_GEOM_STR 51 /**< max length of a geometry string */
235
271
 
236
- /*
272
+ //! Quantum expression adapter.
273
+ /**
237
274
  * Both ImageMagick and GraphicsMagick define an enum type for quantum-level
238
275
  * expressions, but they're different types. The QuantumExpressionOperator
239
276
  * type is an adapter type that can be mapped to either one.
240
- */
277
+ */
241
278
  typedef enum _QuantumExpressionOperator
242
279
  {
243
- UndefinedQuantumOperator,
244
- AddQuantumOperator,
245
- AndQuantumOperator,
246
- DivideQuantumOperator,
247
- LShiftQuantumOperator,
248
- MaxQuantumOperator,
249
- MinQuantumOperator,
250
- MultiplyQuantumOperator,
251
- OrQuantumOperator,
252
- RShiftQuantumOperator,
253
- SubtractQuantumOperator,
254
- XorQuantumOperator,
280
+ UndefinedQuantumOperator, /**< undefined */
281
+ AddQuantumOperator, /**< add */
282
+ AndQuantumOperator, /**< and */
283
+ DivideQuantumOperator, /**< divide */
284
+ LShiftQuantumOperator, /**< lshift */
285
+ MaxQuantumOperator, /**< max */
286
+ MinQuantumOperator, /**< min */
287
+ MultiplyQuantumOperator, /**< multiply */
288
+ OrQuantumOperator, /**< or */
289
+ RShiftQuantumOperator, /**< rshift */
290
+ SubtractQuantumOperator, /**< subtract */
291
+ XorQuantumOperator, /**< xor */
255
292
  #if defined(HAVE_ENUM_POWEVALUATEOPERATOR)
256
- PowQuantumOperator,
293
+ PowQuantumOperator, /**< pow */
257
294
  #endif
258
295
  #if defined(HAVE_ENUM_LOGEVALUATEOPERATOR)
259
- LogQuantumOperator,
296
+ LogQuantumOperator, /**< log */
260
297
  #endif
261
298
  #if defined(HAVE_ENUM_THRESHOLDEVALUATEOPERATOR)
262
- ThresholdQuantumOperator,
299
+ ThresholdQuantumOperator, /**< threshold */
263
300
  #endif
264
301
  #if defined(HAVE_ENUM_THRESHOLDBLACKEVALUATEOPERATOR)
265
- ThresholdBlackQuantumOperator,
302
+ ThresholdBlackQuantumOperator, /**< threshold black */
266
303
  #endif
267
304
  #if defined(HAVE_ENUM_THRESHOLDWHITEEVALUATEOPERATOR)
268
- ThresholdWhiteQuantumOperator,
305
+ ThresholdWhiteQuantumOperator, /**< threshold white */
269
306
  #endif
270
307
  #if defined(HAVE_ENUM_GAUSSIANNOISEEVALUATEOPERATOR)
271
- GaussianNoiseQuantumOperator,
308
+ GaussianNoiseQuantumOperator, /**< gaussian noise */
272
309
  #endif
273
310
  #if defined(HAVE_ENUM_IMPULSENOISEEVALUATEOPERATOR)
274
- ImpulseNoiseQuantumOperator,
311
+ ImpulseNoiseQuantumOperator, /**< impulse noise */
275
312
  #endif
276
313
  #if defined(HAVE_ENUM_LAPLACIANNOISEEVALUATEOPERATOR)
277
- LaplacianNoiseQuantumOperator,
314
+ LaplacianNoiseQuantumOperator, /**< laplacian noise */
278
315
  #endif
279
316
  #if defined(HAVE_ENUM_MULTIPLICATIVENOISEEVALUATEOPERATOR)
280
- MultiplicativeNoiseQuantumOperator,
317
+ MultiplicativeNoiseQuantumOperator, /**< multiplicative noise */
281
318
  #endif
282
319
  #if defined(HAVE_ENUM_POISSONNOISEEVALUATEOPERATOR)
283
- PoissonNoiseQuantumOperator,
320
+ PoissonNoiseQuantumOperator, /**< poisson noise */
284
321
  #endif
285
322
  #if defined(HAVE_ENUM_UNIFORMNOISEEVALUATEOPERATOR)
286
- UniformNoiseQuantumOperator,
323
+ UniformNoiseQuantumOperator, /**< uniform noise */
287
324
  #endif
288
325
  #if defined(HAVE_ENUM_COSINEEVALUATEOPERATOR)
289
- CosineQuantumOperator,
326
+ CosineQuantumOperator, /**< cosine */
290
327
  #endif
291
328
  #if defined(HAVE_ENUM_SINEEVALUATEOPERATOR)
292
- SineQuantumOperator,
329
+ SineQuantumOperator, /**< sine */
293
330
  #endif
294
331
  #if defined(HAVE_ENUM_ADDMODULUSEVALUATEOPERATOR)
295
- AddModulusQuantumOperator
332
+ AddModulusQuantumOperator /**< add modulus */
296
333
  #endif
297
334
  } QuantumExpressionOperator ;
298
335
 
299
336
 
300
- // This implements the "omitted storage class model" for external variables.
301
- // (Ref: Harbison & Steele.) The rmmain.c file defines MAIN, which causes
302
- // the single defining declarations to be generated. No other source files
303
- // define MAIN and therefore generate referencing declarations.
337
+ /** This implements the "omitted storage class model" for external variables.
338
+ * (Ref: Harbison & Steele.) The rmmain.c file defines MAIN, which causes
339
+ * the single defining declarations to be generated. No other source files
340
+ * define MAIN and therefore generate referencing declarations.
341
+ */
304
342
  #undef EXTERN
305
343
  #if defined(MAIN)
306
344
  #define EXTERN
@@ -380,76 +418,81 @@ EXTERN VALUE Class_StyleType;
380
418
  EXTERN VALUE Class_WeightType;
381
419
  EXTERN VALUE Class_VirtualPixelMethod;
382
420
 
383
- /*
421
+ /**
384
422
  * Commonly-used IDs
385
423
  */
386
- EXTERN ID rm_ID_trace_proc; // "@trace_proc"
387
- EXTERN ID rm_ID_call; // "call"
388
- EXTERN ID rm_ID_changed; // "changed"
389
- EXTERN ID rm_ID_cur_image; // "cur_image"
390
- EXTERN ID rm_ID_dup; // "dup"
391
- EXTERN ID rm_ID_fill; // "fill"
392
- EXTERN ID rm_ID_flag; // "flag"
393
- EXTERN ID rm_ID_from_s; // "from_s"
394
- EXTERN ID rm_ID_Geometry; // "Geometry"
395
- EXTERN ID rm_ID_GeometryValue; // "GeometryValue"
396
- EXTERN ID rm_ID_has_key_q; // "has_key?"
397
- EXTERN ID rm_ID_height; // "height"
398
- EXTERN ID rm_ID_initialize_copy; // "initialize_copy"
399
- EXTERN ID rm_ID_length; // "length"
400
- EXTERN ID rm_ID_notify_observers; // "notify_observers"
401
- EXTERN ID rm_ID_new; // "new"
402
- EXTERN ID rm_ID_push; // "push"
403
- EXTERN ID rm_ID_spaceship; // "<=>
404
- EXTERN ID rm_ID_to_i; // "to_i"
405
- EXTERN ID rm_ID_to_s; // "to_s"
406
- EXTERN ID rm_ID_values; // "values"
407
- EXTERN ID rm_ID_width; // "width"
408
- EXTERN ID rm_ID_x; // "x"
409
- EXTERN ID rm_ID_y; // "y"
424
+ EXTERN ID rm_ID_trace_proc; /**< "@trace_proc" */
425
+ EXTERN ID rm_ID_call; /**< "call" */
426
+ EXTERN ID rm_ID_changed; /**< "changed" */
427
+ EXTERN ID rm_ID_cur_image; /**< "cur_image" */
428
+ EXTERN ID rm_ID_dup; /**< "dup" */
429
+ EXTERN ID rm_ID_fill; /**< "fill" */
430
+ EXTERN ID rm_ID_flag; /**< "flag" */
431
+ EXTERN ID rm_ID_from_s; /**< "from_s" */
432
+ EXTERN ID rm_ID_Geometry; /**< "Geometry" */
433
+ EXTERN ID rm_ID_GeometryValue; /**< "GeometryValue" */
434
+ EXTERN ID rm_ID_has_key_q; /**< "has_key?" */
435
+ EXTERN ID rm_ID_height; /**< "height" */
436
+ EXTERN ID rm_ID_initialize_copy; /**< "initialize_copy" */
437
+ EXTERN ID rm_ID_length; /**< "length" */
438
+ EXTERN ID rm_ID_notify_observers; /**< "notify_observers" */
439
+ EXTERN ID rm_ID_new; /**< "new" */
440
+ EXTERN ID rm_ID_push; /**< "push" */
441
+ EXTERN ID rm_ID_spaceship; /**< "<=>" */
442
+ EXTERN ID rm_ID_to_i; /**< "to_i" */
443
+ EXTERN ID rm_ID_to_s; /**< "to_s" */
444
+ EXTERN ID rm_ID_values; /**< "values" */
445
+ EXTERN ID rm_ID_width; /**< "width" */
446
+ EXTERN ID rm_ID_x; /**< "x" */
447
+ EXTERN ID rm_ID_y; /**< "y" */
410
448
 
411
449
  #if !defined(min)
412
- #define min(a,b) ((a)<(b)?(a):(b))
450
+ #define min(a,b) ((a)<(b)?(a):(b)) /**< min of two values */
413
451
  #endif
414
452
  #if !defined(max)
415
- #define max(a,b) ((a)>(b)?(a):(b))
453
+ #define max(a,b) ((a)>(b)?(a):(b)) /**< max of two values */
416
454
  #endif
417
455
 
418
- /*
456
+ /**
419
457
  Handle warnings & errors
420
458
  */
459
+ //! Handle warnings & errors
421
460
  #define CHECK_EXCEPTION() rm_check_exception(&exception, NULL, RetainOnError);
422
461
 
423
462
 
424
463
  /*
425
464
  Call rb_define_method for an attribute accessor method
426
465
  */
466
+ //! attribute reader
427
467
  #define DCL_ATTR_READER(class, attr) \
428
- rb_define_method(Class_##class, #attr, class##_##attr, 0);
468
+ rb_define_method(Class_##class, #attr, class##_##attr, 0);
469
+ //! attribute writer
429
470
  #define DCL_ATTR_WRITER(class, attr) \
430
471
  rb_define_method(Class_##class, #attr "=", class##_##attr##_eq, 1);
472
+ //! attribute accessor
431
473
  #define DCL_ATTR_ACCESSOR(class, attr) \
432
474
  DCL_ATTR_READER(class, attr) \
433
475
  DCL_ATTR_WRITER(class, attr)
434
- // Borrow another class' attribute writer definition
476
+ //! Borrow another class' attribute writer definition
435
477
  #define SHARE_ATTR_WRITER(to, from, attr) \
436
478
  rb_define_method(Class_##to, #attr "=", from##_##attr##_eq, 1);
437
479
 
438
480
  /*
439
481
  Define simple attribute accessor methods (boolean, int, string, and double types)
440
482
  */
441
- #define C_bool_to_R_bool(attr) (attr) ? Qtrue : Qfalse
442
- #define R_bool_to_C_bool(attr) RTEST(attr)
443
- #define C_int_to_R_int(attr) INT2FIX(attr)
444
- #define R_int_to_C_int(attr) NUM2INT(attr)
445
- #define C_long_to_R_long(attr) INT2NUM(attr)
446
- #define R_long_to_C_long(attr) NUM2LONG(attr)
447
- #define C_ulong_to_R_ulong(attr) UINT2NUM(attr)
448
- #define R_ulong_to_C_ulong(attr) NUM2ULONG(attr)
449
- #define C_str_to_R_str(attr) attr ? rb_str_new2(attr) : Qnil
450
- #define C_dbl_to_R_dbl(attr) rb_float_new(attr)
451
- #define R_dbl_to_C_dbl(attr) NUM2DBL(attr)
452
-
483
+ #define C_bool_to_R_bool(attr) (attr) ? Qtrue : Qfalse /**< C boolean -> Ruby boolean */
484
+ #define R_bool_to_C_bool(attr) RTEST(attr) /**< C boolean <- Ruby boolean */
485
+ #define C_int_to_R_int(attr) INT2FIX(attr) /**< C int -> Ruby int */
486
+ #define R_int_to_C_int(attr) NUM2INT(attr) /**< C int <- Ruby int */
487
+ #define C_long_to_R_long(attr) INT2NUM(attr) /**< C long -> Ruby long */
488
+ #define R_long_to_C_long(attr) NUM2LONG(attr) /**< C long <- Ruby long */
489
+ #define C_ulong_to_R_ulong(attr) UINT2NUM(attr) /**< C unsigned long -> Ruby unsigned long */
490
+ #define R_ulong_to_C_ulong(attr) NUM2ULONG(attr) /**< C unsigned long <- Ruby unsigned long */
491
+ #define C_str_to_R_str(attr) attr ? rb_str_new2(attr) : Qnil /**< C string -> Ruby string */
492
+ #define C_dbl_to_R_dbl(attr) rb_float_new(attr) /**< C double -> Ruby double */
493
+ #define R_dbl_to_C_dbl(attr) NUM2DBL(attr) /**< C double <- Ruby double */
494
+
495
+ //! define attribute reader
453
496
  #define DEF_ATTR_READER(class, attr, type) \
454
497
  VALUE class##_##attr(VALUE self)\
455
498
  {\
@@ -461,7 +504,7 @@ EXTERN ID rm_ID_y; // "y"
461
504
  return C_##type##_to_R_##type(ptr->attr);\
462
505
  }
463
506
 
464
- // Use when attribute name is different from the field name
507
+ //! define attribute reader when attribute name is different from the field name
465
508
  #define DEF_ATTR_READERF(class, attr, field, type) \
466
509
  VALUE class##_##attr(VALUE self)\
467
510
  {\
@@ -470,6 +513,8 @@ EXTERN ID rm_ID_y; // "y"
470
513
  Data_Get_Struct(self, class, ptr);\
471
514
  return C_##type##_to_R_##type(ptr->field);\
472
515
  }
516
+
517
+ //! define attribute writer
473
518
  #define DEF_ATTR_WRITER(class, attr, type) \
474
519
  VALUE class##_##attr##_eq(VALUE self, VALUE val)\
475
520
  {\
@@ -482,6 +527,8 @@ EXTERN ID rm_ID_y; // "y"
482
527
  ptr->attr = R_##type##_to_C_##type(val);\
483
528
  return self;\
484
529
  }
530
+
531
+ //! define attribute accessor
485
532
  #define DEF_ATTR_ACCESSOR(class, attr, type)\
486
533
  DEF_ATTR_READER(class, attr, type)\
487
534
  DEF_ATTR_WRITER(class, attr, type)
@@ -489,10 +536,13 @@ EXTERN ID rm_ID_y; // "y"
489
536
  /*
490
537
  * Declare attribute accessors
491
538
  */
539
+ //! declare attribute reader
492
540
  #define ATTR_READER(class, attr) \
493
541
  extern VALUE class##_##attr(VALUE);
542
+ //! declare attribute writer
494
543
  #define ATTR_WRITER(class, attr) \
495
544
  extern VALUE class##_##attr##_eq(VALUE, VALUE);
545
+ //! declare attribute accessor
496
546
  #define ATTR_ACCESSOR(class, attr) \
497
547
  ATTR_READER(class, attr)\
498
548
  ATTR_WRITER(class, attr)
@@ -501,16 +551,19 @@ EXTERN ID rm_ID_y; // "y"
501
551
  * Define functions to get/set attributes in Image::Info that
502
552
  * use the Get/SetImageOption API.
503
553
  */
554
+ //! Option attribute reader. For Image::Info.
504
555
  #define OPTION_ATTR_READER(opt, key) \
505
556
  VALUE Info_##opt(VALUE self)\
506
557
  {\
507
558
  return get_option(self, #key);\
508
559
  }
560
+ //! Option attribute writer. For Image::Info.
509
561
  #define OPTION_ATTR_WRITER(opt, key) \
510
562
  VALUE Info_##opt##_eq(VALUE self, VALUE string)\
511
563
  {\
512
564
  return set_option(self, #key, string);\
513
565
  }
566
+ //! Option attribute accessor. For Image::Info.
514
567
  #define OPTION_ATTR_ACCESSOR(opt, key)\
515
568
  OPTION_ATTR_READER(opt, key)\
516
569
  OPTION_ATTR_WRITER(opt, key)
@@ -519,6 +572,7 @@ EXTERN ID rm_ID_y; // "y"
519
572
  /*
520
573
  * Declare Pixel channel attribute writers
521
574
  */
575
+ //! Pixel channel attribute writer.
522
576
  #define DEF_PIXEL_CHANNEL_WRITER(_channel_) \
523
577
  extern VALUE \
524
578
  Pixel_##_channel_##_eq(VALUE self, VALUE v) \
@@ -537,6 +591,7 @@ Pixel_##_channel_##_eq(VALUE self, VALUE v) \
537
591
  /*
538
592
  * Declare Pixel CMYK channel attribute accessors
539
593
  */
594
+ //! Pixel CMYK channel attribute accessor.
540
595
  #define DEF_PIXEL_CMYK_CHANNEL_ACCESSOR(_cmyk_channel_, _rgb_channel_) \
541
596
  extern VALUE \
542
597
  Pixel_##_cmyk_channel_##_eq(VALUE self, VALUE v) \
@@ -566,16 +621,19 @@ Pixel_##_cmyk_channel_(VALUE self) \
566
621
  * Define an instance of the subclass for each member in the enumeration.
567
622
  * Initialize each instance with its name and value.
568
623
  */
624
+ //! define Ruby enum
569
625
  #define DEF_ENUM(tag) {\
570
626
  VALUE _cls, _enum;\
571
627
  _cls = Class_##tag = rm_define_enum_type(#tag);
572
628
 
629
+ //! define Ruby enumerator elements
573
630
  #define ENUMERATOR(val)\
574
631
  _enum = rm_enum_new(_cls, ID2SYM(rb_intern(#val)), INT2NUM(val));\
575
632
  rb_define_const(Module_Magick, #val, _enum);
633
+ //! end of an enumerator
576
634
  #define END_ENUM }
577
635
 
578
- // Define a Magick module constant
636
+ //! Define a Magick module constant
579
637
  #if QuantumDepth == 64
580
638
  #define DEF_CONST(constant) rb_define_const(Module_Magick, #constant, ULL2NUM(constant))
581
639
  #else // QuantumDepth == 8, 16, 32
@@ -583,7 +641,7 @@ Pixel_##_cmyk_channel_(VALUE self) \
583
641
  #endif
584
642
 
585
643
 
586
- // Convert a Ruby enum constant back to a C enum member.
644
+ //! Convert a Ruby enum constant back to a C enum member.
587
645
  #define VALUE_TO_ENUM(value, e, type) \
588
646
  do {\
589
647
  MagickEnum *magick_enum;\
@@ -594,6 +652,7 @@ Pixel_##_cmyk_channel_(VALUE self) \
594
652
  e = (type)(magick_enum->val);\
595
653
  } while(0)
596
654
 
655
+ //! create case statement, mapping enum to its name
597
656
  #define ENUM_TO_NAME(_enum) case _enum: return #_enum;
598
657
 
599
658
 
@@ -1210,7 +1269,7 @@ extern char *rm_str2cstr(VALUE, long *);
1210
1269
  extern int rm_check_num2dbl(VALUE);
1211
1270
  extern double rm_fuzz_to_dbl(VALUE);
1212
1271
  extern Quantum rm_app2quantum(VALUE);
1213
- extern double rm_percentage(VALUE);
1272
+ extern double rm_percentage(VALUE,double);
1214
1273
  extern double rm_str_to_pct(VALUE);
1215
1274
  extern VALUE rm_define_enum_type(const char *);
1216
1275
  extern void rm_write_temp_image(Image *, char *);
@@ -1226,10 +1285,11 @@ extern void rm_sync_image_options(Image *, Info *);
1226
1285
  extern void rm_split(Image *);
1227
1286
  extern void rm_magick_error(const char *, const char *);
1228
1287
 
1288
+ //! whether to retain on errors
1229
1289
  typedef enum
1230
1290
  {
1231
- RetainOnError = 0,
1232
- DestroyOnError = 1
1291
+ RetainOnError = 0, /**< retain on error */
1292
+ DestroyOnError = 1 /**< do not retain on error */
1233
1293
  } ErrorRetention;
1234
1294
 
1235
1295
  extern void rm_check_image_exception(Image *, ErrorRetention);