rmagick 3.0.0 → 3.1.0

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.

Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.appveyor.yml +32 -6
  3. data/.circleci/config.yml +1 -1
  4. data/.gitignore +1 -0
  5. data/.rubocop.yml +9 -9
  6. data/.rubocop_todo.yml +351 -17
  7. data/.travis.yml +14 -1
  8. data/CHANGELOG.md +55 -0
  9. data/CONTRIBUTING.md +11 -18
  10. data/README.textile +2 -2
  11. data/Rakefile +1 -1
  12. data/before_install_linux.sh +56 -19
  13. data/doc/ex/sparse_color.rb +5 -0
  14. data/doc/magick.html +9 -4
  15. data/doc/rvg.html +2 -2
  16. data/doc/rvgtut.html +1 -1
  17. data/examples/histogram.rb +1 -1
  18. data/ext/RMagick/extconf.rb +90 -264
  19. data/ext/RMagick/rmagick.c +28 -6
  20. data/ext/RMagick/rmagick.h +53 -199
  21. data/ext/RMagick/rmdraw.c +52 -70
  22. data/ext/RMagick/rmenum.c +332 -274
  23. data/ext/RMagick/rmfill.c +62 -112
  24. data/ext/RMagick/rmilist.c +27 -62
  25. data/ext/RMagick/rmimage.c +424 -634
  26. data/ext/RMagick/rminfo.c +46 -37
  27. data/ext/RMagick/rmkinfo.c +47 -42
  28. data/ext/RMagick/rmmain.c +125 -180
  29. data/ext/RMagick/rmmontage.c +5 -5
  30. data/ext/RMagick/rmpixel.c +133 -62
  31. data/ext/RMagick/rmstruct.c +14 -181
  32. data/ext/RMagick/rmutil.c +195 -111
  33. data/lib/rmagick/version.rb +2 -3
  34. data/lib/rvg/deep_equal.rb +1 -1
  35. data/lib/rvg/misc.rb +4 -4
  36. data/lib/rvg/units.rb +2 -2
  37. data/rmagick.gemspec +2 -2
  38. data/spec/rmagick/ImageList1_spec.rb +2 -2
  39. data/spec/rmagick/draw_spec.rb +4 -4
  40. data/spec/rmagick/image/composite_spec.rb +6 -1
  41. data/spec/rmagick/image/properties_spec.rb +8 -8
  42. data/test/Draw.rb +414 -0
  43. data/test/Enum.rb +76 -0
  44. data/test/Fill.rb +93 -0
  45. data/test/Image1.rb +9 -1
  46. data/test/Image2.rb +14 -4
  47. data/test/Image3.rb +73 -3
  48. data/test/ImageList1.rb +22 -9
  49. data/test/ImageList2.rb +41 -9
  50. data/test/Image_attributes.rb +45 -8
  51. data/test/Info.rb +102 -6
  52. data/test/Magick.rb +8 -1
  53. data/test/PolaroidOptions.rb +23 -0
  54. data/test/test_all_basic.rb +4 -0
  55. metadata +28 -8
  56. data/.hound.yml +0 -2
  57. data/wercker.yml +0 -10
@@ -15,6 +15,20 @@
15
15
 
16
16
 
17
17
 
