MagickCore 7.1.0
Convert, Edit, Or Compose Bitmap Images
threshold.c File Reference
#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"
Include dependency graph for threshold.c:

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 ThresholdMapGetThresholdMapFile (const char *, const char *, const char *, ExceptionInfo *)
 
MagickExport ImageAdaptiveThresholdImage (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 ThresholdMapDestroyThresholdMap (ThresholdMap *map)
 
MagickExport ThresholdMapGetThresholdMap (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
 

Macro Definition Documentation

◆ AdaptiveThresholdImageTag

#define AdaptiveThresholdImageTag   "AdaptiveThreshold/Image"

◆ ClampImageTag

#define ClampImageTag   "Clamp/Image"

◆ DitherImageTag

#define DitherImageTag   "Dither/Image"

◆ MaxIntensity

#define MaxIntensity   255

◆ PerceptibleImageTag

#define PerceptibleImageTag   "Perceptible/Image"

◆ ThresholdImageTag [1/6]

#define ThresholdImageTag   "Threshold/Image"

◆ ThresholdImageTag [2/6]

#define ThresholdImageTag   "Threshold/Image"

◆ ThresholdImageTag [3/6]

#define ThresholdImageTag   "Threshold/Image"

◆ ThresholdImageTag [4/6]

#define ThresholdImageTag   "Threshold/Image"

◆ ThresholdImageTag [5/6]

#define ThresholdImageTag   "Threshold/Image"

◆ ThresholdImageTag [6/6]

#define ThresholdImageTag   "Threshold/Image"

◆ ThresholdsFilename

#define ThresholdsFilename   "thresholds.xml"

Definition at line 96 of file threshold.c.

Function Documentation

◆ AdaptiveThresholdImage()

◆ AutoThresholdImage()

◆ BilevelImage()

◆ BlackThresholdImage()

◆ ClampImage()

◆ ColorThresholdImage()

◆ DestroyThresholdMap()

◆ GetThresholdMap()

◆ GetThresholdMapFile()

◆ KapurThreshold()

static double KapurThreshold ( const Image image,
const double *  histogram,
ExceptionInfo exception 
)
static

◆ ListThresholdMapFile()

MagickBooleanType ListThresholdMapFile ( FILE *  file,
const char *  xml,
const char *  filename,
ExceptionInfo exception 
)

◆ ListThresholdMaps()

◆ OrderedDitherImage()

◆ OTSUThreshold()

static double OTSUThreshold ( const Image image,
const double *  histogram,
ExceptionInfo exception 
)
static

◆ PerceptibleImage()

◆ PerceptibleThreshold()

static Quantum PerceptibleThreshold ( const Quantum  quantum,
const double  epsilon 
)
inlinestatic

Definition at line 2075 of file threshold.c.

Referenced by PerceptibleImage().

◆ RandomThresholdImage()

◆ RangeThresholdImage()

◆ TriangleThreshold()

static double TriangleThreshold ( const double *  histogram)
static

Definition at line 571 of file threshold.c.

References MaxIntensity.

Referenced by AutoThresholdImage().

◆ WhiteThresholdImage()

Variable Documentation

◆ BuiltinMap

const char* const BuiltinMap
static
Initial value:
=
"<?xml version=\"1.0\"?>"
"<thresholds>"
" <threshold map=\"threshold\" alias=\"1x1\">"
" <description>Threshold 1x1 (non-dither)</description>"
" <levels width=\"1\" height=\"1\" divisor=\"2\">"
" 1"
" </levels>"
" </threshold>"
" <threshold map=\"checks\" alias=\"2x1\">"
" <description>Checkerboard 2x1 (dither)</description>"
" <levels width=\"2\" height=\"2\" divisor=\"3\">"
" 1 2"
" 2 1"
" </levels>"
" </threshold>"
"</thresholds>"

Definition at line 123 of file threshold.c.

Referenced by GetThresholdMap().