1 module dmagick.c.quantize; 2 3 import dmagick.c.colorspace; 4 import dmagick.c.image; 5 import dmagick.c.magickType; 6 import dmagick.c.magickVersion; 7 8 extern(C) 9 { 10 /** 11 * Determines the dithering method to use. 12 */ 13 enum DitherMethod 14 { 15 UndefinedDitherMethod, /// 16 NoDitherMethod, /// ditto 17 RiemersmaDitherMethod, /// ditto 18 FloydSteinbergDitherMethod /// ditto 19 } 20 21 struct QuantizeInfo 22 { 23 size_t 24 number_colors; 25 26 size_t 27 tree_depth; 28 29 MagickBooleanType 30 dither; 31 32 ColorspaceType 33 colorspace; 34 35 MagickBooleanType 36 measure_error; 37 38 size_t 39 signature; 40 41 DitherMethod 42 dither_method; 43 } 44 45 MagickBooleanType CompressImageColormap(Image*); 46 MagickBooleanType GetImageQuantizeError(Image*); 47 MagickBooleanType PosterizeImage(Image*, const size_t, const MagickBooleanType); 48 49 static if ( MagickLibVersion >= 0x668 ) 50 { 51 MagickBooleanType PosterizeImageChannel(Image*, const ChannelType, const size_t, const MagickBooleanType); 52 } 53 54 MagickBooleanType QuantizeImage(const(QuantizeInfo)*, Image*); 55 MagickBooleanType QuantizeImages(const(QuantizeInfo)*, Image*); 56 MagickBooleanType RemapImage(const(QuantizeInfo)*, Image*, const(Image)*); 57 MagickBooleanType RemapImages(const(QuantizeInfo)*, Image*, const(Image)*); 58 59 QuantizeInfo* AcquireQuantizeInfo(const(ImageInfo)*); 60 QuantizeInfo* CloneQuantizeInfo(const(QuantizeInfo)*); 61 QuantizeInfo* DestroyQuantizeInfo(QuantizeInfo*); 62 63 void GetQuantizeInfo(QuantizeInfo*); 64 }