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,12 +1,15 @@
1
- /* $Id: rmmain.c,v 1.302 2009/09/15 22:09:44 rmagick Exp $ */
2
- /*============================================================================\
3
- | Copyright (C) 2009 by Timothy P. Hunter
4
- | Name: rmmain.c
5
- | Author: Tim Hunter
6
- | Purpose: Contains all module, class, method declarations.
7
- | Defines all constants
8
- | Contains Magick module methods.
9
- \============================================================================*/
1
+ /**************************************************************************//**
2
+ * Contains all module, class, method declarations. Defines all constants.
3
+ * Contains Magick module methods.
4
+ *
5
+ * Copyright © 2002 - 2009 by Timothy P. Hunter
6
+ *
7
+ * Changes since Nov. 2009 copyright © by Benjamin Thomas and Omer Bar-or
8
+ *
9
+ * @file rmmain.c
10
+ * @version $Id: rmmain.c,v 1.303 2009/12/20 02:33:33 baror Exp $
11
+ * @author Tim Hunter
12
+ ******************************************************************************/
10
13
 
11
14
  #define MAIN // Define external variables
12
15
  #include "rmagick.h"
@@ -28,6 +31,14 @@ static void version_constants(void);
28
31
  * These functions have the same signature as the equivalent C functions.
29
32
  */
30
33
  #if defined(HAVE_SETMAGICKMEMORYMETHODS)
34
+ /**
35
+ * Allocate memory.
36
+ *
37
+ * No Ruby usage (internal function)
38
+ *
39
+ * @param size the size of memory to allocate
40
+ * @return pointer to a block of memory
41
+ */
31
42
  static void *rm_malloc(size_t size)
