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 		SVGCompliance = 0x0001,
20 		X11Compliance = 0x0002,
21 		XPMCompliance = 0x0004,
22 		AllCompliance = 0x7fffffff
23 	}
24 
25 	struct ColorInfo
26 	{
27 		char*
28 			path,
29 			name;
30 
31 		ComplianceType
32 			compliance;
33 
34 		MagickPixelPacket
35 			color;
36 
37 		MagickBooleanType
38 			exempt,
39 			stealth;
40 
41 		ColorInfo*
42 			previous,
43 			next;
44 
45 		size_t
46 			signature;
47 	}
48 
49 	struct ErrorInfo
50 	{
51 		double
52 			mean_error_per_pixel,
53 			normalized_mean_error,
54 			normalized_maximum_error;
55 	}
56 
57 	char** GetColorList(const(char)*, size_t*, ExceptionInfo*);
58 
59 	const(ColorInfo)*  GetColorInfo(const(char)*, ExceptionInfo*);
60 	const(ColorInfo)** GetColorInfoList(const(char)*, size_t*, ExceptionInfo*);
61 
62 	MagickBooleanType ColorComponentGenesis();
63 	MagickBooleanType IsColorSimilar(const(Image)*, const(PixelPacket)*, const(PixelPacket)*);
64 	MagickBooleanType IsGrayImage(const(Image)*, ExceptionInfo*);
65 	MagickBooleanType IsImageSimilar(const(Image)*, const(Image)*, ssize_t* x,ssize_t* y, ExceptionInfo*);
66 	MagickBooleanType IsMagickColorSimilar(const(MagickPixelPacket)*, const(MagickPixelPacket)*);
67 	MagickBooleanType IsMonochromeImage(const(Image)*, ExceptionInfo*);
68 	MagickBooleanType IsOpacitySimilar(const(Image)*, const(PixelPacket)*, const(PixelPacket)*);
69 	MagickBooleanType IsOpaqueImage(const(Image)*, ExceptionInfo*);
70 	MagickBooleanType ListColorInfo(FILE*, ExceptionInfo*);
71 
72 	static if ( MagickLibVersion >= 0x664 )
73 	{
74 		MagickBooleanType QueryColorCompliance(const(char)*, const ComplianceType, PixelPacket*, ExceptionInfo*);
75 	}
76 
77 	MagickBooleanType QueryColorDatabase(const(char)*, PixelPacket*, ExceptionInfo*);
78 	MagickBooleanType QueryColorname(const(Image)*, const(PixelPacket)*, const ComplianceType, char*, ExceptionInfo*);
79 
80 	static if ( MagickLibVersion >= 0x664 )
81 	{
82 		MagickBooleanType QueryMagickColorCompliance(const(char)*, const ComplianceType, MagickPixelPacket*, ExceptionInfo*);
83 	}
84 
85 	MagickBooleanType QueryMagickColor(const(char)*, MagickPixelPacket*, ExceptionInfo*);
86 	MagickBooleanType QueryMagickColorname(const(Image)*, const(MagickPixelPacket)*, const ComplianceType, char*, ExceptionInfo*);
87 
88 	void ColorComponentTerminus();
89 	void ConcatenateColorComponent(const(MagickPixelPacket)*, const ChannelType, const ComplianceType, char*);
90 	void GetColorTuple(const(MagickPixelPacket)*, const MagickBooleanType, char*);
91 }