18
+ static VALUE
19
+ rm_yield_body(VALUE object)
20
+ {
21
+ return rb_yield(object);
22
+ }
23
+
24
+ static VALUE
25
+ rm_yield_handle_exception(VALUE allocated_area, VALUE exc)
26
+ {
27
+ magick_free((void *)allocated_area);
28
+ rb_exc_raise(exc);
29
+ return Qnil; /* not reachable */
30
+ }
31
+
18
32
  /**
19
33
  * If called with the optional block, iterates over the colors, otherwise
20
34
  * returns an array of Magick::Color objects.
@@ -48,7 +62,7 @@ Magick_colors(VALUE class)
48
62
  {
49
63
  for (x = 0; x < number_colors; x++)
50
64
  {
51
- (void) rb_yield(Import_ColorInfo(color_info_list[x]));
65
+ rb_rescue(rm_yield_body, Import_ColorInfo(color_info_list[x]), rm_yield_handle_exception, (VALUE)color_info_list);
52
66
  }
53
67
  magick_free((void *)color_info_list);
54
68
  return class;
@@ -96,7 +110,7 @@ Magick_fonts(VALUE class)
96
110
  {
97
111
  for (x = 0; x < number_types; x++)
98
112
  {
99
- (void) rb_yield(Import_TypeInfo((const TypeInfo *)type_info[x]));
113
+ rb_rescue(rm_yield_body, Import_TypeInfo((const TypeInfo *)type_info[x]), rm_yield_handle_exception, (VALUE)type_info);
100
114
  }
101
115
  magick_free((void *)type_info);
102
116
  return class;
@@ -135,10 +149,10 @@ MagickInfo_to_format(const MagickInfo *magick_info)
135
149
  {
136
150
  char mode[4];
137
151
 
138
- mode[0] = magick_info->blob_support ? '*': ' ';
139
- mode[1] = magick_info->decoder ? 'r' : '-';
140
- mode[2] = magick_info->encoder ? 'w' : '-';
141
- mode[3] = magick_info->encoder && magick_info->adjoin ? '+' : '-';
152
+ mode[0] = GetMagickBlobSupport(magick_info) ? '*': ' ';
153
+ mode[1] = GetImageDecoder(magick_info) ? 'r' : '-';
154
+ mode[2] = GetImageEncoder(magick_info) ? 'w' : '-';
155
+ mode[3] = GetMagickAdjoin(magick_info) ? '+' : '-';
142
156
 
143
157
  return rb_str_new(mode, sizeof(mode));
144
158
  }
@@ -245,6 +259,10 @@ Magick_limit_resource(int argc, VALUE *argv, VALUE class)
245
259
  {
246
260
  res = FileResource;
247
261
  }
262
+ else if (id == rb_intern("time"))
263
+ {
264
+ res = TimeResource;
265
+ }
248
266
  else
249
267
  {
250
268
  rb_raise(rb_eArgError, "unknown resource: `:%s'", rb_id2name(id));
@@ -277,6 +295,10 @@ Magick_limit_resource(int argc, VALUE *argv, VALUE class)
277
295
  {
278
296
  res = FileResource;
279
297
  }
298
+ else if (rm_strcasecmp("time", str) == 0)
299
+ {
300
+ res = TimeResource;
301
+ }
280
302
  else
281
303
  {
282
304
  rb_raise(rb_eArgError, "unknown resource: `%s'", str);
@@ -19,9 +19,6 @@
19
19
  #include <assert.h>
20
20
  #include <stdio.h>
21
21
  #include <ctype.h>
22
- #if defined(HAVE_STDINT_H)
23
- #include <stdint.h>
24
- #endif
25
22
  #include <stdlib.h>
26
23
  #include <math.h>
27
24
  #include <time.h>
@@ -98,26 +95,6 @@
98
95
  //! round to Quantum
99
96
  #define ROUND_TO_QUANTUM(value) ((Quantum) ((value) > (Quantum)QuantumRange ? QuantumRange : (value) + 0.5))
100
97
 
101
-
102
- // Ruby 1.9.0 changed the name to rb_frame_this_func
103
- #if defined(HAVE_RB_FRAME_THIS_FUNC)
104
- #define THIS_FUNC() rb_frame_this_func() /**< get the Ruby function being called */
105
- #else
106
- #define THIS_FUNC() rb_frame_last_func() /**< get the Ruby function being called */
107
- #endif
108
-
109
- // GetReadFile doesn't exist in Ruby 1.9.0
110
- #if !defined(GetReadFile)
111
- #define GetReadFile(fptr) rb_io_stdio_file(fptr) /**< Ruby read file pointer */
112
- #define GetWriteFile(fptr) rb_io_stdio_file(fptr) /**< Ruby write file pointer */
113
- #endif
114
-
115
- // rb_io_t replaces OpenFile in Ruby 1.9.0
116
- #if defined(HAVE_RB_IO_T)
117
- #undef OpenFile
118
- #define OpenFile rb_io_t /**< Ruby open file */
119
- #endif
120
-
121
98
  //! Convert a C string to a Ruby symbol. Used in marshal_dump/marshal_load methods