32
43
  {
33
44
  void *p;
@@ -46,6 +57,15 @@ static void *rm_malloc(size_t size)
46
57
 
47
58
 
48
59
 
60
+ /**
61
+ * Reallocate memory.
62
+ *
63
+ * No Ruby usage (internal function)
64
+ *
65
+ * @param ptr pointer to the existing block of memory
66
+ * @param size the new size of memory to allocate
67
+ * @return pointer to a block of memory
68
+ */
49
69
  static void *rm_realloc(void *ptr, size_t size)
50
70
  {
51
71
  void *p;
@@ -64,12 +84,24 @@ static void *rm_realloc(void *ptr, size_t size)
64
84
 
65
85
 
66
86
 
87
+ /**
88
+ * Free memory.
89
+ *
90
+ * No Ruby usage (internal function)
91
+ *
92
+ * @param ptr pointer to the existing block of memory
93
+ */
67
94
  static void rm_free(void *ptr)
68
95
  {
69
96
  xfree(ptr);
70
97
  }
71
98
 
72
99
 
100
+ /**
101
+ * Use managed memory.
102
+ *
103
+ * No Ruby usage (internal function)
104
+ */
73
105
  static void set_managed_memory(void)
74
106
  {
75
107
  ID enable_mm = rb_intern("RMAGICK_ENABLE_MANAGED_MEMORY");
@@ -90,12 +122,11 @@ static void set_managed_memory(void)
90
122
 
91
123
 
92
124
 
93
- /*
94
- External: Init_RMagick2
95
- Purpose: define the classes and constants
96
- Arguments: void
97
- Returns: void
98
- */
125
+ /**
126
+ * Define the classes and constants.
127
+ *
128
+ * No Ruby usage (internal function)
129
+ */
99
130
  void
100
131
  Init_RMagick2(void)
101
132
  {
@@ -1590,13 +1621,16 @@ Init_RMagick2(void)
1590
1621
 
1591
1622
 
1592
1623
 
1593
- /*
1594
- * Static: test_Magick_version
1595
- * Purpose: Ensure the version of ImageMagick we're running with matches
1596
- * the version we were compiled with.
1597
- * Notes: Bypass the test by defining the constant RMAGICK_BYPASS_VERSION_TEST
1598
- * to 'true' at the top level, before requiring 'RMagick'
1599
- */
1624
+ /**
1625
+ * Ensure the version of ImageMagick we're running with matches the version we
1626
+ * were compiled with.
1627
+ *
1628
+ * No Ruby usage (internal function)
1629
+ *
1630
+ * Notes:
1631
+ * - Bypass the test by defining the constant RMAGICK_BYPASS_VERSION_TEST to
1632
+ * 'true' at the top level, before requiring 'RMagick'
1633
+ */
1600
1634
  static void
1601
1635
  test_Magick_version(void)
1602
1636
  {
@@ -1634,10 +1668,11 @@ test_Magick_version(void)
1634
1668
 
1635
1669
 
1636
1670
 
1637
- /*
1638
- Static: version_constants
1639
- Purpose: create Version, Magick_version, and Version_long constants.
1640
- */
1671
+ /**
1672
+ * Create Version, Magick_version, and Version_long constants.
1673
+ *
1674
+ * No Ruby usage (internal function)
1675
+ */
1641
1676
  static void
1642
1677
  version_constants(void)
1643
1678
  {
@@ -1656,7 +1691,7 @@ version_constants(void)
1656
1691
  rb_define_const(Module_Magick, "Version", str);
1657
1692
 
1658
1693
  sprintf(long_version,
1659
- "This is %s ($Date: 2009/09/15 22:09:44 $) Copyright (C) 2009 by Timothy P. Hunter\n"
1694
+ "This is %s ($Date: 2009/12/20 02:33:33 $) Copyright (C) 2009 by Timothy P. Hunter\n"
1660
1695
  "Built with %s\n"
1661
1696
  "Built for %s\n"
1662
1697
  "Web page: http://rmagick.rubyforge.org\n"
@@ -1,10 +1,14 @@
1
- /* $Id: rmmontage.c,v 1.4 2009/02/28 23:50:36 rmagick Exp $ */
2
- /*============================================================================\
3
- | Copyright (C) 2009 by Timothy P. Hunter
4
- | Name: rmdraw.c
5
- | Author: Tim Hunter
6
- | Purpose: Contains Montage class methods.
7
- \============================================================================*/
1
+ /**************************************************************************//**
2
+ * Contains Montage 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 rmmontage.c
9
+ * @version $Id: rmmontage.c,v 1.5 2009/12/20 02:33:33 baror Exp $
10
+ * @author Tim Hunter
11
+ ******************************************************************************/
8
12
 
9
13
  #include "rmagick.h"
10
14
 
@@ -12,12 +16,17 @@
12
16
 
13
17
 
14
18
 
15
- /*
16
- Static: destroy_Montage
17
- Purpose: destory the MontageInfo struct and free the Montage struct
18
- Notes: if the Magick::Montage#texture method wrote a texture file,
19
- the file is deleted here.
20
- */
19
+ /**
20
+ * Destory the MontageInfo struct and free the Montage struct.
21
+ *
22
+ * No Ruby usage (internal function)
23
+ *
24
+ * Notes:
25
+ * - If the Magick::Montage#texture method wrote a texture file, the file is
26
+ * deleted here.
27
+ *
28
+ * @param obj the montage object
29
+ */
21
30
  static void
22
31
  destroy_Montage(void *obj)
23
32
  {
@@ -39,10 +48,15 @@ destroy_Montage(void *obj)
39
48
  }
40
49
 
41
50
 
42
- /*
43
- Method: Montage.new
44
- Purpose: Create a new Montage object
45
- */
51
+ /**
52
+ * Create a new Montage object.
53
+ *
54
+ * Ruby usage:
55
+ * - @verbatim Montage.new @endverbatim
56
+ *
57
+ * @param class the Ruby class to use
58
+ * @return a new Montage object
59
+ */
46
60
  VALUE
47
61
  Montage_alloc(VALUE class)
48
62
  {
@@ -75,10 +89,16 @@ Montage_alloc(VALUE class)
75
89
  }
76
90
 
77
91
 
78
- /*
79
- Method: Magick::Montage#background_color(color-name)
80
- Purpose: set background_color value
81
- */
92
+ /**
93
+ * Set background_color value.
94
+ *
95
+ * Ruby usage:
96
+ * - @verbatim Magick::Montage#background_color(color-name) @endverbatim
97
+ *
98
+ * @param self this object
99
+ * @param color the color name
100
+ * @return self
101
+ */
82
102
  VALUE
83
103
  Montage_background_color_eq(VALUE self, VALUE color)
84
104
  {
@@ -90,10 +110,16 @@ Montage_background_color_eq(VALUE self, VALUE color)
90
110
  }
91
111
 
92
112
 
93
- /*
94
- Method: Magick::Montage#border_color(color-name)
95
- Purpose: set border_color value
96
- */
113
+ /**
114
+ * Set border_color value.
115
+ *
116
+ * Ruby usage:
117
+ * - @verbatim Magick::Montage#border_color(color-name) @endverbatim
118
+ *
119
+ * @param self this object
120
+ * @param color the color name
121
+ * @return self
122
+ */
97
123
  VALUE
98
124
  Montage_border_color_eq(VALUE self, VALUE color)
99
125
  {
@@ -105,10 +131,16 @@ Montage_border_color_eq(VALUE self, VALUE color)
105
131
  }
106
132
 
107
133
 
108
- /*
109
- Method: Magick::Montage#border_width(width)
110
- Purpose: set border_width value
111
- */
134
+ /**
135
+ * Set border_width value.
136
+ *
137
+ * Ruby usage:
138
+ * - @verbatim Magick::Montage#border_width(width) @endverbatim
139
+ *
140
+ * @param self this object
141
+ * @param width the width
142
+ * @return self
143
+ */
112
144
  VALUE
113
145
  Montage_border_width_eq(VALUE self, VALUE width)
114
146
  {
@@ -120,10 +152,16 @@ Montage_border_width_eq(VALUE self, VALUE width)
120
152
  }
121
153
 
122
154
 
123
- /*
124
- Method: Magick::Montage#compose(width)
125
- Purpose: set a composition operator
126
- */
155
+ /**
156
+ * Set a composition operator.
157
+ *
158
+ * Ruby usage:
159
+ * - @verbatim Magick::Montage#compose(width) @endverbatim
160
+ *
161
+ * @param self this object
162
+ * @param compose the composition operator
163
+ * @return self
164
+ */
127
165
  VALUE
128
166
  Montage_compose_eq(VALUE self, VALUE compose)
129
167
  {
@@ -135,10 +173,16 @@ Montage_compose_eq(VALUE self, VALUE compose)
135
173
  }
136
174
 
137
175
 
138
- /*
139
- Method: Magick::Montage#filename(name)
140
- Purpose: set filename value
141
- */
176
+ /**
177
+ * Set filename value.
178
+ *
179
+ * Ruby usage:
180
+ * - @verbatim Magick::Montage#filename(name) @endverbatim
181
+ *
182
+ * @param self this object
183
+ * @param filename the filename
184
+ * @return self
185
+ */
142
186
  VALUE
143
187
  Montage_filename_eq(VALUE self, VALUE filename)
144
188
  {
@@ -150,10 +194,16 @@ Montage_filename_eq(VALUE self, VALUE filename)
150
194
  }
151
195
 
152
196
 
153
- /*
154
- Method: Magick::Montage#fill(color-name)
155
- Purpose: set fill value
156
- */
197
+ /**
198
+ * Set fill value.
199
+ *
200
+ * Ruby usage:
201
+ * - @verbatim Magick::Montage#fill(color-name) @endverbatim
202
+ *
203
+ * @param self this object
204
+ * @param color the color name
205
+ * @return self
206
+ */
157
207
  VALUE
158
208
  Montage_fill_eq(VALUE self, VALUE color)
159
209
  {
@@ -165,10 +215,16 @@ Montage_fill_eq(VALUE self, VALUE color)
165
215
  }
166
216
 
167
217
 
168
- /*
169
- Method: Magick::Montage#font(font-name)
170
- Purpose: set font value
171
- */
218
+ /**
219
+ * Set font value.
220
+ *
221
+ * Ruby usage:
222
+ * - @verbatim Magick::Montage#font(font-name) @endverbatim
223
+ *
224
+ * @param self this object
225
+ * @param font the font name
226
+ * @return self
227
+ */
172
228
  VALUE
173
229
  Montage_font_eq(VALUE self, VALUE font)
174
230
  {
@@ -181,13 +237,21 @@ Montage_font_eq(VALUE self, VALUE font)
181
237
  }
182
238
 
183
239
 
184
- /*
185
- Method: Magick::Montage#frame(frame-geometry)
186
- Purpose: set frame value
187
- Notes: The geometry is a string in the form:
188
- <width>x<height>+<outer-bevel-width>+<inner-bevel-width>
189
- or a Geometry object
190
- */
240
+ /**
241
+ * Set frame value.
242
+ *
243
+ * Ruby usage:
244
+ * - @verbatim Magick::Montage#frame(frame-geometry) @endverbatim
245
+ *
246
+ * Notes:
247
+ * - The geometry is a string in the form:
248
+ * @verbatim <width>x<height>+<outer-bevel-width>+<inner-bevel-width> @endverbatim
249
+ * or a Geometry object
250
+ *
251
+ * @param self this object
252
+ * @param frame_arg the frame geometry
253
+ * @return self
254
+ */
191
255
  VALUE
192
256
  Montage_frame_eq(VALUE self, VALUE frame_arg)
193
257
  {
@@ -202,10 +266,16 @@ Montage_frame_eq(VALUE self, VALUE frame_arg)
202
266
  }
203
267
 
204
268
 
205
- /*
206
- Method: Magick::Montage#geometry(geometry)
207
- Purpose: set geometry value
208
- */
269
+ /**
270
+ * Set geometry value.
271
+ *
272
+ * Ruby usage:
273
+ * - @verbatim Magick::Montage#geometry(geometry) @endverbatim
274
+ *
275
+ * @param self this object
276
+ * @param geometry_arg the geometry
277
+ * @return self
278
+ */
209
279
  VALUE
210
280
  Montage_geometry_eq(VALUE self, VALUE geometry_arg)
211
281
  {
@@ -220,10 +290,16 @@ Montage_geometry_eq(VALUE self, VALUE geometry_arg)
220
290
  }
221
291
 
222
292
 
223
- /*
224
- Method: Magick::Montage#gravity(gravity-type)
225
- Purpose: set gravity value
226
- */
293
+ /**
294
+ * Set gravity value.
295
+ *
296
+ * Ruby usage:
297
+ * - @verbatim Magick::Montage#gravity(gravity-type) @endverbatim
298
+ *
299
+ * @param self this object
300
+ * @param gravity the gravity type
301
+ * @return self
302
+ */
227
303
  VALUE
228
304
  Montage_gravity_eq(VALUE self, VALUE gravity)
229
305
  {
@@ -235,10 +311,15 @@ Montage_gravity_eq(VALUE self, VALUE gravity)
235
311
  }
236
312
 
237
313
 
238
- /*
239
- Method: Magick::Montage#initialize
240
- Purpose: Place-holder
241
- */
314
+ /**
315
+ * Initialize a Montage object. Does nothing currently.
316
+ *
317
+ * Ruby usage:
318
+ * - @verbatim Magick::Montage#initialize @endverbatim
319
+ *
320
+ * @param self this object
321
+ * @return self
322
+ */
242
323
  VALUE
243
324
  Montage_initialize(VALUE self)
244
325
  {
@@ -247,10 +328,16 @@ Montage_initialize(VALUE self)
247
328
  }
248
329
 
249
330
 
250
- /*
251
- Method: Magick::Montage#matte_color(color-name)
252
- Purpose: set matte_color value
253
- */
331
+ /**
332
+ * Set matte_color value.
333
+ *
334
+ * Ruby usage:
335
+ * - @verbatim Magick::Montage#matte_color(color-name) @endverbatim
336
+ *
337
+ * @param self this object
338
+ * @param color the color name
339
+ * @return self
340
+ */
254
341
  VALUE
255
342
  Montage_matte_color_eq(VALUE self, VALUE color)
256
343
  {
@@ -262,10 +349,16 @@ Montage_matte_color_eq(VALUE self, VALUE color)
262
349
  }
263
350
 
264
351
 
265
- /*
266
- Method: Magick::Montage#pointsize=size
267
- Purpose: set pointsize value
268
- */
352
+ /**
353
+ * Set pointsize value.
354
+ *
355
+ * Ruby usage:
356
+ * - @verbatim Magick::Montage#pointsize= @endverbatim
357
+ *
358
+ * @param self this object
359
+ * @param size the point size
360
+ * @return self
361
+ */
269
362
  VALUE
270
363
  Montage_pointsize_eq(VALUE self, VALUE size)
271
364
  {
@@ -277,10 +370,16 @@ Montage_pointsize_eq(VALUE self, VALUE size)
277
370
  }
278
371
 
279
372
 
280
- /*
281
- Method: Magick::Montage#shadow=shadow
282
- Purpose: set shadow value
283
- */
373
+ /**
374
+ * Set shadow value.
375
+ *
376
+ * Ruby usage:
377
+ * - @verbatim Magick::Montage#shadow= @endverbatim
378
+ *
379
+ * @param self this object
380
+ * @param shadow the shadow
381
+ * @return self
382
+ */
284
383
  VALUE
285
384
  Montage_shadow_eq(VALUE self, VALUE shadow)
286
385
  {
@@ -292,10 +391,16 @@ Montage_shadow_eq(VALUE self, VALUE shadow)
292
391
  }
293
392
 
294
393
 
295
- /*
296
- Method: Magick::Montage#stroke(color-name)
297
- Purpose: set stroke value
298
- */
394
+ /**
395
+ * Set stroke value.
396
+ *
397
+ * Ruby usage:
398
+ * - @verbatim Magick::Montage#stroke(color-name) @endverbatim
399
+ *
400
+ * @param self this object
401
+ * @param color the color name
402
+ * @return self
403
+ */
299
404
  VALUE
300
405
  Montage_stroke_eq(VALUE self, VALUE color)
301
406
  {
@@ -307,10 +412,16 @@ Montage_stroke_eq(VALUE self, VALUE color)
307
412
  }
308
413
 
309
414
 
310
- /*
311
- Method: Montage#texture(texture-image)
312
- Purpose: set texture value
313
- */
415
+ /**
416
+ * Set texture value.
417
+ *
418
+ * Ruby usage:
419
+ * - @verbatim Montage#texture(texture-image) @endverbatim
420
+ *
421
+ * @param self this object
422
+ * @param texture the texture image
423
+ * @return self
424
+ */
314
425
  VALUE
315
426
  Montage_texture_eq(VALUE self, VALUE texture)
316
427
  {
@@ -340,10 +451,16 @@ Montage_texture_eq(VALUE self, VALUE texture)
340
451
  }
341
452
 
342
453
 
343
- /*
344
- Method: Magick::Montage#tile(tile)
345
- Purpose: set tile value
346
- */
454
+ /**
455
+ * Set tile value.
456
+ *
457
+ * Ruby usage:
458
+ * - @verbatim Magick::Montage#tile(tile) @endverbatim
459
+ *
460
+ * @param self this object
461
+ * @param tile_arg the tile
462
+ * @return self
463
+ */
347
464
  VALUE
348
465
  Montage_tile_eq(VALUE self, VALUE tile_arg)
349
466
  {
@@ -358,10 +475,16 @@ Montage_tile_eq(VALUE self, VALUE tile_arg)
358
475
  }
359
476
 
360
477
 
361
- /*
362
- Method: Magick::Montage#title(title)
363
- Purpose: set title value
364
- */
478
+ /**
479
+ * Set title value.
480
+ *
481
+ * Ruby usage:
482
+ * - @verbatim Magick::Montage#title(title) @endverbatim
483
+ *
484
+ * @param self this object
485
+ * @param title the title
486
+ * @return self
487
+ */
365
488
  VALUE
366
489
  Montage_title_eq(VALUE self, VALUE title)
367
490
  {
@@ -373,11 +496,13 @@ Montage_title_eq(VALUE self, VALUE title)
373
496
  }
374
497
 
375
498
 
376
- /*
377
- Extern: rm_montage_new()
378
- Purpose: Return a new Magick::Montage object
379
- */
380
-
499
+ /**
500
+ * Return a new Magick::Montage object.
501
+ *
502
+ * No Ruby usage (internal function)
503
+ *
504
+ * @return a new Magick::Montage object
505
+ */
381
506
  VALUE
382
507
  rm_montage_new(void)
383
508
  {