MagickCore 7.1.0
Convert, Edit, Or Compose Bitmap Images
|
#include "MagickCore/studio.h"
#include "MagickCore/artifact.h"
#include "MagickCore/blob.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/configure.h"
#include "MagickCore/constitute.h"
#include "MagickCore/decorate.h"
#include "MagickCore/draw.h"
#include "MagickCore/enhance.h"
#include "MagickCore/exception.h"
#include "MagickCore/exception-private.h"
#include "MagickCore/effect.h"
#include "MagickCore/fx.h"
#include "MagickCore/gem.h"
#include "MagickCore/gem-private.h"
#include "MagickCore/geometry.h"
#include "MagickCore/image-private.h"
#include "MagickCore/list.h"
#include "MagickCore/log.h"
#include "MagickCore/memory_.h"
#include "MagickCore/monitor.h"
#include "MagickCore/monitor-private.h"
#include "MagickCore/montage.h"
#include "MagickCore/option.h"
#include "MagickCore/pixel-accessor.h"
#include "MagickCore/property.h"
#include "MagickCore/quantize.h"
#include "MagickCore/quantum.h"
#include "MagickCore/quantum-private.h"
#include "MagickCore/random_.h"
#include "MagickCore/random-private.h"
#include "MagickCore/resize.h"
#include "MagickCore/resource_.h"
#include "MagickCore/segment.h"
#include "MagickCore/shear.h"
#include "MagickCore/signature-private.h"
#include "MagickCore/string_.h"
#include "MagickCore/string-private.h"
#include "MagickCore/thread-private.h"
#include "MagickCore/threshold.h"
#include "MagickCore/token.h"
#include "MagickCore/transform.h"
#include "MagickCore/xml-tree.h"
#include "MagickCore/xml-tree-private.h"
Go to the source code of this file.
Data Structures | |
struct | _ThresholdMap |
Macros | |
#define | ThresholdsFilename "thresholds.xml" |
#define | AdaptiveThresholdImageTag "AdaptiveThreshold/Image" |
#define | MaxIntensity 255 |
#define | ThresholdImageTag "Threshold/Image" |
#define | ThresholdImageTag "Threshold/Image" |
#define | ClampImageTag "Clamp/Image" |
#define | ThresholdImageTag "Threshold/Image" |
#define | DitherImageTag "Dither/Image" |
#define | PerceptibleImageTag "Perceptible/Image" |
#define | ThresholdImageTag "Threshold/Image" |
#define | ThresholdImageTag "Threshold/Image" |
#define | ThresholdImageTag "Threshold/Image" |
Functions | |
static ThresholdMap * | GetThresholdMapFile (const char *, const char *, const char *, ExceptionInfo *) |
MagickExport Image * | AdaptiveThresholdImage (const Image *image, const size_t width, const size_t height, const double bias, ExceptionInfo *exception) |
static double | KapurThreshold (const Image *image, const double *histogram, ExceptionInfo *exception) |
static double | OTSUThreshold (const Image *image, const double *histogram, ExceptionInfo *exception) |
static double | TriangleThreshold (const double *histogram) |
MagickExport MagickBooleanType | AutoThresholdImage (Image *image, const AutoThresholdMethod method, ExceptionInfo *exception) |
MagickExport MagickBooleanType | BilevelImage (Image *image, const double threshold, ExceptionInfo *exception) |
MagickExport MagickBooleanType | BlackThresholdImage (Image *image, const char *thresholds, ExceptionInfo *exception) |
MagickExport MagickBooleanType | ClampImage (Image *image, ExceptionInfo *exception) |
MagickExport MagickBooleanType | ColorThresholdImage (Image *image, const PixelInfo *start_color, const PixelInfo *stop_color, ExceptionInfo *exception) |
MagickExport ThresholdMap * | DestroyThresholdMap (ThresholdMap *map) |
MagickExport ThresholdMap * | GetThresholdMap (const char *map_id, ExceptionInfo *exception) |
MagickBooleanType | ListThresholdMapFile (FILE *file, const char *xml, const char *filename, ExceptionInfo *exception) |
MagickExport MagickBooleanType | ListThresholdMaps (FILE *file, ExceptionInfo *exception) |
MagickExport MagickBooleanType | OrderedDitherImage (Image *image, const char *threshold_map, ExceptionInfo *exception) |
static Quantum | PerceptibleThreshold (const Quantum quantum, const double epsilon) |
MagickExport MagickBooleanType | PerceptibleImage (Image *image, const double epsilon, ExceptionInfo *exception) |
MagickExport MagickBooleanType | RandomThresholdImage (Image *image, const double min_threshold, const double max_threshold, ExceptionInfo *exception) |
MagickExport MagickBooleanType | RangeThresholdImage (Image *image, const double low_black, const double low_white, const double high_white, const double high_black, ExceptionInfo *exception) |
MagickExport MagickBooleanType | WhiteThresholdImage (Image *image, const char *thresholds, ExceptionInfo *exception) |
Variables | |
static const char *const | BuiltinMap |
#define AdaptiveThresholdImageTag "AdaptiveThreshold/Image" |
#define ClampImageTag "Clamp/Image" |
#define DitherImageTag "Dither/Image" |
#define MaxIntensity 255 |
#define PerceptibleImageTag "Perceptible/Image" |
#define ThresholdImageTag "Threshold/Image" |
#define ThresholdImageTag "Threshold/Image" |
#define ThresholdImageTag "Threshold/Image" |
#define ThresholdImageTag "Threshold/Image" |
#define ThresholdImageTag "Threshold/Image" |
#define ThresholdImageTag "Threshold/Image" |
#define ThresholdsFilename "thresholds.xml" |
Definition at line 96 of file threshold.c.
MagickExport Image * AdaptiveThresholdImage | ( | const Image * | image, |
const size_t | width, | ||
const size_t | height, | ||
const double | bias, | ||
ExceptionInfo * | exception | ||
) |
Definition at line 182 of file threshold.c.
References AcquireAuthenticCacheView(), AcquireVirtualCacheView(), AdaptiveThresholdImageTag, CloneImage(), _Image::columns, CopyPixelTrait, DestroyCacheView(), DestroyImage(), DirectClass, _Image::filename, GetCacheViewVirtualPixels(), GetMagickModule, GetPixelChannelChannel(), GetPixelChannels(), GetPixelChannelTraits(), IsEventLogging(), LogMagickEvent(), magick_restrict, MagickCoreSignature, MagickFalse, MagickTrue, MaxPixelChannels, _Image::progress_monitor, QuantumRange, QueueCacheViewAuthenticPixels(), _Image::rows, SetImageProgress(), SetImageStorageClass(), SetPixelChannel(), _ExceptionInfo::signature, _Image::signature, SyncCacheViewAuthenticPixels(), TraceEvent, _Image::type, and UndefinedPixelTrait.
MagickExport MagickBooleanType AutoThresholdImage | ( | Image * | image, |
const AutoThresholdMethod | method, | ||
ExceptionInfo * | exception | ||
) |
Definition at line 661 of file threshold.c.
References AcquireQuantumMemory(), AcquireVirtualCacheView(), BilevelImage(), ClampToQuantum(), _Image::columns, DestroyCacheView(), _Image::filename, FormatLocaleFile(), FormatLocaleString(), GetCacheViewVirtualPixels(), GetImageArtifact(), GetMagickModule, GetMagickPrecision(), GetPixelChannels(), GetPixelIntensity(), IsEventLogging(), IsStringTrue(), KapurThreshold(), KapurThresholdMethod, LogMagickEvent(), magick_restrict, MagickCoreSignature, MagickFalse, MagickPathExtent, MagickTrue, MaxIntensity, OTSUThreshold(), OTSUThresholdMethod, PerceptibleReciprocal(), QuantumRange, RelinquishMagickMemory(), ResourceLimitError, _Image::rows, SetImageProperty(), _Image::signature, ThrowBinaryException, TraceEvent, TriangleThreshold(), and TriangleThresholdMethod.
MagickExport MagickBooleanType BilevelImage | ( | Image * | image, |
const double | threshold, | ||
ExceptionInfo * | exception | ||
) |
Definition at line 806 of file threshold.c.
References AcquireAuthenticCacheView(), _Image::channel_mask, _Image::colorspace, _Image::columns, DefaultChannels, DestroyCacheView(), DirectClass, _Image::filename, GetCacheViewAuthenticPixels(), GetMagickModule, GetPixelChannelChannel(), GetPixelChannels(), GetPixelChannelTraits(), GetPixelIntensity(), IsEventLogging(), IsGrayColorspace(), LogMagickEvent(), magick_restrict, MagickCoreSignature, MagickFalse, MagickTrue, _Image::progress_monitor, QuantumRange, _Image::rows, SetImageColorspace(), SetImageProgress(), SetImageStorageClass(), _Image::signature, sRGBColorspace, SyncCacheViewAuthenticPixels(), ThresholdImageTag, TraceEvent, and UpdatePixelTrait.
Referenced by AutoThresholdImage(), PreviewImage(), and SetImageType().
MagickExport MagickBooleanType BlackThresholdImage | ( | Image * | image, |
const char * | thresholds, | ||
ExceptionInfo * | exception | ||
) |
Definition at line 928 of file threshold.c.
References AcquireAuthenticCacheView(), _PixelInfo::alpha, _PixelInfo::black, _PixelInfo::blue, _Image::channel_mask, _GeometryInfo::chi, ChiValue, CMYKColorspace, _Image::colorspace, _PixelInfo::colorspace, _Image::columns, DefaultChannels, DestroyCacheView(), DirectClass, _Image::filename, GetCacheViewAuthenticPixels(), GetMagickModule, GetPixelChannelChannel(), GetPixelChannels(), GetPixelChannelTraits(), GetPixelInfo(), GetPixelInfoChannel(), GetPixelIntensity(), _PixelInfo::green, IsEventLogging(), IsGrayColorspace(), LogMagickEvent(), magick_restrict, MagickCoreSignature, MagickFalse, MagickTrue, ParseGeometry(), PercentValue, _Image::progress_monitor, _GeometryInfo::psi, PsiValue, QuantumRange, _PixelInfo::red, _GeometryInfo::rho, _Image::rows, SetImageColorspace(), SetImageProgress(), SetImageStorageClass(), _GeometryInfo::sigma, SigmaValue, _Image::signature, sRGBColorspace, SyncCacheViewAuthenticPixels(), ThresholdImageTag, TraceEvent, UpdatePixelTrait, _GeometryInfo::xi, and XiValue.
MagickExport MagickBooleanType ClampImage | ( | Image * | image, |
ExceptionInfo * | exception | ||
) |
Definition at line 1088 of file threshold.c.
References AcquireAuthenticCacheView(), ClampImageTag, ClampPixel(), _Image::colormap, _Image::colors, _Image::columns, DestroyCacheView(), _Image::filename, GetCacheViewAuthenticPixels(), GetMagickModule, GetPixelChannelChannel(), GetPixelChannels(), GetPixelChannelTraits(), IsEventLogging(), LogMagickEvent(), magick_restrict, MagickCoreSignature, MagickFalse, MagickTrue, _Image::progress_monitor, PseudoClass, _PixelInfo::red, _Image::rows, SetImageProgress(), _Image::signature, _Image::storage_class, SyncCacheViewAuthenticPixels(), SyncImage(), TraceEvent, and UpdatePixelTrait.
Referenced by CharcoalImage(), LevelImage(), and SketchImage().
MagickExport MagickBooleanType ColorThresholdImage | ( | Image * | image, |
const PixelInfo * | start_color, | ||
const PixelInfo * | stop_color, | ||
ExceptionInfo * | exception | ||
) |
Definition at line 1218 of file threshold.c.
References AcquireAuthenticCacheView(), AcquireImageColormap(), _PixelInfo::blue, _Image::colorspace, _Image::columns, ConvertRGBToHCL(), ConvertRGBToHSB(), ConvertRGBToHSL(), ConvertRGBToHSV(), ConvertRGBToHWB(), ConvertRGBToLab(), D65Illuminant, DestroyCacheView(), _Image::filename, GetCacheViewAuthenticPixels(), GetImageArtifact(), GetMagickModule, GetPixelChannelChannel(), GetPixelChannels(), GetPixelChannelTraits(), GetPixelInfoChannel(), _PixelInfo::green, HCLColorspace, HSBColorspace, HSLColorspace, HSVColorspace, HWBColorspace, IsEventLogging(), LabColorspace, LogMagickEvent(), magick_restrict, MagickCoreSignature, MagickFalse, MagickIlluminantOptions, MagickTrue, ParseCommandOption(), _Image::progress_monitor, QuantumRange, QuantumScale, _PixelInfo::red, _Image::rows, SetImageProgress(), SetPixelIndex(), _Image::signature, sRGBColorspace, SyncCacheViewAuthenticPixels(), SyncImage(), ThresholdImageTag, TraceEvent, UndefinedIlluminant, and UpdatePixelTrait.
MagickExport ThresholdMap * DestroyThresholdMap | ( | ThresholdMap * | map | ) |
Definition at line 1420 of file threshold.c.
References _ThresholdMap::description, DestroyString(), _ThresholdMap::levels, _ThresholdMap::map_id, and RelinquishMagickMemory().
Referenced by GetThresholdMapFile(), and OrderedDitherImage().
MagickExport ThresholdMap * GetThresholdMap | ( | const char * | map_id, |
ExceptionInfo * | exception | ||
) |
Definition at line 1459 of file threshold.c.
References BuiltinMap, DestroyConfigureOptions(), GetConfigureOptions(), GetNextValueInLinkedList(), GetStringInfoDatum(), GetStringInfoPath(), GetThresholdMapFile(), and ThresholdsFilename.
Referenced by OrderedDitherImage().
|
static |
Definition at line 1522 of file threshold.c.
References AcquireCriticalMemory(), AcquireQuantumMemory(), ConfigureEvent, ConstantString(), _ThresholdMap::description, DestroyThresholdMap(), DestroyXMLTree(), _ThresholdMap::divisor, GetMagickModule, GetNextXMLTreeTag(), GetXMLTreeAttribute(), GetXMLTreeChild(), GetXMLTreeContent(), _ThresholdMap::height, _ThresholdMap::levels, LocaleCompare(), LogMagickEvent(), _ThresholdMap::map_id, NewXMLTree(), OptionError, ResourceLimitFatalError, StringToLong(), StringToUnsignedLong(), ThrowFatalException, ThrowMagickException(), and _ThresholdMap::width.
Referenced by GetThresholdMap().
|
static |
Definition at line 393 of file threshold.c.
References AcquireQuantumMemory(), _Image::filename, GetMagickModule, MagickMinimumValue, MaxIntensity, RelinquishMagickMemory(), ResourceLimitError, and ThrowMagickException().
Referenced by AutoThresholdImage().
MagickBooleanType ListThresholdMapFile | ( | FILE * | file, |
const char * | xml, | ||
const char * | filename, | ||
ExceptionInfo * | exception | ||
) |
Definition at line 1728 of file threshold.c.
References ConfigureEvent, DestroyXMLTree(), FormatLocaleFile(), GetMagickModule, GetNextXMLTreeTag(), GetXMLTreeAttribute(), GetXMLTreeChild(), GetXMLTreeContent(), LogMagickEvent(), MagickFalse, MagickTrue, NewXMLTree(), OptionError, and ThrowMagickException().
Referenced by ListThresholdMaps().
MagickExport MagickBooleanType ListThresholdMaps | ( | FILE * | file, |
ExceptionInfo * | exception | ||
) |
Definition at line 1812 of file threshold.c.
References DestroyConfigureOptions(), FormatLocaleFile(), GetConfigureOptions(), GetNextValueInLinkedList(), GetStringInfoDatum(), GetStringInfoPath(), ListThresholdMapFile(), MagickFalse, MagickTrue, and ThresholdsFilename.
MagickExport MagickBooleanType OrderedDitherImage | ( | Image * | image, |
const char * | threshold_map, | ||
ExceptionInfo * | exception | ||
) |
Definition at line 1889 of file threshold.c.
References AcquireAuthenticCacheView(), ClampToQuantum(), _Image::columns, CompositePixelChannel, DestroyCacheView(), DestroyThresholdMap(), DirectClass, DitherImageTag, _ThresholdMap::divisor, _Image::filename, GetCacheViewAuthenticPixels(), GetMagickModule, GetNextToken(), GetPixelChannelChannel(), GetPixelChannels(), GetPixelChannelTraits(), GetThresholdMap(), _ThresholdMap::height, IsEventLogging(), _ThresholdMap::levels, LogMagickEvent(), magick_restrict, MagickCoreSignature, MagickEpsilon, MagickFalse, MagickPathExtent, MagickTrue, MaxPixelChannels, OptionError, _Image::progress_monitor, QuantumRange, QuantumScale, _Image::rows, SetImageProgress(), SetImageStorageClass(), _ExceptionInfo::signature, _Image::signature, StringToDouble(), SyncCacheViewAuthenticPixels(), ThrowMagickException(), TraceEvent, UpdatePixelTrait, and _ThresholdMap::width.
|
static |
Definition at line 492 of file threshold.c.
References AcquireQuantumMemory(), _Image::filename, GetMagickModule, MaxIntensity, RelinquishMagickMemory(), ResourceLimitError, and ThrowMagickException().
Referenced by AutoThresholdImage().
MagickExport MagickBooleanType PerceptibleImage | ( | Image * | image, |
const double | epsilon, | ||
ExceptionInfo * | exception | ||
) |
Definition at line 2087 of file threshold.c.
References AcquireAuthenticCacheView(), ClampToQuantum(), _Image::colormap, _Image::colors, _Image::columns, DestroyCacheView(), _Image::filename, GetCacheViewAuthenticPixels(), GetMagickModule, GetPixelChannelChannel(), GetPixelChannels(), GetPixelChannelTraits(), IsEventLogging(), LogMagickEvent(), magick_restrict, MagickCoreSignature, MagickFalse, MagickTrue, PerceptibleImageTag, PerceptibleThreshold(), _Image::progress_monitor, PseudoClass, _PixelInfo::red, _Image::rows, SetImageProgress(), _Image::signature, _Image::storage_class, SyncCacheViewAuthenticPixels(), SyncImage(), TraceEvent, and UndefinedPixelTrait.
Definition at line 2075 of file threshold.c.
Referenced by PerceptibleImage().
MagickExport MagickBooleanType RandomThresholdImage | ( | Image * | image, |
const double | min_threshold, | ||
const double | max_threshold, | ||
ExceptionInfo * | exception | ||
) |
Definition at line 2223 of file threshold.c.
References AcquireAuthenticCacheView(), AcquireRandomInfoTLS(), _Image::columns, DestroyCacheView(), DestroyRandomInfoTLS(), DirectClass, _Image::filename, GetCacheViewAuthenticPixels(), GetMagickModule, GetOpenMPThreadId(), GetPixelChannelChannel(), GetPixelChannels(), GetPixelChannelTraits(), GetPseudoRandomValue(), GetRandomSecretKey(), IsEventLogging(), LogMagickEvent(), magick_restrict, MagickCoreSignature, MagickFalse, MagickTrue, _Image::progress_monitor, QuantumRange, random_info, _Image::rows, SetImageProgress(), SetImageStorageClass(), _ExceptionInfo::signature, _Image::signature, SyncCacheViewAuthenticPixels(), ThresholdImageTag, TraceEvent, and UpdatePixelTrait.
MagickExport MagickBooleanType RangeThresholdImage | ( | Image * | image, |
const double | low_black, | ||
const double | low_white, | ||
const double | high_white, | ||
const double | high_black, | ||
ExceptionInfo * | exception | ||
) |
Definition at line 2369 of file threshold.c.
References AcquireAuthenticCacheView(), _Image::channel_mask, ClampToQuantum(), _Image::colorspace, _Image::columns, DefaultChannels, DestroyCacheView(), DirectClass, _Image::filename, GetCacheViewAuthenticPixels(), GetMagickModule, GetPixelChannelChannel(), GetPixelChannels(), GetPixelChannelTraits(), GetPixelIntensity(), IsEventLogging(), IsGrayColorspace(), LogMagickEvent(), magick_restrict, MagickCoreSignature, MagickFalse, MagickTrue, PerceptibleReciprocal(), _Image::progress_monitor, QuantumRange, _Image::rows, SetImageProgress(), SetImageStorageClass(), _Image::signature, sRGBColorspace, SyncCacheViewAuthenticPixels(), ThresholdImageTag, TraceEvent, TransformImageColorspace(), and UpdatePixelTrait.
|
static |
Definition at line 571 of file threshold.c.
References MaxIntensity.
Referenced by AutoThresholdImage().
MagickExport MagickBooleanType WhiteThresholdImage | ( | Image * | image, |
const char * | thresholds, | ||
ExceptionInfo * | exception | ||
) |
Definition at line 2509 of file threshold.c.
References AcquireAuthenticCacheView(), _PixelInfo::alpha, _PixelInfo::black, _PixelInfo::blue, _Image::channel_mask, _GeometryInfo::chi, ChiValue, CMYKColorspace, _Image::colorspace, _PixelInfo::colorspace, _Image::columns, DefaultChannels, DestroyCacheView(), DirectClass, _Image::filename, GetCacheViewAuthenticPixels(), GetMagickModule, GetPixelChannelChannel(), GetPixelChannels(), GetPixelChannelTraits(), GetPixelInfo(), GetPixelInfoChannel(), GetPixelIntensity(), _PixelInfo::green, IsEventLogging(), IsGrayColorspace(), LogMagickEvent(), magick_restrict, MagickCoreSignature, MagickFalse, MagickTrue, ParseGeometry(), PercentValue, _Image::progress_monitor, _GeometryInfo::psi, PsiValue, QuantumRange, _PixelInfo::red, _GeometryInfo::rho, _Image::rows, SetImageProgress(), SetImageStorageClass(), _GeometryInfo::sigma, SigmaValue, _Image::signature, sRGBColorspace, SyncCacheViewAuthenticPixels(), ThresholdImageTag, TraceEvent, TransformImageColorspace(), UpdatePixelTrait, _GeometryInfo::xi, and XiValue.
|
static |
Definition at line 123 of file threshold.c.
Referenced by GetThresholdMap().