122
99
  #define CSTR2SYM(s) ID2SYM(rb_intern(s))
123
100
  //! Convert a C string to a Ruby String, or nil if the ptr is NULL
@@ -133,43 +110,13 @@
133
110
  f = NULL;
134
111
 
135
112
 
136
- /** ImageMagick 6.5.7 replaced DestroyConstitute with
137
- * ConstituteComponentTerminus. Both have the same signature.
138
- */
139
- #if defined(HAVE_CONSTITUTECOMPONENTTERMINUS)
140
- #define DestroyConstitute(void) ConstituteComponentTerminus(void)
141
- #endif
142
-
143
- /** ImageMagick 6.5.9 replaced MagickLibSubversion with
144
- * MagickLibAddendum.
145
- */
146
- #if defined(HAVE_MAGICKLIBADDENDUM)
147
113
  #define MagickLibSubversion MagickLibAddendum
148
- #endif
149
-
150
- /** IM 6.4.1 replaced AllocateImage with AcquireImage.
151
- * Both have the same signature.
152
- */
153
- #if !defined(HAVE_ACQUIREIMAGE)
154
- #define AcquireImage(info) AllocateImage(info)
155
- #endif
156
-
157
- // ImageLayerMethod replaced MagickLayerMethod starting with 6.3.6
158
- #if defined(HAVE_TYPE_IMAGELAYERMETHOD)
159
- #define LAYERMETHODTYPE ImageLayerMethod /**< layer method */
160
- #define CLASS_LAYERMETHODTYPE Class_ImageLayerMethod /**< layer method class */
161
- #define LAYERMETHODTYPE_NAME ImageLayerMethod_name /**< layer method name */
162
- #define LAYERMETHODTYPE_NEW ImageLayerMethod_new /**< new layer method */
163
- #else
164
- #define LAYERMETHODTYPE MagickLayerMethod /**< layer method */
165
- #define CLASS_LAYERMETHODTYPE Class_MagickLayerMethod /**< layer method class */
166
- #define LAYERMETHODTYPE_NAME MagickLayerMethod_name /**< layer method name */
167
- #define LAYERMETHODTYPE_NEW MagickLayerMethod_new /**< new layer method */
168
- #endif
169
114
 
170
115
 
171
116
  typedef ImageInfo Info; /**< Make type name match class name */
172
117
  typedef PixelPacket Pixel; /**< Make type name match class name */
118
+ typedef MagickPixelPacket MagickPixel;
119
+ typedef PixelPacket PixelColor;
173
120
 
174
121
  //! Montage
175
122
  typedef struct
@@ -192,7 +139,7 @@ typedef struct
192
139
  DrawInfo *info; /**< the DrawInfo struct */
193
140
  VALUE primitives; /**< the primitive string */
194
141
  struct TmpFile_Name *tmpfile_ary; /**< the tmp filenames */
195
- PixelPacket shadow_color; /**< PolaroidOptions#shadow_color */
142
+ PixelColor shadow_color; /**< PolaroidOptions#shadow_color */
196
143
  } Draw; // make the type match the class name
197
144
 
198
145
  // Enum
@@ -267,47 +214,27 @@ typedef enum _QuantumExpressionOperator
267
214
  RShiftQuantumOperator, /**< rshift */
268
215
  SubtractQuantumOperator, /**< subtract */
269
216
  XorQuantumOperator, /**< xor */
