|
MagickCore
6.7.5
|
#include "MagickCore/studio.h"#include "MagickCore/cache-view.h"#include "MagickCore/color-private.h"#include "MagickCore/enhance.h"#include "MagickCore/exception.h"#include "MagickCore/exception-private.h"#include "MagickCore/hashmap.h"#include "MagickCore/histogram.h"#include "MagickCore/image.h"#include "MagickCore/list.h"#include "MagickCore/memory_.h"#include "MagickCore/monitor-private.h"#include "MagickCore/pixel-accessor.h"#include "MagickCore/prepress.h"#include "MagickCore/quantize.h"#include "MagickCore/registry.h"#include "MagickCore/semaphore.h"#include "MagickCore/splay-tree.h"#include "MagickCore/statistic.h"#include "MagickCore/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 size_t) |
| static void | DestroyColorCube (const Image *, NodeInfo *) |
| static size_t | ColorToNodeId (const Image *image, const PixelInfo *pixel, size_t index) |
| static CubeInfo * | ClassifyImageColors (const Image *image, ExceptionInfo *exception) |
| static void | DefineImageHistogram (const Image *image, NodeInfo *node_info, PixelInfo **histogram) |
| static CubeInfo * | DestroyCubeInfo (const Image *image, CubeInfo *cube_info) |
| MagickExport PixelInfo * | GetImageHistogram (const Image *image, size_t *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 double black, const double white, const double gamma, ExceptionInfo *exception) |
| static int | HistogramCompare (const void *x, const void *y) |
| MagickExport size_t | GetNumberColors (const Image *image, FILE *file, ExceptionInfo *exception) |
| static void | UniqueColorsToImage (Image *unique_image, CacheView *unique_view, CubeInfo *cube_info, const NodeInfo *node_info, ExceptionInfo *exception) |
| MagickExport Image * | UniqueImageColors (const Image *image, ExceptionInfo *exception) |
| #define EvaluateImageTag " Compute image colors... " |
Referenced by ClassifyImageColors(), EvaluateImages(), and EvaluateImage().
| #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 ClassifyImageColors(), DefineImageHistogram(), IsHistogramImage(), IsPaletteImage(), 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 175 of file histogram.c.
References _Image::signature, MagickSignature, _Image::debug, MagickFalse, LogMagickEvent(), TraceEvent, GetMagickModule, _Image::filename, GetCubeInfo(), ThrowMagickException(), ResourceLimitError, GetPixelInfo(), AcquireCacheView(), _Image::rows, GetCacheViewVirtualPixels(), _Image::columns, _CubeInfo::root, MaxTreeDepth, GetPixelInfoPixel(), ColorToNodeId(), _NodeInfo::child, GetNodeInfo(), _NodeInfo::number_unique, _NodeInfo::list, IsPixelInfoEquivalent(), _PixelInfo::count, AcquireMagickMemory(), ResizeQuantumMemory(), _PixelInfo::red, GetPixelRed(), _PixelInfo::green, GetPixelGreen(), _PixelInfo::blue, GetPixelBlue(), _Image::colorspace, CMYKColorspace, _PixelInfo::black, GetPixelBlack(), _PixelInfo::alpha, GetPixelAlpha(), _CubeInfo::colors, GetPixelChannels(), SetImageProgress(), and EvaluateImageTag.
Referenced by GetImageHistogram(), GetNumberColors(), and UniqueImageColors().
| static size_t ColorToNodeId | ( | const Image * | image, |
| const PixelInfo * | pixel, | ||
| size_t | index | ||
| ) | [inline, static] |
Definition at line 159 of file histogram.c.
References ClampToQuantum(), _PixelInfo::red, _PixelInfo::green, _PixelInfo::blue, _Image::matte, MagickFalse, and _PixelInfo::alpha.
Referenced by ClassifyImageColors(), IsHistogramImage(), and IsPaletteImage().
| static void DefineImageHistogram | ( | const Image * | image, |
| NodeInfo * | node_info, | ||
| PixelInfo ** | histogram | ||
| ) | [static] |
Definition at line 333 of file histogram.c.
References _Image::matte, MagickFalse, _NodeInfo::child, _NodeInfo::level, MaxTreeDepth, _NodeInfo::list, and _NodeInfo::number_unique.
Referenced by GetImageHistogram().
Definition at line 433 of file histogram.c.
References _Image::matte, MagickFalse, _NodeInfo::child, _NodeInfo::list, and RelinquishMagickMemory().
Referenced by DestroyCubeInfo().
Definition at line 388 of file histogram.c.
References DestroyColorCube(), _CubeInfo::root, _CubeInfo::node_queue, _Nodes::next, and RelinquishMagickMemory().
Referenced by GetImageHistogram(), GetNumberColors(), and UniqueImageColors().
| static CubeInfo * GetCubeInfo | ( | void | ) | [static] |
Definition at line 474 of file histogram.c.
References AcquireMagickMemory(), ResetMagickMemory(), _CubeInfo::root, and GetNodeInfo().
Referenced by ClassifyImageColors(), IsHistogramImage(), and IsPaletteImage().
| MagickExport PixelInfo* GetImageHistogram | ( | const Image * | image, |
| size_t * | number_colors, | ||
| ExceptionInfo * | exception | ||
| ) |
Definition at line 522 of file histogram.c.
References ClassifyImageColors(), AcquireQuantumMemory(), _CubeInfo::colors, ThrowMagickException(), GetMagickModule, ResourceLimitError, _Image::filename, DefineImageHistogram(), _CubeInfo::root, and DestroyCubeInfo().
Referenced by GetNumberColors().
Definition at line 580 of file histogram.c.
References _CubeInfo::free_nodes, AcquireMagickMemory(), _Nodes::next, _CubeInfo::node_queue, _CubeInfo::node_info, _Nodes::nodes, NodesInAList, ResetMagickMemory(), and _NodeInfo::level.
Referenced by ClassifyImageColors(), GetCubeInfo(), IsHistogramImage(), and IsPaletteImage().
| MagickExport size_t GetNumberColors | ( | const Image * | image, |
| FILE * | file, | ||
| ExceptionInfo * | exception | ||
| ) |
Definition at line 1088 of file histogram.c.
References MaxTextExtent, ClassifyImageColors(), _CubeInfo::colors, DestroyCubeInfo(), GetImageHistogram(), HistogramCompare(), GetPixelInfo(), MagickTrue, CopyMagickString(), ConcatenateColorComponent(), RedPixelChannel, X11Compliance, ConcatenateMagickString(), GreenPixelChannel, BluePixelChannel, _PixelInfo::colorspace, CMYKColorspace, BlackPixelChannel, _PixelInfo::matte, MagickFalse, AlphaPixelChannel, QueryColorname(), SVGCompliance, GetColorTuple(), FormatLocaleFile(), MagickSizeFormat, _PixelInfo::count, _Image::progress_monitor, SetImageProgress(), HistogramImageTag, and RelinquishMagickMemory().
Referenced by IdentifyImage(), InterpretImageProperties(), and GetImageQuantizeError().
| static int HistogramCompare | ( | const void * | x, |
| const void * | y | ||
| ) | [static] |
Definition at line 1067 of file histogram.c.
References _PixelInfo::red, _PixelInfo::green, _PixelInfo::blue, and _PixelInfo::count.
Referenced by GetNumberColors().
| MagickExport MagickBooleanType IsHistogramImage | ( | const Image * | image, |
| ExceptionInfo * | exception | ||
| ) |
Definition at line 634 of file histogram.c.
References _Image::signature, MagickSignature, _Image::debug, MagickFalse, LogMagickEvent(), TraceEvent, GetMagickModule, _Image::filename, _Image::storage_class, PseudoClass, _Image::colors, MagickTrue, GetCubeInfo(), ThrowMagickException(), ResourceLimitError, GetPixelInfo(), AcquireCacheView(), _Image::rows, GetCacheViewVirtualPixels(), _Image::columns, _CubeInfo::root, MaxTreeDepth, GetPixelInfoPixel(), ColorToNodeId(), _NodeInfo::child, GetNodeInfo(), _NodeInfo::number_unique, _NodeInfo::list, IsPixelInfoEquivalent(), _PixelInfo::count, AcquireMagickMemory(), ResizeQuantumMemory(), _PixelInfo::red, GetPixelRed(), _PixelInfo::green, GetPixelGreen(), _PixelInfo::blue, GetPixelBlue(), _Image::colorspace, CMYKColorspace, _PixelInfo::black, GetPixelBlack(), _PixelInfo::alpha, GetPixelAlpha(), _CubeInfo::colors, MaximumUniqueColors, and GetPixelChannels().
Referenced by IdentifyImage().
| MagickExport MagickBooleanType IsPaletteImage | ( | const Image * | image, |
| ExceptionInfo * | exception | ||
| ) |
Definition at line 796 of file histogram.c.
References _Image::signature, MagickSignature, _Image::debug, MagickFalse, LogMagickEvent(), TraceEvent, GetMagickModule, _Image::filename, _Image::storage_class, PseudoClass, _Image::colors, MagickTrue, GetCubeInfo(), ThrowMagickException(), ResourceLimitError, GetPixelInfo(), AcquireCacheView(), _Image::rows, GetCacheViewVirtualPixels(), _Image::columns, _CubeInfo::root, MaxTreeDepth, GetPixelInfoPixel(), ColorToNodeId(), _NodeInfo::child, GetNodeInfo(), _NodeInfo::number_unique, _NodeInfo::list, IsPixelInfoEquivalent(), _PixelInfo::count, AcquireMagickMemory(), ResizeQuantumMemory(), _PixelInfo::red, GetPixelRed(), _PixelInfo::green, GetPixelGreen(), _PixelInfo::blue, GetPixelBlue(), _Image::colorspace, CMYKColorspace, _PixelInfo::black, GetPixelBlack(), _PixelInfo::alpha, GetPixelAlpha(), _CubeInfo::colors, and GetPixelChannels().
Referenced by GetImageType(), and CompressImageColormap().
| MagickExport MagickBooleanType MinMaxStretchImage | ( | Image * | image, |
| const double | black, | ||
| const double | white, | ||
| const double | gamma, | ||
| ExceptionInfo * | exception | ||
| ) |
Definition at line 979 of file histogram.c.
References MagickTrue, _Image::channel_mask, DefaultChannels, GetImageRange(), MagickEpsilon, LevelImage(), MagickFalse, GetPixelChannels(), GetPixelChannelMapChannel(), GetPixelChannelMapTraits(), UpdatePixelTrait, and SetPixelChannelMask().
Referenced by AutoLevelImage().
| static void UniqueColorsToImage | ( | Image * | unique_image, |
| CacheView * | unique_view, | ||
| CubeInfo * | cube_info, | ||
| const NodeInfo * | node_info, | ||
| ExceptionInfo * | exception | ||
| ) | [static] |
Definition at line 1206 of file histogram.c.
References _Image::matte, MagickFalse, _NodeInfo::child, _NodeInfo::level, MaxTreeDepth, MagickTrue, _NodeInfo::list, _NodeInfo::number_unique, QueueCacheViewAuthenticPixels(), _CubeInfo::x, SetPixelRed(), _PixelInfo::red, SetPixelGreen(), _PixelInfo::green, SetPixelBlue(), _PixelInfo::blue, SetPixelAlpha(), _PixelInfo::alpha, _Image::colorspace, CMYKColorspace, SetPixelBlack(), _PixelInfo::black, SyncCacheViewAuthenticPixels(), _Image::progress_monitor, SetImageProgress(), UniqueColorsImageTag, _CubeInfo::progress, and _CubeInfo::colors.
Referenced by UniqueImageColors().
| MagickExport Image* UniqueImageColors | ( | const Image * | image, |
| ExceptionInfo * | exception | ||
| ) |
Definition at line 1271 of file histogram.c.
References ClassifyImageColors(), CloneImage(), _CubeInfo::colors, MagickTrue, SetImageStorageClass(), DirectClass, MagickFalse, DestroyImage(), AcquireCacheView(), UniqueColorsToImage(), _CubeInfo::root, DestroyCacheView(), MaxColormapSize, AcquireQuantizeInfo(), _QuantizeInfo::number_colors, _QuantizeInfo::dither, _QuantizeInfo::tree_depth, QuantizeImage(), DestroyQuantizeInfo(), and DestroyCubeInfo().