summaryrefslogtreecommitdiff
path: root/dmagick/c/distort.d
blob: 98e800c451d57da9eb38f55912b69d2341171e9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
module dmagick.c.distort;

import dmagick.c.exception;
import dmagick.c.image;
import dmagick.c.magickType;
import dmagick.c.magickVersion;

extern(C)
{
	mixin(
	{
		string methods = "enum DistortImageMethod
		{
			UndefinedDistortion,
			AffineDistortion,
			AffineProjectionDistortion,
			ScaleRotateTranslateDistortion,
			PerspectiveDistortion,
			PerspectiveProjectionDistortion,
			BilinearForwardDistortion,
			BilinearDistortion = BilinearForwardDistortion,
			BilinearReverseDistortion,
			PolynomialDistortion,
			ArcDistortion,
			PolarDistortion,
			DePolarDistortion,";

			static if ( MagickLibVersion >= 0x671 )
			{
				methods ~= "Cylinder2PlaneDistortion,
				            Plane2CylinderDistortion,";
			}

			methods ~= "
			BarrelDistortion,
			BarrelInverseDistortion,
			ShepardsDistortion,";

			static if ( MagickLibVersion >= 0x670 )
			{
				methods ~= "ResizeDistortion,";
			}

			methods ~= "
			SentinelDistortion
		}";

		return methods;
	}());

	enum SparseColorMethod
	{
		UndefinedColorInterpolate =   DistortImageMethod.UndefinedDistortion,
		BarycentricColorInterpolate = DistortImageMethod.AffineDistortion,
		BilinearColorInterpolate =    DistortImageMethod.BilinearReverseDistortion,
		PolynomialColorInterpolate =  DistortImageMethod.PolynomialDistortion,
		ShepardsColorInterpolate =    DistortImageMethod.ShepardsDistortion,

		VoronoiColorInterpolate =     DistortImageMethod.SentinelDistortion,
		InverseColorInterpolate
	}

	Image* DistortImage(const(Image)*, const DistortImageMethod, const size_t, const(double)*, MagickBooleanType, ExceptionInfo* exception);

	static if ( MagickLibVersion >= 0x670 )
	{
		Image* DistortResizeImage(const(Image)*, const size_t, const size_t, ExceptionInfo*);
	}

	Image* SparseColorImage(const(Image)*, const ChannelType, const SparseColorMethod, const size_t, const(double)*, ExceptionInfo*);
}