270
- #if defined(HAVE_ENUM_POWEVALUATEOPERATOR)
271
217
  PowQuantumOperator, /**< pow */
272
- #endif
273
- #if defined(HAVE_ENUM_LOGEVALUATEOPERATOR)
274
218
  LogQuantumOperator, /**< log */
275
- #endif
276
- #if defined(HAVE_ENUM_THRESHOLDEVALUATEOPERATOR)
277
219
  ThresholdQuantumOperator, /**< threshold */
278
- #endif
279
- #if defined(HAVE_ENUM_THRESHOLDBLACKEVALUATEOPERATOR)
280
220
  ThresholdBlackQuantumOperator, /**< threshold black */
281
- #endif
282
- #if defined(HAVE_ENUM_THRESHOLDWHITEEVALUATEOPERATOR)
283
221
  ThresholdWhiteQuantumOperator, /**< threshold white */
284
- #endif
285
- #if defined(HAVE_ENUM_GAUSSIANNOISEEVALUATEOPERATOR)
286
222
  GaussianNoiseQuantumOperator, /**< gaussian noise */
287
- #endif
288
- #if defined(HAVE_ENUM_IMPULSENOISEEVALUATEOPERATOR)
289
223
  ImpulseNoiseQuantumOperator, /**< impulse noise */
290
- #endif
291
- #if defined(HAVE_ENUM_LAPLACIANNOISEEVALUATEOPERATOR)
292
224
  LaplacianNoiseQuantumOperator, /**< laplacian noise */
293
- #endif
294
- #if defined(HAVE_ENUM_MULTIPLICATIVENOISEEVALUATEOPERATOR)
295
225
  MultiplicativeNoiseQuantumOperator, /**< multiplicative noise */
296
- #endif
297
- #if defined(HAVE_ENUM_POISSONNOISEEVALUATEOPERATOR)
298
226
  PoissonNoiseQuantumOperator, /**< poisson noise */
299
- #endif
300
- #if defined(HAVE_ENUM_UNIFORMNOISEEVALUATEOPERATOR)
301
227
  UniformNoiseQuantumOperator, /**< uniform noise */
302
- #endif
303
- #if defined(HAVE_ENUM_COSINEEVALUATEOPERATOR)
304
228
  CosineQuantumOperator, /**< cosine */
305
- #endif
306
- #if defined(HAVE_ENUM_SINEEVALUATEOPERATOR)
307
229
  SineQuantumOperator, /**< sine */
308
- #endif
309
- #if defined(HAVE_ENUM_ADDMODULUSEVALUATEOPERATOR)
310
- AddModulusQuantumOperator /**< add modulus */
230
+ AddModulusQuantumOperator, /**< add modulus */
231
+ MeanQuantumOperator, /**< mean */
232
+ AbsQuantumOperator, /**< abs */
233
+ ExponentialQuantumOperator, /**< exponential */
234
+ MedianQuantumOperator, /**< median */
235
+ SumQuantumOperator /**< sum */
236
+ #if defined(IMAGEMAGICK_GREATER_THAN_EQUAL_6_8_9)
237
+ , RootMeanSquareQuantumOperator /** root mean square */
311
238
  #endif
312
239
  } QuantumExpressionOperator ;
313
240
 
@@ -370,16 +297,14 @@ EXTERN VALUE Class_CompressionType;
370
297
  EXTERN VALUE Class_DecorationType;
371
298
  EXTERN VALUE Class_DisposeType;
372
299
  EXTERN VALUE Class_DistortImageMethod;
373
- #if defined(HAVE_TYPE_DITHERMETHOD)
374
300
  EXTERN VALUE Class_DitherMethod;
375
- #endif
376
301
  EXTERN VALUE Class_EndianType;
377
302
  EXTERN VALUE Class_FilterTypes;
378
303
  EXTERN VALUE Class_GravityType;
379
304
  EXTERN VALUE Class_ImageType;
380
305
  EXTERN VALUE Class_InterlaceType;
