ext/RMagick/rmmain.c in rmagick-3.0.0 vs ext/RMagick/rmmain.c in rmagick-3.1.0
- old
+ new
@@ -11,11 +11,10 @@
* @author Tim Hunter
******************************************************************************/
#define MAIN // Define external variables
#include "rmagick.h"
-#include "magick/version.h"
/*----------------------------------------------------------------------------\
| External declarations
\----------------------------------------------------------------------------*/
void Init_RMagick(void);
@@ -23,17 +22,38 @@
static void test_Magick_version(void);
static void version_constants(void);
static void features_constant(void);
+/*
+ * Enum constants - define a subclass of Enum for the specified enumeration.
+ * Define an instance of the subclass for each member in the enumeration.
+ * Initialize each instance with its name and value.
+ */
+//! define Ruby enum
+#define DEF_ENUM(tag) {\
+ VALUE _cls, _enum;\
+ _cls = Class_##tag = rm_define_enum_type(#tag);
+//! define Ruby enumerator elements
+#define ENUMERATOR(val)\
+ _enum = rm_enum_new(_cls, ID2SYM(rb_intern(#val)), INT2NUM(val));\
+ rb_define_const(Module_Magick, #val, _enum);
+//! define Ruby enumerator elements when name is different from the value
+#define ENUMERATORV(name, val)\
+ _enum = rm_enum_new(_cls, ID2SYM(rb_intern(#name)), INT2NUM(val));\
+ rb_define_const(Module_Magick, #name, _enum);
+
+//! end of an enumerator
+#define END_ENUM }
+
/*
* Handle transferring ImageMagick memory allocations/frees to Ruby.
* These functions have the same signature as the equivalent C functions.
*/
-#if defined(HAVE_SETMAGICKMEMORYMETHODS)
+
/**
* Allocate memory.
*
* No Ruby usage (internal function)
*
@@ -116,11 +136,10 @@
else
{
rb_define_const(Module_Magick, "MANAGED_MEMORY", Qfalse);
}
}
-#endif
/**
@@ -137,15 +156,11 @@
test_Magick_version();
Module_Magick = rb_define_module("Magick");
-#if defined(HAVE_SETMAGICKMEMORYMETHODS)
set_managed_memory();
-#else
- rb_define_const(Module_Magick, "MANAGED_MEMORY", Qfalse);
-#endif
/*-----------------------------------------------------------------------*/
/* Create IDs for frequently used methods, etc. */
/*-----------------------------------------------------------------------*/
@@ -377,10 +392,11 @@
rb_define_method(Class_Image, "flip!", Image_flip_bang, 0);
rb_define_method(Class_Image, "flop", Image_flop, 0);
rb_define_method(Class_Image, "flop!", Image_flop_bang, 0);
rb_define_method(Class_Image, "frame", Image_frame, -1);
rb_define_method(Class_Image, "function_channel", Image_function_channel, -1);
+ rb_define_method(Class_Image, "fx", Image_fx, -1);
rb_define_method(Class_Image, "gamma_channel", Image_gamma_channel, -1);
rb_define_method(Class_Image, "gamma_correct", Image_gamma_correct, -1);
rb_define_method(Class_Image, "gaussian_blur", Image_gaussian_blur, -1);
rb_define_method(Class_Image, "gaussian_blur_channel", Image_gaussian_blur_channel, -1);
rb_define_method(Class_Image, "get_pixels", Image_get_pixels, 4);
@@ -881,22 +897,21 @@
ENUMERATOR(UndefinedAlphaChannel)
ENUMERATOR(ActivateAlphaChannel)
ENUMERATOR(DeactivateAlphaChannel)
ENUMERATOR(ResetAlphaChannel) /* deprecated */
ENUMERATOR(SetAlphaChannel)
-#if defined(HAVE_ENUM_REMOVEALPHACHANNEL)
ENUMERATOR(RemoveAlphaChannel)
-#endif
-#if defined(HAVE_ENUM_COPYALPHACHANNEL)
ENUMERATOR(CopyAlphaChannel)
ENUMERATOR(ExtractAlphaChannel)
ENUMERATOR(OpaqueAlphaChannel)
ENUMERATOR(ShapeAlphaChannel)
ENUMERATOR(TransparentAlphaChannel)
-#endif
-#if defined(HAVE_ENUM_BACKGROUNDALPHACHANNEL)
ENUMERATOR(BackgroundAlphaChannel)
+ ENUMERATOR(FlattenAlphaChannel)
+#if defined(IMAGEMAGICK_GREATER_THAN_EQUAL_6_8_9)
+ ENUMERATOR(AssociateAlphaChannel)
+ ENUMERATOR(DisassociateAlphaChannel)
#endif
END_ENUM
// AnchorType constants (for Draw#text_anchor - these are not defined by ImageMagick)
DEF_ENUM(AnchorType)
@@ -913,40 +928,20 @@
ENUMERATOR(GreenChannel)
ENUMERATOR(MagentaChannel)
ENUMERATOR(BlueChannel)
ENUMERATOR(YellowChannel)
ENUMERATOR(OpacityChannel)
-
-
ENUMERATOR(BlackChannel)
ENUMERATOR(MatteChannel)
ENUMERATOR(IndexChannel)
ENUMERATOR(GrayChannel)
ENUMERATOR(AllChannels)
-
- // Define alternate names for ChannelType enums for Image::Info#channel=
- // AlphaChannel == OpacityChannel
- _enum = rm_enum_new(Class_ChannelType, ID2SYM(rb_intern("AlphaChannel")), INT2FIX(OpacityChannel));
- rb_define_const(Module_Magick, "AlphaChannel", _enum);
-
- // DefaultChannels
- _enum = rm_enum_new(Class_ChannelType, ID2SYM(rb_intern("DefaultChannels")), INT2FIX(0xff & ~OpacityChannel));
- rb_define_const(Module_Magick, "DefaultChannels", _enum);
-
- // HueChannel == RedChannel
- _enum = rm_enum_new(Class_ChannelType, ID2SYM(rb_intern("HueChannel")), INT2FIX(RedChannel));
- rb_define_const(Module_Magick, "HueChannel", _enum);
-
- // LuminosityChannel = BlueChannel
- _enum = rm_enum_new(Class_ChannelType, ID2SYM(rb_intern("LuminosityChannel")), INT2FIX(BlueChannel));
- rb_define_const(Module_Magick, "LuminosityChannel", _enum);
-
- // SaturationChannel = GreenChannel
- _enum = rm_enum_new(Class_ChannelType, ID2SYM(rb_intern("SaturationChannel")), INT2FIX(GreenChannel));
- rb_define_const(Module_Magick, "SaturationChannel", _enum);
-
-
+ ENUMERATORV(AlphaChannel, OpacityChannel)
+ ENUMERATORV(DefaultChannels, 0xff & ~OpacityChannel)
+ ENUMERATORV(HueChannel, RedChannel)
+ ENUMERATORV(LuminosityChannel, BlueChannel)
+ ENUMERATORV(SaturationChannel, GreenChannel)
END_ENUM
// ClassType constants
DEF_ENUM(ClassType)
ENUMERATOR(UndefinedClass)
@@ -966,52 +961,54 @@
ENUMERATOR(YCCColorspace)
ENUMERATOR(YIQColorspace)
ENUMERATOR(YPbPrColorspace)
ENUMERATOR(YUVColorspace)
ENUMERATOR(CMYKColorspace)
- rb_define_const(Module_Magick, "SRGBColorspace"
- , rm_enum_new(Class_ColorspaceType
- , ID2SYM(rb_intern("SRGBColorspace"))
- , INT2FIX(sRGBColorspace)));
+ ENUMERATORV(SRGBColorspace, sRGBColorspace)
ENUMERATOR(HSLColorspace)
ENUMERATOR(HWBColorspace)
ENUMERATOR(HSBColorspace)
ENUMERATOR(LabColorspace)
ENUMERATOR(Rec601LumaColorspace)
ENUMERATOR(Rec601YCbCrColorspace)
ENUMERATOR(Rec709LumaColorspace)
ENUMERATOR(Rec709YCbCrColorspace)
ENUMERATOR(LogColorspace)
ENUMERATOR(CMYColorspace)
+#if defined(IMAGEMAGICK_GREATER_THAN_EQUAL_6_8_9)
+ ENUMERATOR(LuvColorspace)
+ ENUMERATOR(HCLColorspace)
+ ENUMERATOR(LCHColorspace)
+ ENUMERATOR(LMSColorspace)
+ ENUMERATOR(LCHabColorspace)
+ ENUMERATOR(LCHuvColorspace)
+ ENUMERATORV(ScRGBColorspace, scRGBColorspace)
+ ENUMERATOR(HSIColorspace)
+ ENUMERATOR(HSVColorspace)
+ ENUMERATOR(HCLpColorspace)
+ ENUMERATOR(YDbDrColorspace)
+ ENUMERATORV(XyYColorspace, xyYColorspace)
+#endif
END_ENUM
// ComplianceType constants are defined as enums but used as bit flags
DEF_ENUM(ComplianceType)
ENUMERATOR(UndefinedCompliance)
-
// AllCompliance is 0xffff, not too useful for us!
- rb_define_const(Module_Magick, "AllCompliance"
- , rm_enum_new(Class_ComplianceType
- , ID2SYM(rb_intern("AllCompliance"))
- , INT2FIX(SVGCompliance|X11Compliance|XPMCompliance)));
-
+ ENUMERATORV(AllCompliance, SVGCompliance|X11Compliance|XPMCompliance)
ENUMERATOR(NoCompliance)
ENUMERATOR(SVGCompliance)
ENUMERATOR(X11Compliance)
ENUMERATOR(XPMCompliance)
END_ENUM
// CompositeOperator constants
DEF_ENUM(CompositeOperator)
- ENUMERATOR(UndefinedCompositeOp)
- ENUMERATOR(NoCompositeOp)
ENUMERATOR(AddCompositeOp)
ENUMERATOR(AtopCompositeOp)
ENUMERATOR(BlendCompositeOp)
-#if defined(HAVE_ENUM_BLURCOMPOSITEOP)
ENUMERATOR(BlurCompositeOp)
-#endif
ENUMERATOR(BumpmapCompositeOp)
ENUMERATOR(ChangeMaskCompositeOp)
ENUMERATOR(ClearCompositeOp)
ENUMERATOR(ColorBurnCompositeOp)
ENUMERATOR(ColorDodgeCompositeOp)
@@ -1024,47 +1021,46 @@
ENUMERATOR(CopyMagentaCompositeOp)
ENUMERATOR(CopyOpacityCompositeOp)
ENUMERATOR(CopyRedCompositeOp)
ENUMERATOR(CopyYellowCompositeOp)
ENUMERATOR(DarkenCompositeOp)
-#if defined(HAVE_ENUM_DISTORTCOMPOSITEOP)
+ ENUMERATOR(DarkenIntensityCompositeOp)
ENUMERATOR(DistortCompositeOp)
-#endif
ENUMERATOR(DivideCompositeOp)
+ ENUMERATOR(DivideSrcCompositeOp)
ENUMERATOR(DstAtopCompositeOp)
ENUMERATOR(DstCompositeOp)
ENUMERATOR(DstInCompositeOp)
ENUMERATOR(DstOutCompositeOp)
ENUMERATOR(DstOverCompositeOp)
ENUMERATOR(DifferenceCompositeOp)
ENUMERATOR(DisplaceCompositeOp)
ENUMERATOR(DissolveCompositeOp)
ENUMERATOR(ExclusionCompositeOp)
ENUMERATOR(HardLightCompositeOp)
+#if defined(IMAGEMAGICK_GREATER_THAN_EQUAL_6_8_9)
+ ENUMERATOR(HardMixCompositeOp)
+#endif
ENUMERATOR(HueCompositeOp)
ENUMERATOR(InCompositeOp)
ENUMERATOR(LightenCompositeOp)
-#if defined(HAVE_ENUM_LINEARBURNCOMPOSITEOP)
+ ENUMERATOR(LightenIntensityCompositeOp)
ENUMERATOR(LinearBurnCompositeOp)
-#endif
-#if defined(HAVE_ENUM_LINEARDODGECOMPOSITEOP)
ENUMERATOR(LinearDodgeCompositeOp)
-#endif
ENUMERATOR(LinearLightCompositeOp)
ENUMERATOR(LuminizeCompositeOp)
+ ENUMERATOR(MathematicsCompositeOp)
ENUMERATOR(MinusCompositeOp)
+ ENUMERATOR(MinusSrcCompositeOp)
ENUMERATOR(ModulateCompositeOp)
ENUMERATOR(MultiplyCompositeOp)
+ ENUMERATOR(NoCompositeOp)
ENUMERATOR(OutCompositeOp)
ENUMERATOR(OverCompositeOp)
ENUMERATOR(OverlayCompositeOp)
-#if defined(HAVE_ENUM_PEGTOPLIGHTCOMPOSITEOP)
ENUMERATOR(PegtopLightCompositeOp)
-#endif
-#if defined(HAVE_ENUM_PINLIGHTCOMPOSITEOP)
ENUMERATOR(PinLightCompositeOp)
-#endif
ENUMERATOR(PlusCompositeOp)
ENUMERATOR(ReplaceCompositeOp) // synonym for CopyCompositeOp
ENUMERATOR(SaturateCompositeOp)
ENUMERATOR(ScreenCompositeOp)
ENUMERATOR(SoftLightCompositeOp)
@@ -1073,53 +1069,39 @@
ENUMERATOR(SrcInCompositeOp)
ENUMERATOR(SrcOutCompositeOp)
ENUMERATOR(SrcOverCompositeOp)
ENUMERATOR(SubtractCompositeOp)
ENUMERATOR(ThresholdCompositeOp)
-#if defined(HAVE_ENUM_VIVIDLIGHTCOMPOSITEOP)
+ ENUMERATOR(UndefinedCompositeOp)
ENUMERATOR(VividLightCompositeOp)
-#endif
ENUMERATOR(XorCompositeOp)
END_ENUM
// CompressionType constants
DEF_ENUM(CompressionType)
ENUMERATOR(UndefinedCompression)
ENUMERATOR(NoCompression)
-#if defined(HAVE_ENUM_B44COMPRESSION)
ENUMERATOR(B44Compression)
-#endif
-#if defined(HAVE_ENUM_B44ACOMPRESSION)
ENUMERATOR(B44ACompression)
-#endif
ENUMERATOR(BZipCompression)
-#if defined(HAVE_ENUM_DXT1COMPRESSION)
ENUMERATOR(DXT1Compression)
-#endif
-#if defined(HAVE_ENUM_DXT3COMPRESSION)
ENUMERATOR(DXT3Compression)
-#endif
-#if defined(HAVE_ENUM_DXT5COMPRESSION)
ENUMERATOR(DXT5Compression)
-#endif
ENUMERATOR(FaxCompression)
ENUMERATOR(Group4Compression)
ENUMERATOR(JPEGCompression)
ENUMERATOR(JPEG2000Compression)
ENUMERATOR(LosslessJPEGCompression)
ENUMERATOR(LZWCompression)
-#if defined(HAVE_ENUM_PIZCOMPRESSION)
ENUMERATOR(PizCompression)
-#endif
-#if defined(HAVE_ENUM_PXR24COMPRESSION)
ENUMERATOR(Pxr24Compression)
-#endif
ENUMERATOR(RLECompression)
ENUMERATOR(ZipCompression)
-#if defined(HAVE_ENUM_ZIPSCOMPRESSION)
ENUMERATOR(ZipSCompression)
-#endif
+ ENUMERATOR(LZMACompression)
+ ENUMERATOR(JBIG1Compression)
+ ENUMERATOR(JBIG2Compression)
END_ENUM
// DecorationType constants
DEF_ENUM(DecorationType)
ENUMERATOR(NoDecoration)
@@ -1140,50 +1122,34 @@
DEF_ENUM(DistortImageMethod)
ENUMERATOR(UndefinedDistortion)
ENUMERATOR(AffineDistortion)
ENUMERATOR(AffineProjectionDistortion)
ENUMERATOR(ArcDistortion)
-#if defined(HAVE_ENUM_POLARDISTORTION)
ENUMERATOR(PolarDistortion)
-#endif
-#if defined(HAVE_ENUM_DEPOLARDISTORTION)
ENUMERATOR(DePolarDistortion)
-#endif
-#if defined(HAVE_ENUM_BARRELDISTORTION)
ENUMERATOR(BarrelDistortion)
-#endif
ENUMERATOR(BilinearDistortion)
-#if defined(HAVE_ENUM_BILINEARFORWARDDISTORTION)
ENUMERATOR(BilinearForwardDistortion)
-#endif
-#if defined(HAVE_ENUM_BILINEARREVERSEDISTORTION)
ENUMERATOR(BilinearReverseDistortion)
-#endif
ENUMERATOR(PerspectiveDistortion)
ENUMERATOR(PerspectiveProjectionDistortion)
-#if defined(HAVE_ENUM_POLYNOMIALDISTORTION)
ENUMERATOR(PolynomialDistortion)
-#endif
ENUMERATOR(ScaleRotateTranslateDistortion)
-#if defined(HAVE_ENUM_SHEPARDSDISTORTION)
ENUMERATOR(ShepardsDistortion)
-#endif
-#if defined(HAVE_ENUM_BARRELINVERSEDISTORTION)
ENUMERATOR(BarrelInverseDistortion)
-#endif
+ ENUMERATOR(Cylinder2PlaneDistortion)
+ ENUMERATOR(Plane2CylinderDistortion)
+ ENUMERATOR(ResizeDistortion)
+ ENUMERATOR(SentinelDistortion)
END_ENUM
-#if defined(HAVE_TYPE_DITHERMETHOD)
DEF_ENUM(DitherMethod)
ENUMERATOR(UndefinedDitherMethod)
-#if defined(HAVE_ENUM_NODITHERMETHOD)
ENUMERATOR(NoDitherMethod)
-#endif
ENUMERATOR(RiemersmaDitherMethod)
ENUMERATOR(FloydSteinbergDitherMethod)
END_ENUM
-#endif
DEF_ENUM(EndianType)
ENUMERATOR(UndefinedEndian)
ENUMERATOR(LSBEndian)
ENUMERATOR(MSBEndian)
@@ -1205,27 +1171,27 @@
ENUMERATOR(CatromFilter)
ENUMERATOR(MitchellFilter)
ENUMERATOR(LanczosFilter)
ENUMERATOR(BesselFilter)
ENUMERATOR(SincFilter)
-#if defined(HAVE_ENUM_KAISERFILTER)
ENUMERATOR(KaiserFilter)
-#endif
-#if defined(HAVE_ENUM_WELSHFILTER)
ENUMERATOR(WelshFilter)
-#endif
-#if defined(HAVE_ENUM_PARZENFILTER)
ENUMERATOR(ParzenFilter)
-#endif
-#if defined(HAVE_ENUM_LAGRANGEFILTER)
ENUMERATOR(LagrangeFilter)
-#endif
-#if defined(HAVE_ENUM_BOHMANFILTER)
ENUMERATOR(BohmanFilter)
-#endif
-#if defined(HAVE_ENUM_BARTLETTFILTER)
ENUMERATOR(BartlettFilter)
+ ENUMERATOR(JincFilter)
+ ENUMERATOR(SincFastFilter)
+ ENUMERATOR(LanczosSharpFilter)
+ ENUMERATOR(Lanczos2Filter)
+ ENUMERATOR(Lanczos2SharpFilter)
+ ENUMERATOR(RobidouxFilter)
+ ENUMERATOR(RobidouxSharpFilter)
+ ENUMERATOR(CosineFilter)
+ ENUMERATOR(SplineFilter)
+#if defined(IMAGEMAGICK_GREATER_THAN_EQUAL_6_8_9)
+ ENUMERATOR(LanczosRadiusFilter)
#endif
END_ENUM
// GravityType constants
DEF_ENUM(GravityType)
@@ -1279,58 +1245,43 @@
ENUMERATOR(FilterInterpolatePixel)
ENUMERATOR(IntegerInterpolatePixel)
ENUMERATOR(MeshInterpolatePixel)
ENUMERATOR(NearestNeighborInterpolatePixel)
ENUMERATOR(SplineInterpolatePixel)
+ ENUMERATOR(Average9InterpolatePixel)
+ ENUMERATOR(Average16InterpolatePixel)
+ ENUMERATOR(BlendInterpolatePixel)
+ ENUMERATOR(BackgroundInterpolatePixel)
+ ENUMERATOR(CatromInterpolatePixel)
END_ENUM
-#if defined(HAVE_TYPE_MAGICKFUNCTION)
DEF_ENUM(MagickFunction)
ENUMERATOR(UndefinedFunction)
ENUMERATOR(PolynomialFunction)
ENUMERATOR(SinusoidFunction)
-#if defined(HAVE_ENUM_ARCSINFUNCTION)
ENUMERATOR(ArcsinFunction)
-#endif
-#if defined(HAVE_ENUM_ARCTANFUNCTION)
ENUMERATOR(ArctanFunction)
-#endif
END_ENUM
-#endif
-#if defined(HAVE_TYPE_IMAGELAYERMETHOD)
DEF_ENUM(ImageLayerMethod)
-#else
- DEF_ENUM(MagickLayerMethod)
-#endif
ENUMERATOR(UndefinedLayer)
ENUMERATOR(CompareAnyLayer)
ENUMERATOR(CompareClearLayer)
ENUMERATOR(CompareOverlayLayer)
ENUMERATOR(OptimizeLayer)
ENUMERATOR(OptimizePlusLayer)
ENUMERATOR(CoalesceLayer)
ENUMERATOR(DisposeLayer)
ENUMERATOR(OptimizeTransLayer)
-#if defined(HAVE_ENUM_OPTIMIZEIMAGELAYER)
ENUMERATOR(OptimizeImageLayer)
-#endif
ENUMERATOR(RemoveDupsLayer)
ENUMERATOR(RemoveZeroLayer)
ENUMERATOR(CompositeLayer)
-#if defined(HAVE_ENUM_MERGELAYER)
ENUMERATOR(MergeLayer)
-#endif
-#if defined(HAVE_ENUM_MOSAICLAYER)
ENUMERATOR(MosaicLayer)
-#endif
-#if defined(HAVE_ENUM_FLATTENLAYER)
ENUMERATOR(FlattenLayer)
-#endif
-#if defined(HAVE_ENUM_TRIMBOUNDSLAYER)
ENUMERATOR(TrimBoundsLayer)
-#endif
END_ENUM
DEF_ENUM(MetricType)
ENUMERATOR(UndefinedMetric)
ENUMERATOR(AbsoluteErrorMetric)
@@ -1338,10 +1289,16 @@
ENUMERATOR(MeanErrorPerPixelMetric)
ENUMERATOR(MeanSquaredErrorMetric)
ENUMERATOR(PeakAbsoluteErrorMetric)
ENUMERATOR(PeakSignalToNoiseRatioMetric)
ENUMERATOR(RootMeanSquaredErrorMetric)
+ ENUMERATOR(NormalizedCrossCorrelationErrorMetric)
+ ENUMERATOR(FuzzErrorMetric)
+#if defined(IMAGEMAGICK_GREATER_THAN_EQUAL_6_8_9)
+ ENUMERATOR(UndefinedErrorMetric)
+ ENUMERATOR(PerceptualHashErrorMetric)
+#endif
END_ENUM
// NoiseType constants
DEF_ENUM(NoiseType)
ENUMERATOR(UniformNoise)
@@ -1420,51 +1377,31 @@
ENUMERATOR(MultiplyQuantumOperator)
ENUMERATOR(OrQuantumOperator)
ENUMERATOR(RShiftQuantumOperator)
ENUMERATOR(SubtractQuantumOperator)
ENUMERATOR(XorQuantumOperator)
-#if defined(HAVE_ENUM_POWEVALUATEOPERATOR)
ENUMERATOR(PowQuantumOperator)
-#endif
-#if defined(HAVE_ENUM_LOGEVALUATEOPERATOR)
ENUMERATOR(LogQuantumOperator)
-#endif
-#if defined(HAVE_ENUM_THRESHOLDEVALUATEOPERATOR)
ENUMERATOR(ThresholdQuantumOperator)
-#endif
-#if defined(HAVE_ENUM_THRESHOLDBLACKEVALUATEOPERATOR)
ENUMERATOR(ThresholdBlackQuantumOperator)
-#endif
-#if defined(HAVE_ENUM_THRESHOLDWHITEEVALUATEOPERATOR)
ENUMERATOR(ThresholdWhiteQuantumOperator)
-#endif
-#if defined(HAVE_ENUM_GAUSSIANNOISEEVALUATEOPERATOR)
ENUMERATOR(GaussianNoiseQuantumOperator)
-#endif
-#if defined(HAVE_ENUM_IMPULSENOISEEVALUATEOPERATOR)
ENUMERATOR(ImpulseNoiseQuantumOperator)
-#endif
-#if defined(HAVE_ENUM_LAPLACIANNOISEEVALUATEOPERATOR)
ENUMERATOR(LaplacianNoiseQuantumOperator)
-#endif
-#if defined(HAVE_ENUM_MULTIPLICATIVENOISEEVALUATEOPERATOR)
ENUMERATOR(MultiplicativeNoiseQuantumOperator)
-#endif
-#if defined(HAVE_ENUM_POISSONNOISEEVALUATEOPERATOR)
ENUMERATOR(PoissonNoiseQuantumOperator)
-#endif
-#if defined(HAVE_ENUM_UNIFORMNOISEEVALUATEOPERATOR)
ENUMERATOR(UniformNoiseQuantumOperator)
-#endif
-#if defined(HAVE_ENUM_COSINEEVALUATEOPERATOR)
ENUMERATOR(CosineQuantumOperator)
-#endif
-#if defined(HAVE_ENUM_SINEEVALUATEOPERATOR)
ENUMERATOR(SineQuantumOperator)
-#endif
-#if defined(HAVE_ENUM_ADDMODULUSEVALUATEOPERATOR)
ENUMERATOR(AddModulusQuantumOperator)
+ ENUMERATOR(MeanQuantumOperator)
+ ENUMERATOR(AbsQuantumOperator)
+ ENUMERATOR(ExponentialQuantumOperator)
+ ENUMERATOR(MedianQuantumOperator)
+ ENUMERATOR(SumQuantumOperator)
+#if defined(IMAGEMAGICK_GREATER_THAN_EQUAL_6_8_9)
+ ENUMERATOR(RootMeanSquareQuantumOperator)
#endif
END_ENUM
// RenderingIntent
DEF_ENUM(RenderingIntent)
@@ -1480,20 +1417,19 @@
ENUMERATOR(UndefinedResolution)
ENUMERATOR(PixelsPerInchResolution)
ENUMERATOR(PixelsPerCentimeterResolution)
END_ENUM
-#if defined(HAVE_SPARSECOLORIMAGE)
DEF_ENUM(SparseColorMethod)
ENUMERATOR(UndefinedColorInterpolate)
ENUMERATOR(BarycentricColorInterpolate)
ENUMERATOR(BilinearColorInterpolate)
//ENUMERATOR(PolynomialColorInterpolate)
ENUMERATOR(ShepardsColorInterpolate)
ENUMERATOR(VoronoiColorInterpolate)
+ ENUMERATOR(InverseColorInterpolate)
END_ENUM
-#endif
// SpreadMethod
DEF_ENUM(SpreadMethod)
ENUMERATOR(UndefinedSpread)
ENUMERATOR(PadSpread)
@@ -1548,25 +1484,15 @@
ENUMERATOR(ConstantVirtualPixelMethod)
ENUMERATOR(MaskVirtualPixelMethod)
ENUMERATOR(BlackVirtualPixelMethod)
ENUMERATOR(GrayVirtualPixelMethod)
ENUMERATOR(WhiteVirtualPixelMethod)
-#if defined(HAVE_ENUM_HORIZONTALTILEVIRTUALPIXELMETHOD)
ENUMERATOR(HorizontalTileVirtualPixelMethod)
-#endif
-#if defined(HAVE_ENUM_VERTICALTILEVIRTUALPIXELMETHOD)
ENUMERATOR(VerticalTileVirtualPixelMethod)
-#endif
-#if defined(HAVE_ENUM_HORIZONTALTILEEDGEVIRTUALPIXELMETHOD)
ENUMERATOR(HorizontalTileEdgeVirtualPixelMethod)
-#endif
-#if defined(HAVE_ENUM_VERTICALTILEEDGEVIRTUALPIXELMETHOD)
ENUMERATOR(VerticalTileEdgeVirtualPixelMethod)
-#endif
-#if defined(HAVE_ENUM_CHECKERTILEVIRTUALPIXELMETHOD)
ENUMERATOR(CheckerTileVirtualPixelMethod)
-#endif
END_ENUM
// WeightType constants
DEF_ENUM(WeightType)
ENUMERATOR(AnyWeight)
ENUMERATOR(NormalWeight)
@@ -1575,13 +1501,38 @@
ENUMERATOR(LighterWeight)
END_ENUM
// For KernelInfo scaling
DEF_ENUM(GeometryFlags)
+ ENUMERATOR(NoValue)
+ ENUMERATOR(XValue)
+ ENUMERATOR(XiValue)
+ ENUMERATOR(YValue)
+ ENUMERATOR(PsiValue)
+ ENUMERATOR(WidthValue)
+ ENUMERATOR(RhoValue)
+ ENUMERATOR(HeightValue)
+ ENUMERATOR(SigmaValue)
+ ENUMERATOR(ChiValue)
+ ENUMERATOR(XiNegative)
+ ENUMERATOR(XNegative)
+ ENUMERATOR(PsiNegative)
+ ENUMERATOR(YNegative)
+ ENUMERATOR(ChiNegative)
+ ENUMERATOR(PercentValue)
+ ENUMERATOR(AspectValue)
ENUMERATOR(NormalizeValue)
+ ENUMERATOR(LessValue)
+ ENUMERATOR(GreaterValue)
+ ENUMERATOR(MinimumValue)
ENUMERATOR(CorrelateNormalizeValue)
- ENUMERATOR(PercentValue)
+ ENUMERATOR(AreaValue)
+ ENUMERATOR(DecimalValue)
+#if defined(IMAGEMAGICK_GREATER_THAN_EQUAL_6_8_9)
+ ENUMERATOR(SeparatorValue)
+#endif
+ ENUMERATOR(AllValues)
END_ENUM
// Morphology methods
DEF_ENUM(MorphologyMethod)
ENUMERATOR(UndefinedMorphology)
@@ -1604,10 +1555,11 @@
ENUMERATOR(BottomHatMorphology)
ENUMERATOR(HitAndMissMorphology)
ENUMERATOR(ThinningMorphology)
ENUMERATOR(ThickenMorphology)
ENUMERATOR(VoronoiMorphology)
+ ENUMERATOR(IterativeDistanceMorphology)
END_ENUM
DEF_ENUM(KernelInfoType)
ENUMERATOR(UndefinedKernel)
ENUMERATOR(UnityKernel)
@@ -1644,10 +1596,13 @@
ENUMERATOR(ChebyshevKernel)
ENUMERATOR(ManhattanKernel)
ENUMERATOR(OctagonalKernel)
ENUMERATOR(EuclideanKernel)
ENUMERATOR(UserDefinedKernel)
+#if defined(IMAGEMAGICK_GREATER_THAN_EQUAL_6_8_9)
+ ENUMERATOR(BinomialKernel)
+#endif
END_ENUM
/*-----------------------------------------------------------------------*/
/* Struct classes */
/*-----------------------------------------------------------------------*/
@@ -1815,21 +1770,11 @@
static void
features_constant(void)
{
VALUE features;
-#if defined(HAVE_GETMAGICKFEATURES)
// 6.5.7 - latest (7.0.0)
features = rb_str_new2(GetMagickFeatures());
-#elif defined(MagickFeatures)
- // 6.5.7 - latest (7.0.0)
- features = rb_str_new2(MagickFeatures);
-#elif defined(MagickSupport)
- // 6.5.5 - 6.5.6
- features = rb_str_new2(MagickSupport);
-#else
- features = rb_str_new("unknown", 7);
-#endif
rb_obj_freeze(features);
rb_define_const(Module_Magick, "Magick_features", features);
RB_GC_GUARD(features);