1 module dmagick.c.resample; 2 3 import dmagick.c.magickVersion; 4 5 extern(C) 6 { 7 static if ( MagickLibVersion >= 0x666 ) 8 { 9 import dmagick.c.cacheView; 10 import dmagick.c.exception; 11 import dmagick.c.image; 12 import dmagick.c.magickType; 13 import dmagick.c.pixel; 14 15 /** 16 * Used to adjust the filter algorithm used when resizing images. 17 * Different filters experience varying degrees of success with 18 * various images and can take significantly different amounts of 19 * processing time. ImageMagick uses the LanczosFilter by default 20 * since this filter has been shown to provide the best results for 21 * most images in a reasonable amount of time. Other filter types 22 * (e.g. TriangleFilter) may execute much faster but may show 23 * artifacts when the image is re-sized or around diagonal lines. 24 * The only way to be sure is to test the filter with sample images. 25 * 26 * See_Also: $(LINK2 http://www.imagemagick.org/Usage/resize/, 27 * Resize Filters) in the Examples of ImageMagick Usage. 28 */ 29 enum FilterTypes 30 { 31 UndefinedFilter, /// 32 PointFilter, /// ditto 33 BoxFilter, /// ditto 34 TriangleFilter, /// ditto 35 HermiteFilter, /// ditto 36 HanningFilter, /// ditto 37 HammingFilter, /// ditto 38 BlackmanFilter, /// ditto 39 GaussianFilter, /// ditto 40 QuadraticFilter, /// ditto 41 CubicFilter, /// ditto 42 CatromFilter, /// ditto 43 MitchellFilter, /// ditto 44 JincFilter, /// ditto 45 SincFilter, /// ditto 46 SincFastFilter, /// ditto 47 KaiserFilter, /// ditto 48 WelshFilter, /// ditto 49 ParzenFilter, /// ditto 50 BohmanFilter, /// ditto 51 BartlettFilter, /// ditto 52 LagrangeFilter, /// ditto 53 LanczosFilter, /// ditto 54 LanczosSharpFilter, /// ditto 55 Lanczos2Filter, /// ditto 56 Lanczos2SharpFilter, /// ditto 57 RobidouxFilter, /// ditto 58 RobidouxSharpFilter, /// ditto 59 CosineFilter, /// ditto 60 SplineFilter, /// ditto 61 LanczosRadiusFilter, /// ditto 62 SentinelFilter, // a count of all the filters, not a real filter 63 64 BesselFilter = JincFilter, 65 Lanczos2DFilter = Lanczos2Filter, 66 Lanczos2DSharpFilter = Lanczos2SharpFilter 67 } 68 } 69 else 70 { 71 import dmagick.c.cacheView; 72 import dmagick.c.exception; 73 import dmagick.c.image; 74 import dmagick.c.magickType; 75 import dmagick.c.pixel; 76 77 enum FilterTypes 78 { 79 UndefinedFilter, 80 PointFilter, 81 BoxFilter, 82 TriangleFilter, 83 HermiteFilter, 84 HanningFilter, 85 HammingFilter, 86 BlackmanFilter, 87 GaussianFilter, 88 QuadraticFilter, 89 CubicFilter, 90 CatromFilter, 91 MitchellFilter, 92 LanczosFilter, 93 JincFilter, 94 SincFilter, 95 KaiserFilter, 96 WelshFilter, 97 ParzenFilter, 98 LagrangeFilter, 99 BohmanFilter, 100 BartlettFilter, 101 SincFastFilter, 102 Lanczos2DFilter, 103 Lanczos2DSharpFilter, 104 RobidouxFilter, 105 RobidouxSharpFilter, 106 CosineFilter, 107 SentinelFilter, /* a count of all the filters, not a real filter */ 108 109 BesselFilter = JincFilter 110 } 111 } 112 113 struct ResampleFilter {} 114 115 MagickBooleanType ResamplePixelColor(ResampleFilter*, const double, const double, MagickPixelPacket*); 116 MagickBooleanType SetResampleFilterInterpolateMethod(ResampleFilter*, const InterpolatePixelMethod); 117 MagickBooleanType SetResampleFilterVirtualPixelMethod(ResampleFilter*, const VirtualPixelMethod); 118 119 ResampleFilter* AcquireResampleFilter(const(Image)*, ExceptionInfo*); 120 ResampleFilter* DestroyResampleFilter(ResampleFilter*); 121 122 void ScaleResampleFilter(ResampleFilter*, const double, const double, const double, const double); 123 void SetResampleFilter(ResampleFilter*, const FilterTypes, const double); 124 }