381
306
  EXTERN VALUE Class_InterpolatePixelMethod;
382
- EXTERN VALUE CLASS_LAYERMETHODTYPE;
307
+ EXTERN VALUE Class_ImageLayerMethod;
383
308
  EXTERN VALUE Class_MagickFunction;
384
309
  EXTERN VALUE Class_NoiseType;
385
310
  EXTERN VALUE Class_OrientationType;
@@ -387,9 +312,7 @@ EXTERN VALUE Class_PaintMethod;
387
312
  EXTERN VALUE Class_PreviewType;
388
313
  EXTERN VALUE Class_RenderingIntent;
389
314
  EXTERN VALUE Class_ResolutionType;
390
- #if defined(HAVE_SPARSECOLORIMAGE)
391
315
  EXTERN VALUE Class_SparseColorMethod;
392
- #endif
393
316
  EXTERN VALUE Class_SpreadMethod;
394
317
  EXTERN VALUE Class_StorageType;
395
318
  EXTERN VALUE Class_StretchType;
@@ -529,91 +452,6 @@ EXTERN ID rm_ID_y; /**< "y" */
529
452
  ATTR_READER(class, attr)\
530
453
  ATTR_WRITER(class, attr)
531
454
 
532
- /*
533
- * Define functions to get/set attributes in Image::Info that
534
- * use the Get/SetImageOption API.
535
- */
536
- //! Option attribute reader. For Image::Info.
537
- #define OPTION_ATTR_READER(opt, key) \
538
- VALUE Info_##opt(VALUE self)\
539
- {\
540
- return get_option(self, #key);\
541
- }
542
- //! Option attribute writer. For Image::Info.
543
- #define OPTION_ATTR_WRITER(opt, key) \
544
- VALUE Info_##opt##_eq(VALUE self, VALUE string)\
545
- {\
546
- return set_option(self, #key, string);\
547
- }
548
- //! Option attribute accessor. For Image::Info.
549
- #define OPTION_ATTR_ACCESSOR(opt, key)\
550
- OPTION_ATTR_READER(opt, key)\
551
- OPTION_ATTR_WRITER(opt, key)
552
-
553
-
554
- /*
555
- * Declare Pixel channel attribute writers
556
- */
557
- //! Pixel channel attribute writer.
558
- #define DEF_PIXEL_CHANNEL_WRITER(_channel_) \
559
- extern VALUE \
560
- Pixel_##_channel_##_eq(VALUE self, VALUE v) \
561
- { \
562
- Pixel *pixel; \
563
- \
564
- rb_check_frozen(self); \
565
- Data_Get_Struct(self, Pixel, pixel); \
566
- pixel->_channel_ = APP2QUANTUM(v); \
567
- (void) rb_funcall(self, rm_ID_changed, 0); \
568
- (void) rb_funcall(self, rm_ID_notify_observers, 1, self); \
569
- return QUANTUM2NUM((pixel->_channel_)); \
570
- }
571
-
572
-
573
- /*
574
- * Declare Pixel CMYK channel attribute accessors
575
- */
576
- //! Pixel CMYK channel attribute accessor.
577
- #define DEF_PIXEL_CMYK_CHANNEL_ACCESSOR(_cmyk_channel_, _rgb_channel_) \
578
- extern VALUE \
579
- Pixel_##_cmyk_channel_##_eq(VALUE self, VALUE v) \
580
- { \
581
- Pixel *pixel; \
582
- \
583
- rb_check_frozen(self); \
584
- Data_Get_Struct(self, Pixel, pixel); \
585
- pixel->_rgb_channel_ = APP2QUANTUM(v); \
586
- (void) rb_funcall(self, rm_ID_changed, 0); \
587
- (void) rb_funcall(self, rm_ID_notify_observers, 1, self); \
588
- return QUANTUM2NUM(pixel->_rgb_channel_); \
589
- } \
590
- \
591
- extern VALUE \
592
- Pixel_##_cmyk_channel_(VALUE self) \
593
- { \
594
- Pixel *pixel; \
595
- \
596
- Data_Get_Struct(self, Pixel, pixel); \
597
- return INT2NUM(pixel->_rgb_channel_); \
598
- }
599
-
600
-
601
- /*
602
- * Enum constants - define a subclass of Enum for the specified enumeration.
603
- * Define an instance of the subclass for each member in the enumeration.
604
- * Initialize each instance with its name and value.
605
- */
606
- //! define Ruby enum
607
- #define DEF_ENUM(tag) {\
608
- VALUE _cls, _enum;\
609
- _cls = Class_##tag = rm_define_enum_type(#tag);
610
-
611
- //! define Ruby enumerator elements
612
- #define ENUMERATOR(val)\
613
- _enum = rm_enum_new(_cls, ID2SYM(rb_intern(#val)), INT2NUM(val));\
614
- rb_define_const(Module_Magick, #val, _enum);
615
- //! end of an enumerator
616
- #define END_ENUM }
617
455
 
618
456
  //! Define a Magick module constant
619
457
  #if MAGICKCORE_QUANTUM_DEPTH == 64
@@ -634,9 +472,6 @@ Pixel_##_cmyk_channel_(VALUE self) \
634
472
  e = (type)(magick_enum->val);\
635
473
  } while(0)
636
474
 
637
- //! create case statement, mapping enum to its name
638
- #define ENUM_TO_NAME(_enum) case _enum: return #_enum;
639
-
640
475
 
641
476
  // Method, external function declarations. These declarations are
642
477
  // grouped by the source file in which the methods are defined.
@@ -1015,6 +850,7 @@ extern VALUE Image_flop_bang(VALUE);
1015
850
  extern VALUE Image_frame(int, VALUE *, VALUE);
1016
851
  extern VALUE Image_from_blob(VALUE, VALUE);
1017
852
  extern VALUE Image_function_channel(int, VALUE *, VALUE);
853
+ extern VALUE Image_fx(int, VALUE *, VALUE);
1018
854
  extern VALUE Image_gamma_channel(int, VALUE *, VALUE);
1019
855
  extern VALUE Image_gamma_correct(int, VALUE *, VALUE);
1020
856
  extern VALUE Image_gaussian_blur(int, VALUE *, VALUE);
@@ -1198,27 +1034,41 @@ extern VALUE Enum_case_eq(VALUE, VALUE);
1198
1034
  extern VALUE Enum_type_initialize(VALUE, VALUE, VALUE);
1199
1035
  extern VALUE Enum_type_each(VALUE);
1200
1036
  extern VALUE rm_enum_new(VALUE, VALUE, VALUE);
1201
-
1202
-
1203
- // rmstruct.c
1204
- extern VALUE ChromaticityInfo_to_s(VALUE);
1205
- extern VALUE ChromaticityInfo_new(ChromaticityInfo *);
1206
- extern void Color_to_PixelPacket(PixelPacket *, VALUE);
1207
- extern void Color_to_MagickPixelPacket(Image *, MagickPixelPacket *, VALUE);
1208
- extern VALUE Color_to_s(VALUE);
1209
- extern VALUE Import_ColorInfo(const ColorInfo *);
1210
1037
  extern VALUE ClassType_new(ClassType);
1211
1038
  extern VALUE ColorspaceType_new(ColorspaceType);
1039
+ extern const char *ComplianceType_name(ComplianceType *);
1040
+ extern VALUE ComplianceType_new(ComplianceType);
1212
1041
  extern VALUE CompositeOperator_new(CompositeOperator);
1213
1042
  extern VALUE CompressionType_new(CompressionType);
1214
1043
  extern VALUE DisposeType_new(DisposeType);
1215
1044
  extern VALUE EndianType_new(EndianType);
1216
1045
  extern VALUE FilterTypes_new(FilterTypes);
1217
1046
  extern VALUE GravityType_new(GravityType);
1218
- extern VALUE Font_to_s(VALUE);
1047
+ extern VALUE ImageLayerMethod_new(ImageLayerMethod);
1219
1048
  extern VALUE ImageType_new(ImageType);
1220
1049
  extern VALUE InterlaceType_new(InterlaceType);
1221
- extern VALUE Pixel_from_MagickPixelPacket(const MagickPixelPacket *);
1050
+ extern VALUE InterpolatePixelMethod_new(InterpolatePixelMethod);
1051
+ extern VALUE OrientationType_new(OrientationType);
1052
+ extern VALUE RenderingIntent_new(RenderingIntent);
1053
+ extern VALUE ResolutionType_new(ResolutionType);
1054
+ extern const char *StorageType_name(StorageType);
1055
+ extern VALUE StretchType_new(StretchType);
1056
+ extern const char *StretchType_name(StretchType);
1057
+ extern VALUE StyleType_new(StyleType);
1058
+ extern const char *StyleType_name(StyleType);
1059
+ extern VALUE VirtualPixelMethod_new(VirtualPixelMethod);
1060
+
1061
+
1062
+ // rmstruct.c
1063
+ extern VALUE ChromaticityInfo_to_s(VALUE);
1064
+ extern VALUE ChromaticityInfo_new(ChromaticityInfo *);
1065
+ extern void Color_to_PixelColor(PixelColor *, VALUE);
1066
+ extern void Color_to_MagickPixel(Image *, MagickPixel *, VALUE);
1067
+ extern VALUE Color_to_s(VALUE);
1068
+ extern VALUE Import_ColorInfo(const ColorInfo *);
1069
+ extern VALUE Font_to_s(VALUE);
1070
+ extern VALUE Pixel_from_MagickPixel(const MagickPixel *);
1071
+ extern VALUE Pixel_from_PixelColor(const PixelColor *);
1222
1072
  extern VALUE Pixel_from_PixelPacket(const PixelPacket *);
1223
1073
  extern void Export_PointInfo(PointInfo *, VALUE);
1224
1074
  extern VALUE Import_PointInfo(PointInfo *);
@@ -1226,16 +1076,12 @@ extern VALUE PrimaryInfo_to_s(VALUE);
1226
1076
  extern VALUE Import_PrimaryInfo(PrimaryInfo *);
1227
1077
  extern VALUE RectangleInfo_to_s(VALUE);
1228
1078
  extern VALUE Import_RectangleInfo(RectangleInfo *);
1229
- extern VALUE RenderingIntent_new(RenderingIntent);
1230
- extern VALUE ResolutionType_new(ResolutionType);
1231
1079
  extern VALUE SegmentInfo_to_s(VALUE);
1232
1080
  extern VALUE Import_SegmentInfo(SegmentInfo *);
1233
1081
  extern void Export_AffineMatrix(AffineMatrix *, VALUE);
1234
1082
  extern VALUE Import_AffineMatrix(AffineMatrix *);
1235
1083
  extern void Export_ChromaticityInfo(ChromaticityInfo *, VALUE);
1236
1084
  extern void Export_ColorInfo(ColorInfo *, VALUE);
1237
- extern VALUE InterpolatePixelMethod_new(InterpolatePixelMethod);
1238
- extern VALUE OrientationType_new(OrientationType);
1239
1085
  extern void Export_PrimaryInfo(PrimaryInfo *, VALUE);
1240
1086
  extern void Export_RectangleInfo(RectangleInfo *, VALUE);
1241
1087
  extern void Export_SegmentInfo(SegmentInfo *, VALUE);
@@ -1245,9 +1091,6 @@ extern VALUE Import_TypeInfo(const TypeInfo *);
1245
1091
  extern VALUE TypeMetric_to_s(VALUE);
1246
1092
  extern void Export_TypeInfo(TypeInfo *, VALUE);
1247
1093
  extern VALUE Import_TypeMetric(TypeMetric *);
1248
- extern const char *StorageType_name(StorageType);
1249
- extern VALUE VirtualPixelMethod_new(VirtualPixelMethod);
1250
- extern VALUE LAYERMETHODTYPE_NEW(LAYERMETHODTYPE);
1251
1094
 
1252
1095
 
1253
1096
  // rmutil.c
@@ -1258,13 +1101,17 @@ extern void magick_free(void *);
1258
1101
  extern void *magick_realloc(void *, const size_t);
1259
1102
  extern void *magick_safe_realloc(void *, const size_t, const size_t);
1260
1103
  extern void magick_clone_string(char **, const char *);
1104
+ extern Image *rm_acquire_image(ImageInfo *);
1261
1105
  extern VALUE rm_cur_image(VALUE);
1262
- extern VALUE rm_pixelpacket_to_color_name(Image *, PixelPacket *);
1263
- extern VALUE rm_pixelpacket_to_color_name_info(Info *, PixelPacket *);
1106
+ extern VALUE rm_pixelcolor_to_color_name(Image *, PixelColor *);
1107
+ extern VALUE rm_pixelcolor_to_color_name_info(Info *, PixelColor *);
1108
+ extern void rm_init_magickpixel(const Image *, MagickPixel *);
1109
+ extern void rm_set_magickpixel(MagickPixel *, const char *);
1264
1110
  extern VALUE rm_no_freeze(VALUE);
1265
1111
  extern int rm_strcasecmp(const char *, const char *);
1266
1112
  extern int rm_strncasecmp(const char *, const char *, size_t);
1267
1113
  extern void rm_check_ary_len(VALUE, long);
1114
+ extern VALUE rm_check_ary_type(VALUE ary);
1268
1115
  extern Image *rm_check_destroyed(VALUE);
1269
1116
  extern Image *rm_check_frozen(VALUE);
1270
1117
  extern VALUE rm_to_s(VALUE);
@@ -1283,10 +1130,9 @@ extern void rm_get_geometry(VALUE, long *, long *, unsigned long *, unsigned l
1283
1130
  extern const char *rm_get_property(const Image *, const char *);
1284
1131
  extern MagickBooleanType rm_set_property(Image *, const char *, const char *);
1285
1132
  extern void rm_set_user_artifact(Image *, Info *);
1286
- void rm_set_magick_pixel_packet(Pixel *, MagickPixelPacket *);
1287
1133
  extern void rm_sync_image_options(Image *, Info *);
1288
1134
  extern void rm_split(Image *);
1289
- extern void rm_magick_error(const char *, const char *);
1135
+ extern void rm_magick_error(const char *);
1290
1136
 
1291
1137
  //! whether to retain on errors
1292
1138
  typedef enum
@@ -1295,6 +1141,12 @@ typedef enum
1295
1141
  DestroyOnError = 1 /**< do not retain on error */
1296
1142
  } ErrorRetention;
1297
1143
 
1144
+ typedef enum
1145
+ {
1146
+ RetainExceptionRetention,
1147
+ DestroyExceptionRetention
1148
+ } ExceptionRetention;
1149
+
1298
1150
  extern void rm_check_image_exception(Image *, ErrorRetention);
1299
1151
  extern void rm_check_exception(ExceptionInfo *, Image *, ErrorRetention);
1300
1152
  extern void rm_ensure_result(Image *);
@@ -1306,5 +1158,7 @@ extern void rm_get_optional_arguments(VALUE);
1306
1158
  extern void rm_fatal_error_handler(const ExceptionType, const char *, const char *);
1307
1159
  extern void rm_error_handler(const ExceptionType, const char *, const char *);
1308
1160
  extern void rm_warning_handler(const ExceptionType, const char *, const char *);
1161
+ extern MagickBooleanType rm_should_raise_exception(ExceptionInfo *, const ExceptionRetention);
1162
+ extern void rm_raise_exception(ExceptionInfo *);
1309
1163
  #endif
1310
1164