blob: 36461eb955d042074f9faad4d80a1715ab361829 [file] [log] [blame]
cristy3ed852e2009-09-05 21:47:34 +00001/*
cristyb56bb242014-11-25 17:12:48 +00002 Copyright 1999-2015 ImageMagick Studio LLC, a non-profit organization
cristy3ed852e2009-09-05 21:47:34 +00003 dedicated to making software imaging solutions freely available.
4
5 You may not use this file except in compliance with the License.
6 obtain a copy of the License at
7
8 http://www.imagemagick.org/script/license.php
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15
16 MagickCore image color methods.
17*/
18#ifndef _MAGICKCORE_COLOR_H
19#define _MAGICKCORE_COLOR_H
20
cristy6398ec72013-11-28 02:00:27 +000021#include "MagickCore/pixel.h"
22#include "MagickCore/exception.h"
23
cristy3ed852e2009-09-05 21:47:34 +000024#if defined(__cplusplus) || defined(c_plusplus)
25extern "C" {
26#endif
27
cristy3ed852e2009-09-05 21:47:34 +000028typedef enum
29{
30 UndefinedCompliance,
31 NoCompliance = 0x0000,
Cristy14010442015-08-15 11:05:42 -040032 CSSCompliance = 0x0001,
cristy3ed852e2009-09-05 21:47:34 +000033 SVGCompliance = 0x0001,
34 X11Compliance = 0x0002,
35 XPMCompliance = 0x0004,
36 AllCompliance = 0x7fffffff
37} ComplianceType;
38
39typedef struct _ColorInfo
40{
41 char
42 *path,
43 *name;
44
45 ComplianceType
46 compliance;
47
cristy4c08aed2011-07-01 19:47:50 +000048 PixelInfo
cristy3ed852e2009-09-05 21:47:34 +000049 color;
50
51 MagickBooleanType
cristye3e77a12009-10-16 00:47:21 +000052 exempt,
cristy3ed852e2009-09-05 21:47:34 +000053 stealth;
54
cristybb503372010-05-27 20:51:26 +000055 size_t
cristy3ed852e2009-09-05 21:47:34 +000056 signature;
57} ColorInfo;
58
cristy3ed852e2009-09-05 21:47:34 +000059typedef struct _ErrorInfo
60{
61 double
62 mean_error_per_pixel,
63 normalized_mean_error,
64 normalized_maximum_error;
65} ErrorInfo;
66
67extern MagickExport char
cristybb503372010-05-27 20:51:26 +000068 **GetColorList(const char *,size_t *,ExceptionInfo *);
cristy3ed852e2009-09-05 21:47:34 +000069
70extern MagickExport const ColorInfo
71 *GetColorInfo(const char *,ExceptionInfo *),
cristybb503372010-05-27 20:51:26 +000072 **GetColorInfoList(const char *,size_t *,ExceptionInfo *);
cristy3ed852e2009-09-05 21:47:34 +000073
cristy3ed852e2009-09-05 21:47:34 +000074extern MagickExport MagickBooleanType
cristy4c08aed2011-07-01 19:47:50 +000075 IsEquivalentImage(const Image *,const Image *,ssize_t *x,ssize_t *y,
cristy5ed838e2010-05-31 00:05:35 +000076 ExceptionInfo *),
cristy3ed852e2009-09-05 21:47:34 +000077 ListColorInfo(FILE *,ExceptionInfo *),
cristy101ab702011-10-13 13:06:32 +000078 QueryColorCompliance(const char *,const ComplianceType,PixelInfo *,
cristya60c0202010-07-31 21:36:45 +000079 ExceptionInfo *),
cristy269c9412011-10-13 23:41:15 +000080 QueryColorname(const Image *,const PixelInfo *,const ComplianceType,
cristy5ff4eaf2011-09-03 01:38:02 +000081 char *,ExceptionInfo *);
cristy3ed852e2009-09-05 21:47:34 +000082
cristy3ed852e2009-09-05 21:47:34 +000083extern MagickExport void
cristyed231572011-07-14 02:18:59 +000084 ConcatenateColorComponent(const PixelInfo *,const PixelChannel,
cristy3ed852e2009-09-05 21:47:34 +000085 const ComplianceType,char *),
cristy4c08aed2011-07-01 19:47:50 +000086 GetColorTuple(const PixelInfo *,const MagickBooleanType,char *);
cristy3ed852e2009-09-05 21:47:34 +000087
88#if defined(__cplusplus) || defined(c_plusplus)
89}
90#endif
91
92#endif