rmagick 2.9.2 → 2.10.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.

@@ -1,4 +1,4 @@
1
- /* $Id: rmdraw.c,v 1.77 2009/02/28 23:50:35 rmagick Exp $ */
1
+ /* $Id: rmdraw.c,v 1.80 2009/06/19 22:07:40 rmagick Exp $ */
2
2
  /*============================================================================\
3
3
  | Copyright (C) 2009 by Timothy P. Hunter
4
4
  | Name: rmdraw.c
@@ -774,11 +774,7 @@ VALUE Draw_annotate(
774
774
  }
775
775
 
776
776
  // Translate & store in Draw structure
777
- #if defined(HAVE_INTERPRETIMAGEPROPERTIES)
778
777
  draw->info->text = InterpretImageProperties(NULL, image, StringValuePtr(text));
779
- #else
780
- draw->info->text = InterpretImageAttributes(NULL, image, StringValuePtr(text));
781
- #endif
782
778
  if (!draw->info->text)
783
779
  {
784
780
  rb_raise(rb_eArgError, "no text");
@@ -885,15 +881,17 @@ Draw_composite(int argc, VALUE *argv, VALUE self)
885
881
  case BlendCompositeOp:
886
882
  op = "Blend";
887
883
  break;
884
+ #if defined(HAVE_ENUM_BLURCOMPOSITEOP)
885
+ case BlurCompositeOp:
886
+ op = "Blur";
887
+ break;
888
+ #endif
888
889
  case BumpmapCompositeOp:
889
890
  op = "Bumpmap";
890
891
  break;
891
-
892
- #if defined(HAVE_ENUM_CHANGEMASKCOMPOSITEOP)
893
892
  case ChangeMaskCompositeOp:
894
893
  op = "ChangeMask";
895
894
  break;
896
- #endif
897
895
  case ClearCompositeOp:
898
896
  op = "Clear";
899
897
  break;
@@ -936,11 +934,14 @@ Draw_composite(int argc, VALUE *argv, VALUE self)
936
934
  case DarkenCompositeOp:
937
935
  op = "Darken";
938
936
  break;
939
- #if defined(HAVE_ENUM_DIVIDECOMPOSITEOP)
937
+ #if defined(HAVE_ENUM_DISTORTCOMPOSITEOP)
938
+ case DistortCompositeOp:
939
+ op = "Distort";
940
+ break;
941
+ #endif
940
942
  case DivideCompositeOp:
941
943
  op = "Divide";
942
944
  break;
943
- #endif
944
945
  case DstCompositeOp:
945
946
  op = "Dst";
946
947
  break;
@@ -980,11 +981,9 @@ Draw_composite(int argc, VALUE *argv, VALUE self)
980
981
  case LightenCompositeOp:
981
982
  op = "Lighten";
982
983
  break;
983
- #if defined(HAVE_ENUM_LINEARLIGHTCOMPOSITEOP)
984
984
  case LinearLightCompositeOp:
985
985
  op = "LinearLight";
986
986
  break;
987
- #endif
988
987
  case LuminizeCompositeOp:
989
988
  op = "Luminize";
990
989
  break;
@@ -1565,11 +1564,7 @@ get_type_metrics(
1565
1564
  }
1566
1565
 
1567
1566
  Data_Get_Struct(self, Draw, draw);
1568
- #if defined(HAVE_INTERPRETIMAGEPROPERTIES)
1569
1567
  draw->info->text = InterpretImageProperties(NULL, image, text);
1570
- #else
1571
- draw->info->text = InterpretImageAttributes(NULL, image, text);
1572
- #endif
1573
1568
  if (!draw->info->text)
1574
1569
  {
1575
1570
  rb_raise(rb_eArgError, "no text to measure");
@@ -1,4 +1,4 @@
1
- /* $Id: rmenum.c,v 1.3 2009/03/18 22:40:41 rmagick Exp $ */
1
+ /* $Id: rmenum.c,v 1.6 2009/06/19 22:07:40 rmagick Exp $ */
2
2
  /*============================================================================\
3
3
  | Copyright (C) 2009 by Timothy P. Hunter
4
4
  | Name: rmenum.c
@@ -352,11 +352,9 @@ ColorspaceType_new(ColorspaceType cs)
352
352
  case LogColorspace:
353
353
  name = "LogColorspace";
354
354
  break;
355
- #if defined(HAVE_ENUM_CMYCOLORSPACE)
356
355
  case CMYColorspace:
357
356
  name = "CMYColorspace";
358
357
  break;
359
- #endif
360
358
  }
361
359
 
362
360
  return rm_enum_new(Class_ColorspaceType, ID2SYM(rb_intern(name)), INT2FIX(cs));
@@ -377,10 +375,11 @@ CompositeOperator_name(CompositeOperator op)
377
375
  ENUM_TO_NAME(NoCompositeOp)
378
376
  ENUM_TO_NAME(AddCompositeOp)
379
377
  ENUM_TO_NAME(AtopCompositeOp)
378
+ #if defined(HAVE_ENUM_BLURCOMPOSITEOP)
379
+ ENUM_TO_NAME(BlurCompositeOp)
380
+ #endif
380
381
  ENUM_TO_NAME(BumpmapCompositeOp)
381
- #if defined(HAVE_ENUM_CHANGEMASKCOMPOSITEOP)
382
382
  ENUM_TO_NAME(ChangeMaskCompositeOp)
383
- #endif
384
383
  ENUM_TO_NAME(ClearCompositeOp)
385
384
  ENUM_TO_NAME(ColorBurnCompositeOp)
386
385
  ENUM_TO_NAME(BlendCompositeOp)
@@ -399,9 +398,10 @@ CompositeOperator_name(CompositeOperator op)
399
398
  ENUM_TO_NAME(CopyOpacityCompositeOp)
400
399
  ENUM_TO_NAME(CopyRedCompositeOp)
401
400
  ENUM_TO_NAME(DarkenCompositeOp)
402
- #if defined(HAVE_ENUM_DIVIDECOMPOSITEOP)
403
- ENUM_TO_NAME(DivideCompositeOp)
401
+ #if defined(HAVE_ENUM_DISTORTCOMPOSITEOP)
402
+ ENUM_TO_NAME(DistortCompositeOp)
404
403
  #endif
404
+ ENUM_TO_NAME(DivideCompositeOp)
405
405
  ENUM_TO_NAME(DstAtopCompositeOp)
406
406
  ENUM_TO_NAME(DstCompositeOp)
407
407
  ENUM_TO_NAME(DstInCompositeOp)
@@ -413,9 +413,7 @@ CompositeOperator_name(CompositeOperator op)
413
413
  ENUM_TO_NAME(HueCompositeOp)
414
414
  ENUM_TO_NAME(InCompositeOp)
415
415
  ENUM_TO_NAME(LightenCompositeOp)
416
- #if defined(HAVE_ENUM_LINEARLIGHTCOMPOSITEOP)
417
416
  ENUM_TO_NAME(LinearLightCompositeOp)
418
- #endif
419
417
  ENUM_TO_NAME(LuminizeCompositeOp)
420
418
  ENUM_TO_NAME(MinusCompositeOp)
421
419
  ENUM_TO_NAME(ModulateCompositeOp)
@@ -714,15 +712,9 @@ InterlaceType_name(InterlaceType interlace)
714
712
  switch(interlace)
715
713
  {
716
714
  ENUM_TO_NAME(UndefinedInterlace)
717
- #if defined(HAVE_ENUM_GIFINTERLACE)
718
715
  ENUM_TO_NAME(GIFInterlace)
719
- #endif
720
- #if defined(HAVE_ENUM_JPEGINTERLACE)
721
716
  ENUM_TO_NAME(JPEGInterlace)
722
- #endif
723
- #if defined(HAVE_ENUM_PNGINTERLACE)
724
717
  ENUM_TO_NAME(PNGInterlace)
725
- #endif
726
718
  ENUM_TO_NAME(NoInterlace)
727
719
  ENUM_TO_NAME(LineInterlace)
728
720
  ENUM_TO_NAME(PlaneInterlace)
@@ -762,9 +754,7 @@ InterpolatePixelMethod_name(InterpolatePixelMethod interpolate)
762
754
  ENUM_TO_NAME(IntegerInterpolatePixel)
763
755
  ENUM_TO_NAME(MeshInterpolatePixel)
764
756
  ENUM_TO_NAME(NearestNeighborInterpolatePixel)
765
- #if defined(HAVE_ENUM_SPLINEINTERPOLATEPIXEL)
766
757
  ENUM_TO_NAME(SplineInterpolatePixel)
767
- #endif
768
758
  }
769
759
 
770
760
  return "UndefinedInterpolatePixel";
@@ -800,21 +790,11 @@ LAYERMETHODTYPE_NAME(LAYERMETHODTYPE method)
800
790
  ENUM_TO_NAME(OptimizePlusLayer)
801
791
  ENUM_TO_NAME(CoalesceLayer)
802
792
  ENUM_TO_NAME(DisposeLayer)
803
- #if defined(HAVE_ENUM_OPTIMIZETRANSLAYER)
804
793
  ENUM_TO_NAME(OptimizeTransLayer)
805
- #endif
806
- #if defined(HAVE_ENUM_OPTIMIZEIMAGELAYER)
807
794
  ENUM_TO_NAME(OptimizeImageLayer)
808
- #endif
809
- #if defined(HAVE_ENUM_REMOVEDUPSLAYER)
810
795
  ENUM_TO_NAME(RemoveDupsLayer)
811
- #endif
812
- #if defined(HAVE_ENUM_REMOVEZEROLAYER)
813
796
  ENUM_TO_NAME(RemoveZeroLayer)
814
- #endif
815
- #if defined(HAVE_ENUM_COMPOSITELAYER)
816
797
  ENUM_TO_NAME(CompositeLayer)
817
- #endif
818
798
  #if defined(HAVE_ENUM_MERGELAYER)
819
799
  ENUM_TO_NAME(MergeLayer)
820
800
  #endif
@@ -980,18 +960,10 @@ VirtualPixelMethod_name(VirtualPixelMethod method)
980
960
  ENUM_TO_NAME(DitherVirtualPixelMethod)
981
961
  ENUM_TO_NAME(RandomVirtualPixelMethod)
982
962
  ENUM_TO_NAME(ConstantVirtualPixelMethod)
983
- #if defined(HAVE_ENUM_MASKVIRTUALPIXELMETHOD)
984
963
  ENUM_TO_NAME(MaskVirtualPixelMethod)
985
- #endif
986
- #if defined(HAVE_ENUM_BLACKVIRTUALPIXELMETHOD)
987
964
  ENUM_TO_NAME(BlackVirtualPixelMethod)
988
- #endif
989
- #if defined(HAVE_ENUM_GRAYVIRTUALPIXELMETHOD)
990
965
  ENUM_TO_NAME(GrayVirtualPixelMethod)
991
- #endif
992
- #if defined(HAVE_ENUM_WHITEVIRTUALPIXELMETHOD)
993
966
  ENUM_TO_NAME(WhiteVirtualPixelMethod)
994
- #endif
995
967
  #if defined(HAVE_ENUM_HORIZONTALTILEVIRTUALPIXELMETHOD)
996
968
  ENUM_TO_NAME(HorizontalTileVirtualPixelMethod)
997
969
  #endif
@@ -1,4 +1,4 @@
1
- /* $Id: rmilist.c,v 1.91 2009/02/28 23:50:35 rmagick Exp $ */
1
+ /* $Id: rmilist.c,v 1.92 2009/06/03 23:08:30 rmagick Exp $ */
2
2
  /*============================================================================\
3
3
  | Copyright (C) 2009 by Timothy P. Hunter
4
4
  | Name: rmilist.c
@@ -160,7 +160,6 @@ ImageList_coalesce(VALUE self)
160
160
  VALUE
161
161
  ImageList_composite_layers(int argc, VALUE *argv, VALUE self)
162
162
  {
163
- #if defined(HAVE_COMPOSITELAYERS)
164
163
  volatile VALUE source_images;
165
164
  Image *dest, *source, *new_images;
166
165
  RectangleInfo geometry;
@@ -202,16 +201,6 @@ ImageList_composite_layers(int argc, VALUE *argv, VALUE self)
202
201
  (void) DestroyExceptionInfo(&exception);
203
202
 
204
203
  return rm_imagelist_from_images(new_images);
205
-
206
- #else
207
-
208
- self = self;
209
- argc = argc;
210
- argv = argv;
211
- rm_not_implemented();
212
- return (VALUE)0;
213
-
214
- #endif
215
204
  }
216
205
 
217
206
 
@@ -540,31 +529,22 @@ ImageList_optimize_layers(VALUE self, VALUE method)
540
529
  case DisposeLayer:
541
530
  new_images = DisposeImages(images, &exception);
542
531
  break;
543
- #if defined(HAVE_ENUM_OPTIMIZETRANSLAYER)
544
532
  case OptimizeTransLayer:
545
533
  new_images = clone_imagelist(images);
546
534
  OptimizeImageTransparency(new_images, &exception);
547
535
  break;
548
- #endif
549
- #if defined(HAVE_ENUM_REMOVEDUPSLAYER)
550
536
  case RemoveDupsLayer:
551
537
  new_images = clone_imagelist(images);
552
538
  RemoveDuplicateLayers(&new_images, &exception);
553
539
  break;
554
- #endif
555
- #if defined(HAVE_ENUM_REMOVEZEROLAYER)
556
540
  case RemoveZeroLayer:
557
541
  new_images = clone_imagelist(images);
558
542
  RemoveZeroDelayLayers(&new_images, &exception);
559
543
  break;
560
- #endif
561
- #if defined(HAVE_ENUM_COMPOSITELAYER)
562
544
  case CompositeLayer:
563
545
  rm_split(images);
564
546
  rb_raise(rb_eNotImpError, "Magick::CompositeLayer is not supported. Use the composite_layers method instead.");
565
547
  break;
566
- #endif
567
- #if defined(HAVE_ENUM_OPTIMIZEIMAGELAYER)
568
548
  // In 6.3.4-ish, OptimizeImageLayer replaced OptimizeLayer
569
549
  case OptimizeImageLayer:
570
550
  new_images = OptimizeImageLayers(images, &exception);
@@ -583,11 +563,6 @@ ImageList_optimize_layers(VALUE self, VALUE method)
583
563
  // mogrify supports -dither here. We don't.
584
564
  (void) MapImages(new_images, NULL, 0);
585
565
  break;
586
- #else
587
- case OptimizeLayer:
588
- new_images = OptimizeImageLayers(images, &exception);
589
- break;
590
- #endif
591
566
  case OptimizePlusLayer:
592
567
  new_images = OptimizePlusImageLayers(images, &exception);
593
568
  break;
@@ -1,4 +1,4 @@
1
- /* $Id: rmimage.c,v 1.346 2009/03/04 00:35:19 rmagick Exp $ */
1
+ /* $Id: rmimage.c,v 1.349 2009/06/05 22:30:40 rmagick Exp $ */
2
2
  /*============================================================================\
3
3
  | Copyright (C) 2009 by Timothy P. Hunter
4
4
  | Name: rmimage.c
@@ -284,22 +284,8 @@ Image_add_compose_mask(VALUE self, VALUE mask)
284
284
 
285
285
  // Delete any previously-existing mask image.
286
286
  // Store a clone of the new mask image.
287
- #if defined(HAVE_SETIMAGEMASK)
288
287
  (void) SetImageMask(image, mask_image);
289
288
  (void) NegateImage(image->mask, MagickFalse);
290
- #else
291
- if (image->clip_mask)
292
- {
293
- image->clip_mask = DestroyImage(image->clip_mask);
294
- }
295
- image->clip_mask = NewImageList();
296
- if (SetImageStorageClass(image, DirectClass) == MagickFalse)
297
- {
298
- rm_magick_error("SetImageStorageClass failed", NULL);
299
- }
300
- image->clip_mask = rm_clone_image(mask_image);
301
- (void) NegateImage(image->clip_mask, MagickFalse);
302
- #endif
303
289
 
304
290
  // Since both Set and GetImageMask clone the mask image I don't see any
305
291
  // way to negate the mask without referencing it directly. Sigh.
@@ -403,15 +389,11 @@ Image_add_profile(VALUE self, VALUE name)
403
389
  {
404
390
  rb_raise(rb_eNoMemError, "not enough memory to continue");
405
391
  }
406
- #if defined(HAVE_ST_PROFILE)
407
392
  profile = GetImageProfile(image, "iptc");
408
393
  if (profile)
409
394
  {
410
395
  info->profile = (void *)CloneStringInfo(profile);
411
396
  }
412
- #else
413
- info->client_data = GetImageProfile(image, "8bim");
414
- #endif
415
397
  strncpy(info->filename, profile_filename, min((size_t)profile_filename_l, sizeof(info->filename)));
416
398
  info->filename[MaxTextExtent-1] = '\0';
417
399
 
@@ -462,7 +444,6 @@ Image_add_profile(VALUE self, VALUE name)
462
444
  VALUE
463
445
  Image_alpha(int argc, VALUE *argv, VALUE self)
464
446
  {
465
- #if defined(HAVE_TYPE_ALPHACHANNELTYPE)
466
447
  Image *image;
467
448
  AlphaChannelType alpha;
468
449
 
@@ -516,14 +497,6 @@ Image_alpha(int argc, VALUE *argv, VALUE self)
516
497
  #endif
517
498
 
518
499
  return argv[0];
519
-
520
- #else // HAVE_ALPHACHANNELTYPE
521
- argc = argc;
522
- argv =argv;
523
- self = self;
524
- rm_not_implemented();
525
- return(VALUE)0;
526
- #endif
527
500
  }
528
501
 
529
502
 
@@ -555,17 +528,10 @@ Image_alpha_q(VALUE self)
555
528
  VALUE
556
529
  Image_alpha_eq(VALUE self, VALUE type)
557
530
  {
558
- #if defined(HAVE_TYPE_ALPHACHANNELTYPE)
559
531
  VALUE argv[1];
560
532
  argv[0] = type;
561
533
  Image_alpha(1, argv, self);
562
534
  return type;
563
- #else
564
- self = self;
565
- type = type;
566
- rm_not_implemented();
567
- return(VALUE)0;
568
- #endif
569
535
  }
570
536
 
571
537
 
@@ -1814,7 +1780,6 @@ Image_clone(VALUE self)
1814
1780
  VALUE
1815
1781
  Image_clut_channel(int argc, VALUE *argv, VALUE self)
1816
1782
  {
1817
- #if defined(HAVE_CLUTIMAGECHANNEL)
1818
1783
  Image *image, *clut;
1819
1784
  ChannelType channels;
1820
1785
  MagickBooleanType okay;
@@ -1847,14 +1812,6 @@ Image_clut_channel(int argc, VALUE *argv, VALUE self)
1847
1812
  }
1848
1813
 
1849
1814
  return self;
1850
-
1851
- #else
1852
- argc = argc;
1853
- argv = argv;
1854
- self = self;
1855
- rm_not_implemented();
1856
- return(VALUE)0;
1857
- #endif
1858
1815
  }
1859
1816
 
1860
1817
 
@@ -3437,18 +3394,8 @@ Image_delete_compose_mask(VALUE self)
3437
3394
  Image *image = rm_check_frozen(self);
3438
3395
 
3439
3396
  // Store a clone of the mask image
3440
- #if defined(HAVE_SETIMAGEMASK)
3441
- {
3442
- (void) SetImageMask(image, NULL);
3443
- rm_check_image_exception(image, RetainOnError);
3444
- }
3445
- #else
3446
- if (image->clip_mask)
3447
- {
3448
- image->clip_mask = DestroyImage(image->clip_mask);
3449
- }
3450
- image->clip_mask = NewImageList();
3451
- #endif
3397
+ (void) SetImageMask(image, NULL);
3398
+ rm_check_image_exception(image, RetainOnError);
3452
3399
 
3453
3400
  return self;
3454
3401
  }
@@ -3898,7 +3845,6 @@ Image_dissolve(int argc, VALUE *argv, VALUE self)
3898
3845
  VALUE
3899
3846
  Image_distort(int argc, VALUE *argv, VALUE self)
3900
3847
  {
3901
- #if defined(HAVE_DISTORTIMAGE)
3902
3848
  Image *image, *new_image;
3903
3849
  volatile VALUE pts;
3904
3850
  unsigned long n, npoints;
@@ -3942,13 +3888,6 @@ Image_distort(int argc, VALUE *argv, VALUE self)
3942
3888
  rm_ensure_result(new_image);
3943
3889
 
3944
3890
  return rm_image_new(new_image);
3945
- #else
3946
- self = self; // defeat "unused parameter" message
3947
- argv = argv;
3948
- argc = argc;
3949
- rm_not_implemented();
3950
- return(VALUE)0;
3951
- #endif
3952
3891
  }
3953
3892
 
3954
3893
 
@@ -4382,7 +4321,6 @@ Image_erase_bang(VALUE self)
4382
4321
  static VALUE
4383
4322
  excerpt(int bang, VALUE self, VALUE x, VALUE y, VALUE width, VALUE height)
4384
4323
  {
4385
- #if defined(HAVE_EXCERPTIMAGE)
4386
4324
  Image *image, *new_image;
4387
4325
  RectangleInfo rect;
4388
4326
  ExceptionInfo exception;
@@ -4409,14 +4347,6 @@ excerpt(int bang, VALUE self, VALUE x, VALUE y, VALUE width, VALUE height)
4409
4347
  }
4410
4348
 
4411
4349
  return rm_image_new(new_image);
4412
-
4413
- #else
4414
- bang = bang; self = self;
4415
- x = x; y = y;
4416
- width = width; height = height;
4417
- rm_not_implemented();
4418
- return(VALUE)0;
4419
- #endif
4420
4350
  }
4421
4351
 
4422
4352
 
@@ -4525,7 +4455,6 @@ Image_export_pixels(int argc, VALUE *argv, VALUE self)
4525
4455
  VALUE
4526
4456
  Image_extent(int argc, VALUE *argv, VALUE self)
4527
4457
  {
4528
- #if defined(HAVE_EXTENTIMAGE)
4529
4458
  Image *image, *new_image;
4530
4459
  RectangleInfo geometry;
4531
4460
  long height, width;
@@ -4574,13 +4503,6 @@ Image_extent(int argc, VALUE *argv, VALUE self)
4574
4503
  (void) DestroyExceptionInfo(&exception);
4575
4504
  rm_ensure_result(new_image);
4576
4505
  return rm_image_new(new_image);
4577
- #else
4578
- argc = argc;
4579
- argv = argv;
4580
- self = self;
4581
- rm_not_implemented();
4582
- return(VALUE)0;
4583
- #endif
4584
4506
  }
4585
4507
 
4586
4508
 
@@ -5346,13 +5268,7 @@ Image_gray_q(VALUE self)
5346
5268
  VALUE
5347
5269
  Image_histogram_q(VALUE self)
5348
5270
  {
5349
- #if defined(HAVE_ISHISTOGRAMIMAGE)
5350
5271
  return has_attribute(self, IsHistogramImage);
5351
- #else
5352
- self = self;
5353
- rm_not_implemented();
5354
- return(VALUE)0;
5355
- #endif
5356
5272
  }
5357
5273
 
5358
5274
 
@@ -6020,7 +5936,6 @@ Image_levelize_channel(int argc, VALUE *argv, VALUE self)
6020
5936
  VALUE
6021
5937
  Image_linear_stretch(int argc, VALUE *argv, VALUE self)
6022
5938
  {
6023
- #if defined(HAVE_LINEARSTRETCHIMAGE)
6024
5939
  Image *image, *new_image;
6025
5940
  double black_point, white_point;
6026
5941
 
@@ -6032,13 +5947,6 @@ Image_linear_stretch(int argc, VALUE *argv, VALUE self)
6032
5947
  rm_check_image_exception(new_image, DestroyOnError);
6033
5948
 
6034
5949
  return rm_image_new(new_image);
6035
- #else
6036
- argc = argc; // defeat "unused parameter" messages
6037
- argv = argv;
6038
- self = self;
6039
- rm_not_implemented();
6040
- return(VALUE)0;
6041
- #endif
6042
5950
  }
6043
5951
 
6044
5952
 
@@ -6519,7 +6427,7 @@ Image_matte(VALUE self)
6519
6427
  VALUE
6520
6428
  Image_matte_eq(VALUE self, VALUE matte)
6521
6429
  {
6522
- #if defined(HAVE_TYPE_ALPHACHANNELTYPE) || defined(HAVE_SETIMAGEALPHACHANNEL)
6430
+ #if defined(HAVE_SETIMAGEALPHACHANNEL)
6523
6431
  VALUE alpha_channel_type;
6524
6432
 
6525
6433
  if (RTEST(matte))
@@ -7656,7 +7564,6 @@ Image_pixel_interpolation_method_eq(VALUE self, VALUE method)
7656
7564
  VALUE
7657
7565
  Image_polaroid(int argc, VALUE *argv, VALUE self)
7658
7566
  {
7659
- #if defined(HAVE_POLAROIDIMAGE)
7660
7567
  Image *image, *clone, *new_image;
7661
7568
  volatile VALUE options;
7662
7569
  double angle = -5.0;
@@ -7693,13 +7600,6 @@ Image_polaroid(int argc, VALUE *argv, VALUE self)
7693
7600
  rm_ensure_result(new_image);
7694
7601
 
7695
7602
  return rm_image_new(new_image);
7696
- #else
7697
- argc = argc; // defeat "unused parameter" messages
7698
- argv = argv;
7699
- self = self;
7700
- rm_not_implemented();
7701
- return(VALUE)0;
7702
- #endif
7703
7603
  }
7704
7604
 
7705
7605
 
@@ -8268,7 +8168,6 @@ rd_image(VALUE class, VALUE file, reader_t reader)
8268
8168
  VALUE
8269
8169
  Image_recolor(VALUE self, VALUE color_matrix)
8270
8170
  {
8271
- #if defined(HAVE_RECOLORIMAGE)
8272
8171
  Image *image, *new_image;
8273
8172
  unsigned long order;
8274
8173
  long x, len;
@@ -8297,13 +8196,6 @@ Image_recolor(VALUE self, VALUE color_matrix)
8297
8196
  (void) DestroyExceptionInfo(&exception);
8298
8197
 
8299
8198
  return rm_image_new(new_image);
8300
-
8301
- #else
8302
- self = self; // defeat "unused parameter" message
8303
- color_matrix = color_matrix;
8304
- rm_not_implemented();
8305
- return(VALUE)0;
8306
- #endif
8307
8199
  }
8308
8200
 
8309
8201
 
@@ -8811,6 +8703,54 @@ scale(int bang, int argc, VALUE *argv, VALUE self, scaler_t scaler)
8811
8703
  DEF_ATTR_READER(Image, scene, ulong)
8812
8704
 
8813
8705
 
8706
+ /*
8707
+ * Method: Image#selective_blur_channel(radius, sigma, threshold[, channel...])
8708
+ * Purpose: Call SelectiveBlurImageChannel
8709
+ */
8710
+ VALUE
8711
+ Image_selective_blur_channel(int argc, VALUE *argv, VALUE self)
8712
+ {
8713
+ #if defined(HAVE_SELECTIVEBLURIMAGECHANNEL)
8714
+ Image *image, *new_image;
8715
+ double radius, sigma, threshold;
8716
+ ExceptionInfo exception;
8717
+ ChannelType channels;
8718
+
8719
+ image = rm_check_destroyed(self);
8720
+ channels = extract_channels(&argc, argv);
8721
+ if (argc > 3)
8722
+ {
8723
+ raise_ChannelType_error(argv[argc-1]);
8724
+ }
8725
+ if (argc != 3)
8726
+ {
8727
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 3 or more)", argc);
8728
+ }
8729
+ radius = NUM2DBL(argv[0]);
8730
+ sigma = NUM2DBL(argv[1]);
8731
+
8732
+ // threshold is either a floating-point number or a string in the form "NN%".
8733
+ // Either way it's supposed to represent a percentage of the QuantumRange.
8734
+ threshold = rm_percentage(argv[2]) * QuantumRange;
8735
+
8736
+ GetExceptionInfo(&exception);
8737
+ new_image = SelectiveBlurImageChannel(image, channels, radius, sigma, threshold, &exception);
8738
+ rm_check_exception(&exception, new_image, DestroyOnError);
8739
+ (void) DestroyExceptionInfo(&exception);
8740
+ rm_ensure_result(new_image);
8741
+
8742
+ return rm_image_new(new_image);
8743
+
8744
+ #else
8745
+ rm_not_implemented();
8746
+ argc = argc;
8747
+ argv = argv;
8748
+ self = self;
8749
+ return (VALUE)0;
8750
+ #endif
8751
+ }
8752
+
8753
+
8814
8754
  /*
8815
8755
  * Method: Image#set_channel_depth(channel, depth)
8816
8756
  * Purpose: Call SetImageChannelDepth
@@ -8978,46 +8918,6 @@ Image_properties(VALUE self)
8978
8918
  Image *image;
8979
8919
  volatile VALUE attr_hash;
8980
8920
  volatile VALUE ary;
8981
-
8982
- #if !defined(HAVE_GETNEXTIMAGEPROPERTY)
8983
- const ImageAttribute *attr;
8984
-
8985
- image = rm_check_destroyed(self);
8986
-
8987
- // If block, iterate over attributes
8988
- if (rb_block_given_p())
8989
- {
8990
- ary = rb_ary_new2(2);
8991
-
8992
- ResetImageAttributeIterator(image);
8993
- attr = GetNextImageAttribute(image);
8994
- while (attr)
8995
- {
8996
- (void) rb_ary_store(ary, 0, rb_str_new2(attr->key));
8997
- (void) rb_ary_store(ary, 1, rb_str_new2(attr->value));
8998
- (void) rb_yield(ary);
8999
- attr = GetNextImageAttribute(image);
9000
- }
9001
- rm_check_image_exception(image, RetainOnError);
9002
- return self;
9003
- }
9004
-
9005
- // otherwise return properties hash
9006
- else
9007
- {
9008
- attr_hash = rb_hash_new();
9009
- ResetImageAttributeIterator(image);
9010
- attr = GetNextImageAttribute(image);
9011
- while (attr)
9012
- {
9013
- (void) rb_hash_aset(attr_hash, rb_str_new2(attr->key), rb_str_new2(attr->value));
9014
- attr = GetNextImageAttribute(image);
9015
- }
9016
- rm_check_image_exception(image, RetainOnError);
9017
- return attr_hash;
9018
- }
9019
-
9020
- #else
9021
8921
  char *property;
9022
8922
  const char *value;
9023
8923
 
@@ -9057,7 +8957,6 @@ Image_properties(VALUE self)
9057
8957
  return attr_hash;
9058
8958
  }
9059
8959
 
9060
- #endif
9061
8960
  }
9062
8961
 
9063
8962
 
@@ -9892,16 +9791,10 @@ Image_swirl(VALUE self, VALUE degrees)
9892
9791
  VALUE
9893
9792
  Image_sync_profiles(VALUE self)
9894
9793
  {
9895
- #if defined(HAVE_SYNCIMAGEPROFILES)
9896
9794
  Image *image = rm_check_destroyed(self);
9897
9795
  volatile VALUE okay = SyncImageProfiles(image) ? Qtrue : Qfalse;
9898
9796
  rm_check_image_exception(image, RetainOnError);
9899
9797
  return okay;
9900
- #else
9901
- self = self;
9902
- rm_not_implemented();
9903
- return(VALUE)0;
9904
- #endif
9905
9798
  }
9906
9799
 
9907
9800
 
@@ -10593,12 +10486,7 @@ trimmer(int bang, int argc, VALUE *argv, VALUE self)
10593
10486
 
10594
10487
  if (reset_page)
10595
10488
  {
10596
- #if defined(HAVE_RESETIMAGEPAGE)
10597
10489
  ResetImagePage(new_image, "0x0+0+0");
10598
- #else
10599
- new_image->page.x = new_image->page.y = 0L;
10600
- new_image->page.width = new_image->page.height = 0UL;
10601
- #endif
10602
10490
  }
10603
10491
 
10604
10492
  if (bang)
@@ -11560,12 +11448,7 @@ cropper(int bang, int argc, VALUE *argv, VALUE self)
11560
11448
  if (reset_page)
11561
11449
  {
11562
11450
  Data_Get_Struct(cropped, Image, image);
11563
- #if defined(HAVE_RESETIMAGEPAGE)
11564
11451
  ResetImagePage(image, "0x0+0+0");
11565
- #else
11566
- image->page.x = image->page.y = 0L;
11567
- image->page.width = image->page.height = 0UL;
11568
- #endif
11569
11452
  }
11570
11453
  return cropped;
11571
11454
  }