module dmagick.c.magickType; import dmagick.c.magickVersion; extern (C) { version(Quantum8) { /** * Quantum is an alias for the smallest integer that can hold * a pixel channel. */ alias ubyte Quantum; alias double MagickRealType; /** * The largest value that fits in a Quantum, This is the same * as Quantum.max except when the Quantum dept is 64 bits. */ enum QuantumRange = Quantum.max; enum MAGICKCORE_QUANTUM_DEPTH = 8; enum MaxColormapSize = 256; static if ( MagickLibVersion < 0x678 ) { enum MagickEpsilon = 1.0e-6; enum MagickHuge = 1.0e6; } } else version(Quantum32) { /** * Quantum is an alias for the smallest integer that can hold * a pixel channel. */ alias uint Quantum; alias double MagickRealType; /** * The largest value that fits in a Quantum, This is the same * as Quantum.max except when the Quantum dept is 64 bits. */ enum QuantumRange = Quantum.max; enum MAGICKCORE_QUANTUM_DEPTH = 32; enum MaxColormapSize = 65536; static if ( MagickLibVersion < 0x678 ) { enum MagickEpsilon = 1.0e-10; enum MagickHuge = 1.0e12; } } else version(Quantum64) { /** * Quantum is an alias for the smallest integer that can hold * a pixel channel. */ alias double Quantum; //real seems to be the same size as long double for //dmc and dmd on windows and for dmd and gcc on linux. alias real MagickRealType; /** * The largest value that fits in a Quantum, This is the same * as Quantum.max except when the Quantum dept is 64 bits. */ enum QuantumRange = 18446744073709551615.0; enum MAGICKCORE_QUANTUM_DEPTH = 64; enum MaxColormapSize = 65536; static if ( MagickLibVersion < 0x678 ) { enum MagickEpsilon = 1.0e-10; enum MagickHuge = 1.0e12; } } else { /** * Quantum is an alias for the smallest integer that can hold * a pixel channel. */ alias ushort Quantum; alias double MagickRealType; /** * The largest value that fits in a Quantum, This is the same * as Quantum.max except when the Quantum dept is 64 bits. */ enum QuantumRange = Quantum.max; enum MAGICKCORE_QUANTUM_DEPTH = 16; enum MaxColormapSize = 65536; static if ( MagickLibVersion < 0x678 ) { enum MagickEpsilon = 1.0e-10; enum MagickHuge = 1.0e12; } } static if ( MagickLibVersion >= 0x678 ) { enum MagickRealType MagickEpsilon = 2.220446e-16; enum MagickRealType MagickHuge = 1.0/MagickEpsilon; } alias uint MagickStatusType; alias long MagickOffsetType; alias ulong MagickSizeType; alias int MagickBooleanType; alias MagickSizeType QuantumAny; alias MaxColormapSize MaxMap; enum MaxTextExtent = 4096; /// The Quantum depth ImageMagick / DMagick is compiled with. alias MAGICKCORE_QUANTUM_DEPTH MagickQuantumDepth; alias QuantumRange TransparentOpacity; /// Fully transparent Quantum. enum OpaqueOpacity = 0; /// Fully opaque Quantum. version(D_Ddoc) { /** * Specify an image channel. A channel is a color component of a * pixel. In the RGB colorspace the channels are red, green, and * blue. There may also be an alpha (transparency/opacity) channel. * In the CMYK colorspace the channels area cyan, magenta, yellow, * and black. In the HSL colorspace the channels are hue, saturation, * and lightness. In the Gray colorspace the only channel is gray. */ enum ChannelType { UndefinedChannel, RedChannel = 0x0001, /// GrayChannel = 0x0001, /// CyanChannel = 0x0001, /// GreenChannel = 0x0002, /// MagentaChannel = 0x0002, /// BlueChannel = 0x0004, /// YellowChannel = 0x0004, /// AlphaChannel = 0x0008, /// Same as OpacityChannel OpacityChannel = 0x0008, /// MatteChannel = 0x0008, /// deprecated BlackChannel = 0x0020, /// IndexChannel = 0x0020, /// CompositeChannels = 0x002F, /// AllChannels = 0x7ffffff, /// TrueAlphaChannel = 0x0040, /// extract actual alpha channel from opacity RGBChannels = 0x0080, /// set alpha from grayscale mask in RGB GrayChannels = 0x0080, /// SyncChannels = 0x0100, /// channels should be modified equally /** * Same as AllChannels, excluding OpacityChannel */ DefaultChannels = ((AllChannels | SyncChannels) &~ OpacityChannel) } } else { mixin( { string channels = "enum ChannelType { UndefinedChannel, RedChannel = 0x0001, GrayChannel = 0x0001, CyanChannel = 0x0001, GreenChannel = 0x0002, MagentaChannel = 0x0002, BlueChannel = 0x0004, YellowChannel = 0x0004, AlphaChannel = 0x0008, OpacityChannel = 0x0008, MatteChannel = 0x0008, // deprecated BlackChannel = 0x0020, IndexChannel = 0x0020, CompositeChannels = 0x002F,"; static if ( MagickLibVersion < 0x670 ) { channels ~= "AllChannels = 0x002F,"; } else static if ( MagickLibVersion == 0x670 ) { channels ~= "AllChannels = ~0UL,"; } else static if ( MagickLibVersion == 0x671 ) { channels ~= "AllChannels = ~0L,"; } else { channels ~= "AllChannels = 0x7FFFFFF,"; } channels ~= " TrueAlphaChannel = 0x0040, // extract actual alpha channel from opacity RGBChannels = 0x0080, // set alpha from grayscale mask in RGB GrayChannels = 0x0080, SyncChannels = 0x0100, // channels should be modified equally DefaultChannels = ( (AllChannels | SyncChannels) &~ OpacityChannel) }"; return channels; }()); } /** * Specify the image storage class. */ enum ClassType { UndefinedClass, /// No storage class has been specified. DirectClass, /// Image is composed of pixels which represent literal color values. PseudoClass /// Image is composed of pixels which specify an index in a color palette. } struct BlobInfo {} }