cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1 | /* |
Cristy | f6ff9ea | 2016-12-05 09:53:35 -0500 | [diff] [blame] | 2 | Copyright 1999-2017 ImageMagick Studio LLC, a non-profit organization |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 3 | 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 | |
Cristy | f19d414 | 2017-04-24 11:34:30 -0400 | [diff] [blame] | 8 | https://www.imagemagick.org/script/license.php |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 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 | */ |
Cristy | 83bceaa | 2016-06-03 20:39:35 -0400 | [diff] [blame] | 18 | #ifndef MAGICKCORE_QUANTIZE_H |
| 19 | #define MAGICKCORE_QUANTIZE_H |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 20 | |
cristy | 6398ec7 | 2013-11-28 02:00:27 +0000 | [diff] [blame] | 21 | #include "MagickCore/colorspace.h" |
| 22 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 23 | #if defined(__cplusplus) || defined(c_plusplus) |
| 24 | extern "C" { |
| 25 | #endif |
| 26 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 27 | typedef enum |
| 28 | { |
| 29 | UndefinedDitherMethod, |
| 30 | NoDitherMethod, |
| 31 | RiemersmaDitherMethod, |
| 32 | FloydSteinbergDitherMethod |
| 33 | } DitherMethod; |
| 34 | |
| 35 | typedef struct _QuantizeInfo |
| 36 | { |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 37 | size_t |
anthony | 72feaa6 | 2012-01-17 06:46:23 +0000 | [diff] [blame] | 38 | number_colors; /* desired maximum number of colors */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 39 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 40 | size_t |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 41 | tree_depth; |
| 42 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 43 | ColorspaceType |
| 44 | colorspace; |
| 45 | |
cristy | cbda611 | 2012-05-27 20:57:16 +0000 | [diff] [blame] | 46 | DitherMethod |
| 47 | dither_method; |
| 48 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 49 | MagickBooleanType |
| 50 | measure_error; |
| 51 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 52 | size_t |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 53 | signature; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 54 | } QuantizeInfo; |
| 55 | |
| 56 | extern MagickExport MagickBooleanType |
cristy | 018f07f | 2011-09-04 21:15:19 +0000 | [diff] [blame] | 57 | CompressImageColormap(Image *,ExceptionInfo *), |
cristy | 8a11cb1 | 2011-10-19 23:53:34 +0000 | [diff] [blame] | 58 | GetImageQuantizeError(Image *,ExceptionInfo *), |
cristy | cbda611 | 2012-05-27 20:57:16 +0000 | [diff] [blame] | 59 | PosterizeImage(Image *,const size_t,const DitherMethod,ExceptionInfo *), |
cristy | 018f07f | 2011-09-04 21:15:19 +0000 | [diff] [blame] | 60 | 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 *); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 64 | |
| 65 | extern MagickExport QuantizeInfo |
| 66 | *AcquireQuantizeInfo(const ImageInfo *), |
| 67 | *CloneQuantizeInfo(const QuantizeInfo *), |
| 68 | *DestroyQuantizeInfo(QuantizeInfo *); |
| 69 | |
| 70 | extern MagickExport void |
| 71 | GetQuantizeInfo(QuantizeInfo *); |
| 72 | |
| 73 | #if defined(__cplusplus) || defined(c_plusplus) |
| 74 | } |
| 75 | #endif |
| 76 | |
| 77 | #endif |