|
MagickCore
6.7.5
|
#include "MagickCore/studio.h"#include "MagickCore/attribute.h"#include "MagickCore/cache-view.h"#include "MagickCore/color.h"#include "MagickCore/color-private.h"#include "MagickCore/colormap.h"#include "MagickCore/colorspace.h"#include "MagickCore/colorspace-private.h"#include "MagickCore/enhance.h"#include "MagickCore/exception.h"#include "MagickCore/exception-private.h"#include "MagickCore/histogram.h"#include "MagickCore/image.h"#include "MagickCore/image-private.h"#include "MagickCore/list.h"#include "MagickCore/memory_.h"#include "MagickCore/monitor.h"#include "MagickCore/monitor-private.h"#include "MagickCore/option.h"#include "MagickCore/pixel-accessor.h"#include "MagickCore/quantize.h"#include "MagickCore/quantum.h"#include "MagickCore/quantum-private.h"#include "MagickCore/string_.h"#include "MagickCore/thread-private.h"
Go to the source code of this file.
Data Structures | |
| struct | _RealPixelInfo |
| struct | _NodeInfo |
| struct | _Nodes |
| struct | _CubeInfo |
Defines | |
| #define | CacheShift 2 |
| #define | ErrorQueueLength 16 |
| #define | MaxNodes 266817 |
| #define | MaxTreeDepth 8 |
| #define | NodesInAList 1920 |
| #define | AssignImageTag "Assign/Image" |
| #define | ClassifyImageTag "Classify/Image" |
| #define | RedShift(pixel) (((pixel) >> CacheShift) << (0*(8-CacheShift))) |
| #define | GreenShift(pixel) (((pixel) >> CacheShift) << (1*(8-CacheShift))) |
| #define | BlueShift(pixel) (((pixel) >> CacheShift) << (2*(8-CacheShift))) |
| #define | AlphaShift(pixel) (((pixel) >> CacheShift) << (3*(8-CacheShift))) |
| #define | DitherImageTag "Dither/Image" |
| #define | DitherImageTag "Dither/Image" |
| #define | PosterizeImageTag "Posterize/Image" |
| #define | PosterizePixel(pixel) |
| #define | ReduceImageTag "Reduce/Image" |
Typedefs | |
| typedef struct _RealPixelInfo | RealPixelInfo |
| typedef struct _NodeInfo | NodeInfo |
| typedef struct _Nodes | Nodes |
| typedef struct _CubeInfo | CubeInfo |
Functions | |
| static CubeInfo * | GetCubeInfo (const QuantizeInfo *, const size_t, const size_t) |
| static NodeInfo * | GetNodeInfo (CubeInfo *, const size_t, const size_t, NodeInfo *) |
| static MagickBooleanType | AssignImageColors (Image *, CubeInfo *, ExceptionInfo *) |
| static MagickBooleanType | ClassifyImageColors (CubeInfo *, const Image *, ExceptionInfo *) |
| static MagickBooleanType | DitherImage (Image *, CubeInfo *, ExceptionInfo *) |
| static MagickBooleanType | SetGrayscaleImage (Image *, ExceptionInfo *) |
| static size_t | DefineImageColormap (Image *, CubeInfo *, NodeInfo *) |
| static void | ClosestColor (const Image *, CubeInfo *, const NodeInfo *) |
| static void | DestroyCubeInfo (CubeInfo *) |
| static void | PruneLevel (const Image *, CubeInfo *, const NodeInfo *) |
| static void | PruneToCubeDepth (const Image *, CubeInfo *, const NodeInfo *) |
| static void | ReduceImageColors (const Image *, CubeInfo *) |
| MagickExport QuantizeInfo * | AcquireQuantizeInfo (const ImageInfo *image_info) |
| static void | AssociateAlphaPixel (const Image *image, const CubeInfo *cube_info, const Quantum *pixel, RealPixelInfo *alpha_pixel) |
| static void | AssociateAlphaPixelInfo (const Image *image, const CubeInfo *cube_info, const PixelInfo *pixel, RealPixelInfo *alpha_pixel) |
| static Quantum | ClampToUnsignedQuantum (const MagickRealType value) |
| static size_t | ColorToNodeId (const CubeInfo *cube_info, const RealPixelInfo *pixel, size_t index) |
| static void | SetAssociatedAlpha (const Image *image, CubeInfo *cube_info) |
| MagickExport QuantizeInfo * | CloneQuantizeInfo (const QuantizeInfo *quantize_info) |
| MagickExport MagickBooleanType | CompressImageColormap (Image *image, ExceptionInfo *exception) |
| MagickExport QuantizeInfo * | DestroyQuantizeInfo (QuantizeInfo *quantize_info) |
| static RealPixelInfo ** | DestroyPixelThreadSet (RealPixelInfo **pixels) |
| static RealPixelInfo ** | AcquirePixelThreadSet (const size_t count) |
| static ssize_t | CacheOffset (CubeInfo *cube_info, const RealPixelInfo *pixel) |
| static MagickBooleanType | FloydSteinbergDither (Image *image, CubeInfo *cube_info, ExceptionInfo *exception) |
| static MagickBooleanType | RiemersmaDither (Image *, CacheView *, CubeInfo *, const unsigned int, ExceptionInfo *exception) |
| static void | Riemersma (Image *image, CacheView *image_view, CubeInfo *cube_info, const size_t level, const unsigned int direction, ExceptionInfo *exception) |
| static ssize_t | MagickMax (const ssize_t x, const ssize_t y) |
| static ssize_t | MagickMin (const ssize_t x, const ssize_t y) |
| MagickExport MagickBooleanType | GetImageQuantizeError (Image *image, ExceptionInfo *exception) |
| MagickExport void | GetQuantizeInfo (QuantizeInfo *quantize_info) |
| static ssize_t | MagickRound (MagickRealType x) |
| MagickExport MagickBooleanType | PosterizeImage (Image *image, const size_t levels, const MagickBooleanType dither, ExceptionInfo *exception) |
| static void | PruneChild (const Image *image, CubeInfo *cube_info, const NodeInfo *node_info) |
| static MagickBooleanType | DirectToColormapImage (Image *image, ExceptionInfo *exception) |
| MagickExport MagickBooleanType | QuantizeImage (const QuantizeInfo *quantize_info, Image *image, ExceptionInfo *exception) |
| MagickExport MagickBooleanType | QuantizeImages (const QuantizeInfo *quantize_info, Image *images, ExceptionInfo *exception) |
| static void | Reduce (const Image *image, CubeInfo *cube_info, const NodeInfo *node_info) |
| MagickExport MagickBooleanType | RemapImage (const QuantizeInfo *quantize_info, Image *image, const Image *remap_image, ExceptionInfo *exception) |
| MagickExport MagickBooleanType | RemapImages (const QuantizeInfo *quantize_info, Image *images, const Image *remap_image, ExceptionInfo *exception) |
| static int | IntensityCompare (const void *x, const void *y) |
| #define AlphaShift | ( | pixel | ) | (((pixel) >> CacheShift) << (3*(8-CacheShift))) |
Referenced by CacheOffset().
| #define AssignImageTag "Assign/Image" |
Referenced by AssignImageColors(), DirectToColormapImage(), and QuantizeImages().
| #define BlueShift | ( | pixel | ) | (((pixel) >> CacheShift) << (2*(8-CacheShift))) |
Referenced by CacheOffset().
| #define CacheShift 2 |
Definition at line 207 of file quantize.c.
Referenced by GetCubeInfo().
| #define ClassifyImageTag "Classify/Image" |
Referenced by ClassifyImageColors().
| #define DitherImageTag "Dither/Image" |
Referenced by FloydSteinbergDither(), RiemersmaDither(), and OrderedPosterizeImage().
| #define DitherImageTag "Dither/Image" |
| #define ErrorQueueLength 16 |
Definition at line 211 of file quantize.c.
Referenced by RiemersmaDither(), DitherImage(), and GetCubeInfo().
| #define GreenShift | ( | pixel | ) | (((pixel) >> CacheShift) << (1*(8-CacheShift))) |
Referenced by CacheOffset().
| #define MaxNodes 266817 |
Definition at line 212 of file quantize.c.
Referenced by ClassifyImageColors().
| #define MaxTreeDepth 8 |
Definition at line 213 of file quantize.c.
Referenced by AssignImageColors(), ClassifyImageColors(), CompressImageColormap(), FloydSteinbergDither(), RiemersmaDither(), GetCubeInfo(), PosterizeImage(), RemapImage(), and RemapImages().
| #define NodesInAList 1920 |
Definition at line 214 of file quantize.c.
Referenced by GetNodeInfo().
| #define PosterizeImageTag "Posterize/Image" |
Referenced by PosterizeImage().
| #define PosterizePixel | ( | pixel | ) |
(Quantum) (QuantumRange*(MagickRound( \ QuantumScale*pixel*(levels-1)))/MagickMax((ssize_t) levels-1,1))
Referenced by PosterizeImage().
| #define RedShift | ( | pixel | ) | (((pixel) >> CacheShift) << (0*(8-CacheShift))) |
Referenced by CacheOffset().
| #define ReduceImageTag "Reduce/Image" |
Referenced by ReduceImageColors().
| typedef struct _RealPixelInfo RealPixelInfo |
| static RealPixelInfo** AcquirePixelThreadSet | ( | const size_t | count | ) | [static] |
Definition at line 1426 of file quantize.c.
References GetOpenMPMaximumThreads(), AcquireQuantumMemory(), ResetMagickMemory(), and DestroyPixelThreadSet().
Referenced by ProfileImage(), and FloydSteinbergDither().
| MagickExport QuantizeInfo* AcquireQuantizeInfo | ( | const ImageInfo * | image_info | ) |
Definition at line 368 of file quantize.c.
References AcquireMagickMemory(), ThrowFatalException, ResourceLimitFatalError, GetQuantizeInfo(), _QuantizeInfo::dither, _ImageInfo::dither, GetImageOption(), _QuantizeInfo::dither_method, ParseCommandOption(), MagickDitherOptions, MagickFalse, _QuantizeInfo::measure_error, and _ImageInfo::verbose.
Referenced by UniqueImageColors(), SetImageType(), and PosterizeImage().
| static MagickBooleanType AssignImageColors | ( | Image * | image, |
| CubeInfo * | cube_info, | ||
| ExceptionInfo * | exception | ||
| ) | [static] |
Definition at line 500 of file quantize.c.
References _CubeInfo::quantize_info, _QuantizeInfo::colorspace, UndefinedColorspace, CMYKColorspace, TransformImageColorspace(), _Image::colorspace, GRAYColorspace, IsRGBColorspace(), MagickFalse, CMYColorspace, RGBColorspace, AcquireImageColormap(), _CubeInfo::colors, ThrowBinaryException, ResourceLimitError, _Image::filename, _Image::colors, _CubeInfo::transparent_pixels, _CubeInfo::transparent_index, DefineImageColormap(), _CubeInfo::root, _QuantizeInfo::dither, _QuantizeInfo::dither_method, NoDitherMethod, DitherImage(), MagickTrue, AcquireCacheView(), _Image::rows, GetCacheViewAuthenticPixels(), _Image::columns, GetPixelInfoPixel(), GetPixelChannels(), IsPixelEquivalent(), AssociateAlphaPixel(), MaxTreeDepth, ColorToNodeId(), _NodeInfo::child, _CubeInfo::target, _CubeInfo::distance, QuantumRange, ClosestColor(), _NodeInfo::parent, _CubeInfo::color_number, _Image::storage_class, PseudoClass, SetPixelIndex(), _QuantizeInfo::measure_error, SetPixelRed(), _Image::colormap, _PixelInfo::red, SetPixelGreen(), _PixelInfo::green, SetPixelBlue(), _PixelInfo::blue, _CubeInfo::associate_alpha, SetPixelAlpha(), _PixelInfo::alpha, SyncCacheViewAuthenticPixels(), _Image::progress_monitor, SetImageProgress(), AssignImageTag, DestroyCacheView(), GetImageQuantizeError(), _QuantizeInfo::number_colors, GetPixelInfoIntensity(), and SyncImage().
Referenced by QuantizeImage(), QuantizeImages(), RemapImage(), and RemapImages().
| static void AssociateAlphaPixel | ( | const Image * | image, |
| const CubeInfo * | cube_info, | ||
| const Quantum * | pixel, | ||
| RealPixelInfo * | alpha_pixel | ||
| ) | [inline, static] |
Definition at line 432 of file quantize.c.
References _CubeInfo::associate_alpha, MagickFalse, GetPixelAlpha(), OpaqueAlpha, _RealPixelInfo::red, GetPixelRed(), _RealPixelInfo::green, GetPixelGreen(), _RealPixelInfo::blue, GetPixelBlue(), _RealPixelInfo::alpha, and QuantumScale.
Referenced by AssignImageColors(), ClassifyImageColors(), FloydSteinbergDither(), and RiemersmaDither().
| static void AssociateAlphaPixelInfo | ( | const Image * | image, |
| const CubeInfo * | cube_info, | ||
| const PixelInfo * | pixel, | ||
| RealPixelInfo * | alpha_pixel | ||
| ) | [inline, static] |
Definition at line 454 of file quantize.c.
References _CubeInfo::associate_alpha, MagickFalse, _PixelInfo::alpha, OpaqueAlpha, _RealPixelInfo::red, _PixelInfo::red, _RealPixelInfo::green, _PixelInfo::green, _RealPixelInfo::blue, _PixelInfo::blue, _RealPixelInfo::alpha, and QuantumScale.
Referenced by FloydSteinbergDither(), and RiemersmaDither().
| static ssize_t CacheOffset | ( | CubeInfo * | cube_info, |
| const RealPixelInfo * | pixel | ||
| ) | [inline, static] |
Definition at line 1453 of file quantize.c.
References RedShift, ClampToUnsignedQuantum(), _RealPixelInfo::red, GreenShift, _RealPixelInfo::green, BlueShift, _RealPixelInfo::blue, _CubeInfo::associate_alpha, MagickFalse, AlphaShift, and _RealPixelInfo::alpha.
Referenced by FloydSteinbergDither(), and RiemersmaDither().
| static Quantum ClampToUnsignedQuantum | ( | const MagickRealType | value | ) | [inline, static] |
Definition at line 477 of file quantize.c.
References QuantumRange.
Referenced by ColorToNodeId(), CacheOffset(), FloydSteinbergDither(), and RiemersmaDither().
| static MagickBooleanType ClassifyImageColors | ( | CubeInfo * | cube_info, |
| const Image * | image, | ||
| ExceptionInfo * | exception | ||
| ) |
Definition at line 760 of file quantize.c.
References SetAssociatedAlpha(), _CubeInfo::quantize_info, _QuantizeInfo::colorspace, UndefinedColorspace, CMYKColorspace, TransformImageColorspace(), _Image::colorspace, GRAYColorspace, CMYColorspace, IsRGBColorspace(), MagickFalse, RGBColorspace, _RealPixelInfo::red, QuantumRange, _RealPixelInfo::green, _RealPixelInfo::blue, _RealPixelInfo::alpha, AcquireCacheView(), _Image::rows, GetCacheViewVirtualPixels(), _Image::columns, _CubeInfo::nodes, MaxNodes, PruneLevel(), _CubeInfo::root, _CubeInfo::depth, GetPixelInfoPixel(), GetPixelChannels(), IsPixelEquivalent(), AssociateAlphaPixel(), MaxTreeDepth, ColorToNodeId(), _NodeInfo::child, GetNodeInfo(), ThrowMagickException(), GetMagickModule, ResourceLimitError, _Image::filename, _CubeInfo::colors, QuantumScale, _CubeInfo::associate_alpha, _NodeInfo::quantize_error, _NodeInfo::number_unique, _NodeInfo::total_color, _CubeInfo::maximum_colors, PruneToCubeDepth(), SetImageProgress(), ClassifyImageTag, DestroyCacheView(), and MagickTrue.
Referenced by QuantizeImage(), QuantizeImages(), RemapImage(), and RemapImages().
| MagickExport QuantizeInfo* CloneQuantizeInfo | ( | const QuantizeInfo * | quantize_info | ) |
Definition at line 1029 of file quantize.c.
References AcquireMagickMemory(), ThrowFatalException, ResourceLimitFatalError, GetQuantizeInfo(), _QuantizeInfo::number_colors, _QuantizeInfo::tree_depth, _QuantizeInfo::dither, _QuantizeInfo::dither_method, _QuantizeInfo::colorspace, and _QuantizeInfo::measure_error.
Referenced by GetCubeInfo().
| static void ClosestColor | ( | const Image * | image, |
| CubeInfo * | cube_info, | ||
| const NodeInfo * | node_info | ||
| ) | [static] |
Definition at line 1078 of file quantize.c.
References _CubeInfo::associate_alpha, MagickFalse, _NodeInfo::child, _NodeInfo::number_unique, _Image::colormap, _NodeInfo::color_number, _CubeInfo::target, QuantumScale, _CubeInfo::distance, and _CubeInfo::color_number.
Referenced by AssignImageColors(), FloydSteinbergDither(), and RiemersmaDither().
| static size_t ColorToNodeId | ( | const CubeInfo * | cube_info, |
| const RealPixelInfo * | pixel, | ||
| size_t | index | ||
| ) | [inline, static] |
Definition at line 486 of file quantize.c.
References ClampToUnsignedQuantum(), _RealPixelInfo::red, _RealPixelInfo::green, _RealPixelInfo::blue, _CubeInfo::associate_alpha, MagickFalse, and _RealPixelInfo::alpha.
Referenced by AssignImageColors(), ClassifyImageColors(), FloydSteinbergDither(), and RiemersmaDither().
| MagickExport MagickBooleanType CompressImageColormap | ( | Image * | image, |
| ExceptionInfo * | exception | ||
| ) |
Definition at line 1173 of file quantize.c.
References _Image::signature, MagickSignature, _Image::debug, MagickFalse, LogMagickEvent(), TraceEvent, GetMagickModule, _Image::filename, IsPaletteImage(), GetQuantizeInfo(), _QuantizeInfo::number_colors, _Image::colors, _QuantizeInfo::tree_depth, MaxTreeDepth, and QuantizeImage().
| static size_t DefineImageColormap | ( | Image * | image, |
| CubeInfo * | cube_info, | ||
| NodeInfo * | node_info | ||
| ) | [static] |
Definition at line 1222 of file quantize.c.
References _CubeInfo::associate_alpha, MagickFalse, _NodeInfo::child, _NodeInfo::number_unique, _Image::colormap, _Image::colors, MagickEpsilon, ClampToQuantum(), QuantumRange, _NodeInfo::total_color, _RealPixelInfo::red, _RealPixelInfo::green, _RealPixelInfo::blue, OpaqueAlpha, _RealPixelInfo::alpha, QuantumScale, _CubeInfo::transparent_pixels, _CubeInfo::transparent_index, and _NodeInfo::color_number.
Referenced by AssignImageColors().
| static void DestroyCubeInfo | ( | CubeInfo * | cube_info | ) |
Definition at line 1326 of file quantize.c.
References _CubeInfo::node_queue, _Nodes::next, _Nodes::nodes, RelinquishMagickMemory(), _CubeInfo::cache, _CubeInfo::quantize_info, and DestroyQuantizeInfo().
Referenced by QuantizeImage(), QuantizeImages(), RemapImage(), and RemapImages().
| static RealPixelInfo** DestroyPixelThreadSet | ( | RealPixelInfo ** | pixels | ) | [static] |
Definition at line 1413 of file quantize.c.
References GetOpenMPMaximumThreads(), and RelinquishMagickMemory().
Referenced by ProfileImage(), AcquirePixelThreadSet(), and FloydSteinbergDither().
| MagickExport QuantizeInfo* DestroyQuantizeInfo | ( | QuantizeInfo * | quantize_info | ) |
Definition at line 1372 of file quantize.c.
References LogMagickEvent(), TraceEvent, GetMagickModule, _QuantizeInfo::signature, MagickSignature, and RelinquishMagickMemory().
Referenced by UniqueImageColors(), SetImageType(), DestroyCubeInfo(), and PosterizeImage().
| static MagickBooleanType DirectToColormapImage | ( | Image * | image, |
| ExceptionInfo * | exception | ||
| ) | [static] |
Definition at line 2649 of file quantize.c.
References MagickTrue, _Image::columns, _Image::rows, AcquireImageColormap(), MagickFalse, ThrowBinaryException, ResourceLimitError, _Image::filename, _Image::colors, AcquireCacheView(), GetCacheViewAuthenticPixels(), _Image::colormap, _PixelInfo::red, GetPixelRed(), _PixelInfo::green, GetPixelGreen(), _PixelInfo::blue, GetPixelBlue(), _PixelInfo::alpha, GetPixelAlpha(), SetPixelIndex(), GetPixelChannels(), SyncCacheViewAuthenticPixels(), SetImageProgress(), AssignImageTag, and DestroyCacheView().
Referenced by QuantizeImage().
| static MagickBooleanType DitherImage | ( | Image * | image, |
| CubeInfo * | cube_info, | ||
| ExceptionInfo * | exception | ||
| ) |
Definition at line 1930 of file quantize.c.
References _CubeInfo::quantize_info, _QuantizeInfo::dither_method, RiemersmaDitherMethod, FloydSteinbergDither(), ResetMagickMemory(), _CubeInfo::error, ErrorQueueLength, _CubeInfo::x, _CubeInfo::y, MagickMax(), _Image::columns, _Image::rows, _CubeInfo::offset, _CubeInfo::span, AcquireCacheView(), Riemersma(), NorthGravity, RiemersmaDither(), ForgetGravity, and DestroyCacheView().
Referenced by AssignImageColors().
| static MagickBooleanType FloydSteinbergDither | ( | Image * | image, |
| CubeInfo * | cube_info, | ||
| ExceptionInfo * | exception | ||
| ) | [static] |
Definition at line 1474 of file quantize.c.
References AcquirePixelThreadSet(), _Image::columns, MagickFalse, MagickTrue, AcquireCacheView(), _Image::rows, GetOpenMPThreadId(), GetCacheViewAuthenticPixels(), GetPixelChannels(), AssociateAlphaPixel(), _RealPixelInfo::red, _RealPixelInfo::green, _RealPixelInfo::blue, _CubeInfo::associate_alpha, _RealPixelInfo::alpha, ClampToUnsignedQuantum(), CacheOffset(), _CubeInfo::cache, _CubeInfo::root, MaxTreeDepth, ColorToNodeId(), _NodeInfo::child, _CubeInfo::target, _CubeInfo::distance, QuantumRange, ClosestColor(), _NodeInfo::parent, _CubeInfo::color_number, _Image::storage_class, PseudoClass, SetPixelIndex(), _CubeInfo::quantize_info, _QuantizeInfo::measure_error, SetPixelRed(), _Image::colormap, _PixelInfo::red, SetPixelGreen(), _PixelInfo::green, SetPixelBlue(), _PixelInfo::blue, SetPixelAlpha(), _PixelInfo::alpha, SyncCacheViewAuthenticPixels(), AssociateAlphaPixelInfo(), _Image::progress_monitor, SetImageProgress(), DitherImageTag, DestroyCacheView(), and DestroyPixelThreadSet().
Referenced by DitherImage().
| static CubeInfo * GetCubeInfo | ( | const QuantizeInfo * | quantize_info, |
| const size_t | depth, | ||
| const size_t | maximum_colors | ||
| ) | [static] |
Definition at line 2003 of file quantize.c.
References AcquireMagickMemory(), ResetMagickMemory(), _CubeInfo::depth, MaxTreeDepth, _CubeInfo::maximum_colors, _CubeInfo::root, GetNodeInfo(), _NodeInfo::parent, _CubeInfo::quantize_info, CloneQuantizeInfo(), _QuantizeInfo::dither, MagickFalse, CacheShift, _CubeInfo::cache, AcquireQuantumMemory(), ErrorQueueLength, _CubeInfo::weights, and QuantumRange.
Referenced by QuantizeImage(), QuantizeImages(), RemapImage(), and RemapImages().
| MagickExport MagickBooleanType GetImageQuantizeError | ( | Image * | image, |
| ExceptionInfo * | exception | ||
| ) |
Definition at line 2186 of file quantize.c.
References _Image::signature, MagickSignature, _Image::debug, MagickFalse, LogMagickEvent(), TraceEvent, GetMagickModule, _Image::filename, _Image::total_colors, GetNumberColors(), ResetMagickMemory(), _Image::error, _Image::storage_class, DirectClass, MagickTrue, _Image::columns, _Image::rows, AcquireCacheView(), GetCacheViewVirtualPixels(), GetPixelIndex(), _Image::matte, QuantumScale, GetPixelAlpha(), _Image::colormap, _PixelInfo::alpha, GetPixelRed(), _PixelInfo::red, GetPixelGreen(), _PixelInfo::green, GetPixelBlue(), _PixelInfo::blue, GetPixelChannels(), DestroyCacheView(), _ErrorInfo::mean_error_per_pixel, _ErrorInfo::normalized_mean_error, and _ErrorInfo::normalized_maximum_error.
Referenced by AssignImageColors().
| static NodeInfo * GetNodeInfo | ( | CubeInfo * | cube_info, |
| const size_t | id, | ||
| const size_t | level, | ||
| NodeInfo * | parent | ||
| ) | [static] |
Definition at line 2108 of file quantize.c.
References _CubeInfo::free_nodes, AcquireMagickMemory(), _Nodes::nodes, AcquireQuantumMemory(), NodesInAList, _Nodes::next, _CubeInfo::node_queue, _CubeInfo::next_node, _CubeInfo::nodes, ResetMagickMemory(), _NodeInfo::parent, _NodeInfo::id, and _NodeInfo::level.
Referenced by ClassifyImageColors(), and GetCubeInfo().
| MagickExport void GetQuantizeInfo | ( | QuantizeInfo * | quantize_info | ) |
Definition at line 2292 of file quantize.c.
References LogMagickEvent(), TraceEvent, GetMagickModule, ResetMagickMemory(), _QuantizeInfo::number_colors, _QuantizeInfo::dither, MagickTrue, _QuantizeInfo::dither_method, RiemersmaDitherMethod, _QuantizeInfo::colorspace, UndefinedColorspace, _QuantizeInfo::measure_error, MagickFalse, _QuantizeInfo::signature, and MagickSignature.
Referenced by PreviewImage(), AcquireQuantizeInfo(), CloneQuantizeInfo(), and CompressImageColormap().
| static int IntensityCompare | ( | const void * | x, |
| const void * | y | ||
| ) | [static] |
Definition at line 3238 of file quantize.c.
References GetPixelInfoIntensity().
Referenced by SetGrayscaleImage().
| static ssize_t MagickMax | ( | const ssize_t | x, |
| const ssize_t | y | ||
| ) | [inline, static] |
Definition at line 1916 of file quantize.c.
Referenced by DitherImage().
| static ssize_t MagickMin | ( | const ssize_t | x, |
| const ssize_t | y | ||
| ) | [inline, static] |
Definition at line 1923 of file quantize.c.
Referenced by PosterizeImage().
| static ssize_t MagickRound | ( | MagickRealType | x | ) | [inline, static] |
Definition at line 2338 of file quantize.c.
| MagickExport MagickBooleanType PosterizeImage | ( | Image * | image, |
| const size_t | levels, | ||
| const MagickBooleanType | dither, | ||
| ExceptionInfo * | exception | ||
| ) |
Definition at line 2348 of file quantize.c.
References _Image::signature, MagickSignature, _Image::debug, MagickFalse, LogMagickEvent(), TraceEvent, GetMagickModule, _Image::filename, _Image::storage_class, PseudoClass, _Image::colors, GetPixelRedTraits(), UpdatePixelTrait, _Image::colormap, _PixelInfo::red, PosterizePixel, GetPixelGreenTraits(), _PixelInfo::green, GetPixelBlueTraits(), _PixelInfo::blue, GetPixelAlphaTraits(), _PixelInfo::alpha, MagickTrue, AcquireCacheView(), _Image::rows, GetCacheViewAuthenticPixels(), _Image::columns, SetPixelRed(), GetPixelRed(), SetPixelGreen(), GetPixelGreen(), SetPixelBlue(), GetPixelBlue(), GetPixelBlackTraits(), _Image::colorspace, CMYKColorspace, SetPixelBlack(), GetPixelBlack(), _Image::matte, SetPixelAlpha(), GetPixelAlpha(), GetPixelChannels(), SyncCacheViewAuthenticPixels(), _Image::progress_monitor, SetImageProgress(), PosterizeImageTag, DestroyCacheView(), AcquireQuantizeInfo(), _QuantizeInfo::number_colors, MagickMin(), MaxColormapSize, _QuantizeInfo::dither, _QuantizeInfo::tree_depth, MaxTreeDepth, QuantizeImage(), and DestroyQuantizeInfo().
| static void PruneChild | ( | const Image * | image, |
| CubeInfo * | cube_info, | ||
| const NodeInfo * | node_info | ||
| ) | [static] |
Definition at line 2491 of file quantize.c.
References _CubeInfo::associate_alpha, MagickFalse, _NodeInfo::child, _NodeInfo::parent, _NodeInfo::number_unique, _NodeInfo::total_color, _RealPixelInfo::red, _RealPixelInfo::green, _RealPixelInfo::blue, _RealPixelInfo::alpha, _NodeInfo::id, and _CubeInfo::nodes.
Referenced by PruneLevel(), PruneToCubeDepth(), and Reduce().
Definition at line 2551 of file quantize.c.
References _CubeInfo::associate_alpha, MagickFalse, _NodeInfo::child, _NodeInfo::level, _CubeInfo::depth, and PruneChild().
Referenced by ClassifyImageColors().
| static void PruneToCubeDepth | ( | const Image * | image, |
| CubeInfo * | cube_info, | ||
| const NodeInfo * | node_info | ||
| ) |
Definition at line 2598 of file quantize.c.
References _CubeInfo::associate_alpha, MagickFalse, _NodeInfo::child, _NodeInfo::level, _CubeInfo::depth, and PruneChild().
Referenced by ClassifyImageColors().
| MagickExport MagickBooleanType QuantizeImage | ( | const QuantizeInfo * | quantize_info, |
| Image * | image, | ||
| ExceptionInfo * | exception | ||
| ) |
Definition at line 2711 of file quantize.c.
References _QuantizeInfo::signature, MagickSignature, _Image::signature, _Image::debug, MagickFalse, LogMagickEvent(), TraceEvent, GetMagickModule, _Image::filename, _QuantizeInfo::number_colors, MaxColormapSize, _Image::columns, _Image::rows, DirectToColormapImage(), IsImageGray(), _Image::matte, SetGrayscaleImage(), _Image::storage_class, PseudoClass, _Image::colors, MagickTrue, _QuantizeInfo::tree_depth, _QuantizeInfo::dither, GetCubeInfo(), ThrowBinaryException, ResourceLimitError, ClassifyImageColors(), ReduceImageColors(), AssignImageColors(), and DestroyCubeInfo().
Referenced by PreviewImage(), UniqueImageColors(), SetImageType(), CompressImageColormap(), PosterizeImage(), and QuantizeImages().
| MagickExport MagickBooleanType QuantizeImages | ( | const QuantizeInfo * | quantize_info, |
| Image * | images, | ||
| ExceptionInfo * | exception | ||
| ) |
Definition at line 2810 of file quantize.c.
References _QuantizeInfo::signature, MagickSignature, _Image::signature, _Image::debug, MagickFalse, LogMagickEvent(), TraceEvent, GetMagickModule, _Image::filename, GetNextImageInList(), QuantizeImage(), _QuantizeInfo::number_colors, MaxColormapSize, _QuantizeInfo::tree_depth, _QuantizeInfo::dither, GetCubeInfo(), ThrowMagickException(), ResourceLimitError, GetImageListLength(), SetImageProgressMonitor(), _Image::client_data, ClassifyImageColors(), SetImageProgress(), AssignImageTag, ReduceImageColors(), AssignImageColors(), and DestroyCubeInfo().
Referenced by RemapImages().
| static void Reduce | ( | const Image * | image, |
| CubeInfo * | cube_info, | ||
| const NodeInfo * | node_info | ||
| ) | [static] |
Definition at line 2949 of file quantize.c.
References _CubeInfo::associate_alpha, MagickFalse, _NodeInfo::child, _NodeInfo::quantize_error, _CubeInfo::pruning_threshold, PruneChild(), _NodeInfo::number_unique, _CubeInfo::colors, and _CubeInfo::next_threshold.
Referenced by ReduceImageColors().
Definition at line 3033 of file quantize.c.
References _CubeInfo::next_threshold, _CubeInfo::colors, _CubeInfo::maximum_colors, _CubeInfo::pruning_threshold, _CubeInfo::root, _NodeInfo::quantize_error, Reduce(), SetImageProgress(), ReduceImageTag, and MagickFalse.
Referenced by QuantizeImage(), and QuantizeImages().
| MagickExport MagickBooleanType RemapImage | ( | const QuantizeInfo * | quantize_info, |
| Image * | image, | ||
| const Image * | remap_image, | ||
| ExceptionInfo * | exception | ||
| ) |
Definition at line 3091 of file quantize.c.
References _Image::signature, MagickSignature, _Image::debug, MagickFalse, LogMagickEvent(), TraceEvent, GetMagickModule, _Image::filename, GetCubeInfo(), MaxTreeDepth, _QuantizeInfo::number_colors, ThrowBinaryException, ResourceLimitError, ClassifyImageColors(), _CubeInfo::quantize_info, _CubeInfo::colors, AssignImageColors(), and DestroyCubeInfo().
| MagickExport MagickBooleanType RemapImages | ( | const QuantizeInfo * | quantize_info, |
| Image * | images, | ||
| const Image * | remap_image, | ||
| ExceptionInfo * | exception | ||
| ) |
Definition at line 3157 of file quantize.c.
References _Image::signature, MagickSignature, _Image::debug, MagickFalse, LogMagickEvent(), TraceEvent, GetMagickModule, _Image::filename, QuantizeImages(), GetCubeInfo(), MaxTreeDepth, _QuantizeInfo::number_colors, ThrowBinaryException, ResourceLimitError, ClassifyImageColors(), _CubeInfo::quantize_info, _CubeInfo::colors, GetNextImageInList(), AssignImageColors(), and DestroyCubeInfo().
| static void Riemersma | ( | Image * | image, |
| CacheView * | image_view, | ||
| CubeInfo * | cube_info, | ||
| const size_t | level, | ||
| const unsigned int | direction, | ||
| ExceptionInfo * | exception | ||
| ) | [static] |
Definition at line 1667 of file quantize.c.
References WestGravity, RiemersmaDither(), EastGravity, SouthGravity, and NorthGravity.
Referenced by DitherImage().
| static MagickBooleanType RiemersmaDither | ( | Image * | image, |
| CacheView * | image_view, | ||
| CubeInfo * | cube_info, | ||
| const unsigned int | direction, | ||
| ExceptionInfo * | exception | ||
| ) | [static] |
Definition at line 1796 of file quantize.c.
References _CubeInfo::x, _Image::columns, _CubeInfo::y, _Image::rows, GetCacheViewAuthenticPixels(), MagickFalse, AssociateAlphaPixel(), ErrorQueueLength, _RealPixelInfo::red, _CubeInfo::weights, _CubeInfo::error, _RealPixelInfo::green, _RealPixelInfo::blue, _CubeInfo::associate_alpha, _RealPixelInfo::alpha, ClampToUnsignedQuantum(), CacheOffset(), _CubeInfo::cache, _CubeInfo::root, MaxTreeDepth, ColorToNodeId(), _NodeInfo::child, _NodeInfo::parent, _CubeInfo::target, _CubeInfo::distance, QuantumRange, ClosestColor(), _CubeInfo::color_number, _Image::storage_class, PseudoClass, SetPixelIndex(), _CubeInfo::quantize_info, _QuantizeInfo::measure_error, SetPixelRed(), _Image::colormap, _PixelInfo::red, SetPixelGreen(), _PixelInfo::green, SetPixelBlue(), _PixelInfo::blue, SetPixelAlpha(), _PixelInfo::alpha, SyncCacheViewAuthenticPixels(), CopyMagickMemory(), AssociateAlphaPixelInfo(), SetImageProgress(), DitherImageTag, _CubeInfo::offset, _CubeInfo::span, WestGravity, EastGravity, NorthGravity, SouthGravity, and MagickTrue.
Referenced by Riemersma(), and DitherImage().
Definition at line 746 of file quantize.c.
References _Image::matte, _CubeInfo::quantize_info, _QuantizeInfo::colorspace, TransparentColorspace, MagickFalse, _QuantizeInfo::number_colors, GRAYColorspace, and _CubeInfo::associate_alpha.
Referenced by ClassifyImageColors().
| static MagickBooleanType SetGrayscaleImage | ( | Image * | image, |
| ExceptionInfo * | exception | ||
| ) |
Definition at line 3258 of file quantize.c.
References _Image::signature, MagickSignature, _Image::type, GrayscaleType, TransformImageColorspace(), GRAYColorspace, AcquireQuantumMemory(), MaxMap, ThrowBinaryException, ResourceLimitError, _Image::filename, _Image::storage_class, PseudoClass, AcquireImageColormap(), MagickFalse, _Image::colors, MagickTrue, AcquireCacheView(), _Image::rows, GetCacheViewAuthenticPixels(), _Image::columns, GetPixelRed(), _Image::colormap, _PixelInfo::red, _PixelInfo::green, GetPixelGreen(), _PixelInfo::blue, GetPixelBlue(), SetPixelIndex(), GetPixelChannels(), SyncCacheViewAuthenticPixels(), DestroyCacheView(), _PixelInfo::alpha, IntensityCompare(), IsPixelInfoEquivalent(), RelinquishMagickMemory(), GetPixelIndex(), IsImageMonochrome(), and BilevelType.
Referenced by QuantizeImage().