1 module dmagick.c.color;
2 
3 import core.stdc.stdio;
4 
5 import dmagick.c.exception;
6 import dmagick.c.image;
7 import dmagick.c.magickType;
8 import dmagick.c.magickVersion;
9 import dmagick.c.pixel;
10 
11 alias ptrdiff_t ssize_t;
12 
13 extern(C)
14 {
15 	enum ComplianceType
16 	{
17 		UndefinedCompliance,
18 		NoCompliance  = 0x0000,
19 		CSSCompliance = 0x0001,
20 		SVGCompliance = 0x0001,
21 		X11Compliance = 0x0002,
22 		XPMCompliance = 0x0004,
23 		AllCompliance = 0x7fffffff
24 	}
25 
26 	struct ColorInfo
27 	{
28 		char*
29 			path,
30 			name;
31 
32 		ComplianceType
33 			compliance;
34 
35 		MagickPixelPacket
36 			color;
37 
38 		MagickBooleanType
39 			exempt,
40 			stealth;
41 
42 		ColorInfo*
43 			previous,
44 			next;
45 
46 		size_t
47 			signature;
48 	}
49 
50 	struct ErrorInfo
51 	{
52 		double
53 			mean_error_per_pixel,
54 			normalized_mean_error,
55 			normalized_maximum_error;
56 	}
57 
58 	char** GetColorList(const(char)*, size_t*, ExceptionInfo*);
59 
60 	const(ColorInfo)*  GetColorInfo(const(char)*, ExceptionInfo*);
61 	const(ColorInfo)** GetColorInfoList(const(char)*, size_t*, ExceptionInfo*);
62 
63 	MagickBooleanType ColorComponentGenesis();
64 	MagickBooleanType IsColorSimilar(const(Image)*, const(PixelPacket)*, const(PixelPacket)*);
65 	MagickBooleanType IsGrayImage(const(Image)*, ExceptionInfo*);
66 	MagickBooleanType IsImageSimilar(const(Image)*, const(Image)*, ssize_t* x,ssize_t* y, ExceptionInfo*);
67 	MagickBooleanType IsMagickColorSimilar(const(MagickPixelPacket)*, const(MagickPixelPacket)*);
68 	MagickBooleanType IsMonochromeImage(const(Image)*, ExceptionInfo*);
69 	MagickBooleanType IsOpacitySimilar(const(Image)*, const(PixelPacket)*, const(PixelPacket)*);
70 	MagickBooleanType IsOpaqueImage(const(Image)*, ExceptionInfo*);
71 	MagickBooleanType ListColorInfo(FILE*, ExceptionInfo*);
72 
73 	static if ( MagickLibVersion >= 0x664 )
74 	{
75 		MagickBooleanType QueryColorCompliance(const(char)*, const ComplianceType, PixelPacket*, ExceptionInfo*);
76 	}
77 
78 	MagickBooleanType QueryColorDatabase(const(char)*, PixelPacket*, ExceptionInfo*);
79 	MagickBooleanType QueryColorname(const(Image)*, const(PixelPacket)*, const ComplianceType, char*, ExceptionInfo*);
80 
81 	static if ( MagickLibVersion >= 0x664 )
82 	{
83 		MagickBooleanType QueryMagickColorCompliance(const(char)*, const ComplianceType, MagickPixelPacket*, ExceptionInfo*);
84 	}
85 
86 	MagickBooleanType QueryMagickColor(const(char)*, MagickPixelPacket*, ExceptionInfo*);
87 	MagickBooleanType QueryMagickColorname(const(Image)*, const(MagickPixelPacket)*, const ComplianceType, char*, ExceptionInfo*);
88 
89 	void ColorComponentTerminus();
90 	void ConcatenateColorComponent(const(MagickPixelPacket)*, const ChannelType, const ComplianceType, char*);
91 	void GetColorTuple(const(MagickPixelPacket)*, const MagickBooleanType, char*);
92 }