blob: 9e643ad135b25bec67ff3349f8fa2129716b36d6 [file] [log] [blame]
cristy3ed852e2009-09-05 21:47:34 +00001/*
Cristyf6ff9ea2016-12-05 09:53:35 -05002 Copyright 1999-2017 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
Cristyf19d4142017-04-24 11:34:30 -04008 https://www.imagemagick.org/script/license.php
cristy3ed852e2009-09-05 21:47:34 +00009
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*/
Cristy83bceaa2016-06-03 20:39:35 -040018#ifndef MAGICKCORE_QUANTIZE_H
19#define MAGICKCORE_QUANTIZE_H
cristy3ed852e2009-09-05 21:47:34 +000020
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