blob: 9b463ba80121b1b4c4d50aee21a413bca9e3912f [file] [log] [blame]
cristy3ed852e2009-09-05 21:47:34 +00001/*
Cristy7ce65e72015-12-12 18:03:16 -05002 Copyright 1999-2016 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 quantization methods.
17*/
18#ifndef _MAGICKCORE_QUANTIZE_H
19#define _MAGICKCORE_QUANTIZE_H
20
cristy6398ec72013-11-28 02:00:27 +000021#include "MagickCore/colorspace.h"
22
cristy3ed852e2009-09-05 21:47:34 +000023#if defined(__cplusplus) || defined(c_plusplus)
24extern "C" {
25#endif
26
cristy3ed852e2009-09-05 21:47:34 +000027typedef enum
28{
29 UndefinedDitherMethod,
30 NoDitherMethod,
31 RiemersmaDitherMethod,
32 FloydSteinbergDitherMethod
33} DitherMethod;
34
35typedef struct _QuantizeInfo
36{
cristybb503372010-05-27 20:51:26 +000037 size_t
anthony72feaa62012-01-17 06:46:23 +000038 number_colors; /* desired maximum number of colors */
cristy3ed852e2009-09-05 21:47:34 +000039
cristybb503372010-05-27 20:51:26 +000040 size_t
cristy3ed852e2009-09-05 21:47:34 +000041 tree_depth;
42
cristy3ed852e2009-09-05 21:47:34 +000043 ColorspaceType
44 colorspace;
45
cristycbda6112012-05-27 20:57:16 +000046 DitherMethod
47 dither_method;
48
cristy3ed852e2009-09-05 21:47:34 +000049 MagickBooleanType
50 measure_error;
51
cristybb503372010-05-27 20:51:26 +000052 size_t
cristy3ed852e2009-09-05 21:47:34 +000053 signature;
cristy3ed852e2009-09-05 21:47:34 +000054} QuantizeInfo;
55
56extern MagickExport MagickBooleanType
cristy018f07f2011-09-04 21:15:19 +000057 CompressImageColormap(Image *,ExceptionInfo *),
cristy8a11cb12011-10-19 23:53:34 +000058 GetImageQuantizeError(Image *,ExceptionInfo *),
cristycbda6112012-05-27 20:57:16 +000059 PosterizeImage(Image *,const size_t,const DitherMethod,ExceptionInfo *),
cristy018f07f2011-09-04 21:15:19 +000060 QuantizeImage(const QuantizeInfo *,Image *,ExceptionInfo *),
61 QuantizeImages(const QuantizeInfo *,Image *,ExceptionInfo *),
62 RemapImage(const QuantizeInfo *,Image *,const Image *,ExceptionInfo *),
63 RemapImages(const QuantizeInfo *,Image *,const Image *,ExceptionInfo *);
cristy3ed852e2009-09-05 21:47:34 +000064
65extern MagickExport QuantizeInfo
66 *AcquireQuantizeInfo(const ImageInfo *),
67 *CloneQuantizeInfo(const QuantizeInfo *),
68 *DestroyQuantizeInfo(QuantizeInfo *);
69
70extern MagickExport void
71 GetQuantizeInfo(QuantizeInfo *);
72
73#if defined(__cplusplus) || defined(c_plusplus)
74}
75#endif
76
77#endif