#include "magick/studio.h"#include "magick/cache-view.h"#include "magick/color-private.h"#include "magick/enhance.h"#include "magick/exception.h"#include "magick/exception-private.h"#include "magick/hashmap.h"#include "magick/histogram.h"#include "magick/image.h"#include "magick/list.h"#include "magick/memory_.h"#include "magick/monitor-private.h"#include "magick/pixel-private.h"#include "magick/prepress.h"#include "magick/quantize.h"#include "magick/registry.h"#include "magick/semaphore.h"#include "magick/splay-tree.h"#include "magick/statistic.h"#include "magick/string_.h"
Go to the source code of this file.
Data Structures | |
| struct | _NodeInfo |
| struct | _Nodes |
| struct | _CubeInfo |
Defines | |
| #define | MaxTreeDepth 8 |
| #define | NodesInAList 1536 |
| #define | EvaluateImageTag " Compute image colors... " |
| #define | MaximumUniqueColors 1024 |
| #define | HistogramImageTag "Histogram/Image" |
| #define | UniqueColorsImageTag "UniqueColors/Image" |
Typedefs | |
| typedef struct _NodeInfo | NodeInfo |
| typedef struct _Nodes | Nodes |
| typedef struct _CubeInfo | CubeInfo |
Functions | |
| static CubeInfo * | GetCubeInfo (void) |
| static NodeInfo * | GetNodeInfo (CubeInfo *, const unsigned long) |
| static void | DestroyColorCube (const Image *, NodeInfo *) |
| static unsigned long | ColorToNodeId (const Image *image, const MagickPixelPacket *pixel, unsigned long index) |
| static CubeInfo * | ClassifyImageColors (const Image *image, ExceptionInfo *exception) |
| static void | DefineImageHistogram (const Image *image, NodeInfo *node_info, ColorPacket **histogram) |
| static CubeInfo * | DestroyCubeInfo (const Image *image, CubeInfo *cube_info) |
| MagickExport ColorPacket * | GetImageHistogram (const Image *image, unsigned long *number_colors, ExceptionInfo *exception) |
| MagickExport MagickBooleanType | IsHistogramImage (const Image *image, ExceptionInfo *exception) |
| MagickExport MagickBooleanType | IsPaletteImage (const Image *image, ExceptionInfo *exception) |
| MagickExport MagickBooleanType | MinMaxStretchImage (Image *image, const ChannelType channel, const double black_value, const double white_value) |
| static int | HistogramCompare (const void *x, const void *y) |
| MagickExport unsigned long | GetNumberColors (const Image *image, FILE *file, ExceptionInfo *exception) |
| static void | UniqueColorsToImage (Image *image, CubeInfo *cube_info, const NodeInfo *node_info, ExceptionInfo *exception) |
| MagickExport Image * | UniqueImageColors (const Image *image, ExceptionInfo *exception) |
| #define EvaluateImageTag " Compute image colors... " |
| #define HistogramImageTag "Histogram/Image" |
Referenced by GetNumberColors().
| #define MaximumUniqueColors 1024 |
Referenced by IsHistogramImage().
| #define MaxTreeDepth 8 |
Definition at line 67 of file histogram.c.
Referenced by AssignImageColors(), ClassifyImageColors(), CompressImageColormap(), DefineImageHistogram(), FloydSteinbergDither(), GetCubeInfo(), IsHistogramImage(), IsPaletteImage(), RemapImage(), RemapImages(), RiemersmaDither(), and UniqueColorsToImage().
| #define NodesInAList 1536 |
Definition at line 68 of file histogram.c.
Referenced by GetNodeInfo().
| #define UniqueColorsImageTag "UniqueColors/Image" |
Referenced by UniqueColorsToImage().
| static CubeInfo* ClassifyImageColors | ( | const Image * | image, | |
| ExceptionInfo * | exception | |||
| ) | [static] |
Definition at line 173 of file histogram.c.
References AcquireCacheView(), AcquireMagickMemory(), _NodeInfo::child, CMYKColorspace, _CubeInfo::colors, _Image::colorspace, ColorToNodeId(), _Image::columns, _ColorPacket::count, _Image::debug, DestroyCacheView(), EvaluateImageTag, _Image::filename, GetCacheViewVirtualIndexQueue(), GetCacheViewVirtualPixels(), GetCubeInfo(), GetMagickModule, GetMagickPixelPacket(), GetNodeInfo(), _ColorPacket::index, IsMagickColorEqual(), _NodeInfo::list, LogMagickEvent(), MagickFalse, MagickSignature, MaxTreeDepth, _NodeInfo::number_unique, _ColorPacket::pixel, PseudoClass, ResizeQuantumMemory(), ResourceLimitError, _CubeInfo::root, _Image::rows, SetImageProgress(), SetMagickPixelPacket(), _Image::signature, _Image::storage_class, ThrowMagickException(), and TraceEvent.
Referenced by GetImageHistogram(), GetNumberColors(), and UniqueImageColors().
| static unsigned long ColorToNodeId | ( | const Image * | image, | |
| const MagickPixelPacket * | pixel, | |||
| unsigned long | index | |||
| ) | [inline, static] |
Definition at line 157 of file histogram.c.
References _MagickPixelPacket::blue, _MagickPixelPacket::green, MagickFalse, _Image::matte, _MagickPixelPacket::opacity, _MagickPixelPacket::red, RoundToQuantum(), and ScaleQuantumToChar().
Referenced by ClassifyImageColors(), IsHistogramImage(), and IsPaletteImage().
| static void DefineImageHistogram | ( | const Image * | image, | |
| NodeInfo * | node_info, | |||
| ColorPacket ** | histogram | |||
| ) | [static] |
Definition at line 332 of file histogram.c.
References _NodeInfo::child, _ColorPacket::count, _ColorPacket::index, _NodeInfo::level, _NodeInfo::list, MagickFalse, _Image::matte, MaxTreeDepth, _NodeInfo::number_unique, and _ColorPacket::pixel.
Referenced by GetImageHistogram().
Definition at line 434 of file histogram.c.
References _NodeInfo::child, _NodeInfo::list, MagickFalse, _Image::matte, and RelinquishMagickMemory().
Referenced by DestroyCubeInfo().
Definition at line 389 of file histogram.c.
References DestroyColorCube(), _Nodes::next, _CubeInfo::node_queue, RelinquishMagickMemory(), and _CubeInfo::root.
Referenced by GetImageHistogram(), GetNumberColors(), IsHistogramImage(), IsPaletteImage(), and UniqueImageColors().
| static CubeInfo * GetCubeInfo | ( | void | ) | [static] |
Definition at line 475 of file histogram.c.
References AcquireMagickMemory(), GetNodeInfo(), ResetMagickMemory(), and _CubeInfo::root.
Referenced by ClassifyImageColors(), IsHistogramImage(), and IsPaletteImage().
| MagickExport ColorPacket* GetImageHistogram | ( | const Image * | image, | |
| unsigned long * | number_colors, | |||
| ExceptionInfo * | exception | |||
| ) |
Definition at line 523 of file histogram.c.
References AcquireQuantumMemory(), ClassifyImageColors(), _CubeInfo::colors, DefineImageHistogram(), DestroyCubeInfo(), _Image::filename, GetMagickModule, ResourceLimitError, _CubeInfo::root, and ThrowMagickException().
Referenced by GetNumberColors().
Definition at line 581 of file histogram.c.
References AcquireMagickMemory(), _CubeInfo::free_nodes, _NodeInfo::level, _Nodes::next, _CubeInfo::node_info, _CubeInfo::node_queue, _Nodes::nodes, NodesInAList, and ResetMagickMemory().
Referenced by ClassifyImageColors(), GetCubeInfo(), IsHistogramImage(), and IsPaletteImage().
| MagickExport unsigned long GetNumberColors | ( | const Image * | image, | |
| FILE * | file, | |||
| ExceptionInfo * | exception | |||
| ) |
Definition at line 1102 of file histogram.c.
References BlueChannel, ClassifyImageColors(), _Image::client_data, CMYKColorspace, _CubeInfo::colors, _MagickPixelPacket::colorspace, ConcatenateColorComponent(), ConcatenateMagickString(), CopyMagickString(), _ColorPacket::count, DestroyCubeInfo(), GetColorTuple(), GetImageHistogram(), GetMagickPixelPacket(), GreenChannel, HistogramCompare(), HistogramImageTag, _ColorPacket::index, IndexChannel, MagickFalse, MagickSizeFormat, MagickTrue, _MagickPixelPacket::matte, MaxTextExtent, OpacityChannel, _ColorPacket::pixel, _Image::progress_monitor, QuantumTick(), QueryMagickColorname(), RedChannel, RelinquishMagickMemory(), SetMagickPixelPacket(), SVGCompliance, and X11Compliance.
Referenced by GetImageQuantizeError(), IdentifyImage(), and InterpretImageProperties().
| static int HistogramCompare | ( | const void * | x, | |
| const void * | y | |||
| ) | [static] |
Definition at line 1081 of file histogram.c.
References _PixelPacket::blue, _ColorPacket::count, _PixelPacket::green, _ColorPacket::pixel, and _PixelPacket::red.
Referenced by GetNumberColors().
| MagickExport MagickBooleanType IsHistogramImage | ( | const Image * | image, | |
| ExceptionInfo * | exception | |||
| ) |
Definition at line 635 of file histogram.c.
References AcquireCacheView(), AcquireMagickMemory(), _NodeInfo::child, CMYKColorspace, _CubeInfo::colors, _Image::colors, _Image::colorspace, ColorToNodeId(), _Image::columns, _ColorPacket::count, _Image::debug, DestroyCacheView(), DestroyCubeInfo(), _Image::filename, GetCacheViewVirtualIndexQueue(), GetCacheViewVirtualPixels(), GetCubeInfo(), GetMagickModule, GetMagickPixelPacket(), GetNodeInfo(), _ColorPacket::index, IsMagickColorEqual(), _NodeInfo::list, LogMagickEvent(), MagickFalse, MagickSignature, MagickTrue, MaximumUniqueColors, MaxTreeDepth, _NodeInfo::number_unique, _ColorPacket::pixel, PseudoClass, ResizeQuantumMemory(), ResourceLimitError, _CubeInfo::root, _Image::rows, SetMagickPixelPacket(), _Image::signature, _Image::storage_class, ThrowMagickException(), and TraceEvent.
Referenced by IdentifyImage().
| MagickExport MagickBooleanType IsPaletteImage | ( | const Image * | image, | |
| ExceptionInfo * | exception | |||
| ) |
Definition at line 800 of file histogram.c.
References AcquireCacheView(), AcquireMagickMemory(), _NodeInfo::child, CMYKColorspace, _CubeInfo::colors, _Image::colors, _Image::colorspace, ColorToNodeId(), _Image::columns, _ColorPacket::count, _Image::debug, DestroyCacheView(), DestroyCubeInfo(), _Image::filename, GetCacheViewVirtualIndexQueue(), GetCacheViewVirtualPixels(), GetCubeInfo(), GetMagickModule, GetMagickPixelPacket(), GetNodeInfo(), _ColorPacket::index, IsMagickColorEqual(), _NodeInfo::list, LogMagickEvent(), MagickFalse, MagickSignature, MagickTrue, MaxTreeDepth, _NodeInfo::number_unique, _ColorPacket::pixel, PseudoClass, ResizeQuantumMemory(), ResourceLimitError, _CubeInfo::root, _Image::rows, SetMagickPixelPacket(), _Image::signature, _Image::storage_class, ThrowMagickException(), and TraceEvent.
Referenced by CompressImageColormap(), and GetImageType().
| MagickExport MagickBooleanType MinMaxStretchImage | ( | Image * | image, | |
| const ChannelType | channel, | |||
| const double | black_value, | |||
| const double | white_value | |||
| ) |
Definition at line 982 of file histogram.c.
References BlueChannel, CMYKColorspace, _Image::colorspace, _Image::exception, GetImageChannelRange(), GreenChannel, IndexChannel, LevelImageChannel(), MagickFalse, MagickTrue, _Image::matte, OpacityChannel, RedChannel, and SyncChannels.
Referenced by AutoLevelImageChannel().
| static void UniqueColorsToImage | ( | Image * | image, | |
| CubeInfo * | cube_info, | |||
| const NodeInfo * | node_info, | |||
| ExceptionInfo * | exception | |||
| ) | [static] |
Definition at line 1206 of file histogram.c.
References _NodeInfo::child, _Image::client_data, CMYKColorspace, _CubeInfo::colors, _Image::colorspace, GetAuthenticIndexQueue(), _ColorPacket::index, _NodeInfo::level, _NodeInfo::list, MagickFalse, _Image::matte, MaxTreeDepth, _NodeInfo::number_unique, _ColorPacket::pixel, _CubeInfo::progress, _Image::progress_monitor, QuantumTick(), QueueAuthenticPixels(), SyncAuthenticPixels(), UniqueColorsImageTag, and _CubeInfo::x.
Referenced by UniqueImageColors().
| MagickExport Image* UniqueImageColors | ( | const Image * | image, | |
| ExceptionInfo * | exception | |||
| ) |
Definition at line 1258 of file histogram.c.
References AcquireQuantizeInfo(), ClassifyImageColors(), CloneImage(), _CubeInfo::colors, DestroyCubeInfo(), DestroyImage(), DestroyQuantizeInfo(), DirectClass, _QuantizeInfo::dither, _Image::exception, InheritException(), MagickFalse, MagickTrue, MaxColormapSize, _QuantizeInfo::number_colors, QuantizeImage(), _CubeInfo::root, SetImageStorageClass(), _QuantizeInfo::tree_depth, and UniqueColorsToImage().
1.6.1