MagickCore  7.0.7
Convert, Edit, Or Compose Bitmap Images
threshold.c File Reference
#include "MagickCore/studio.h"
#include "MagickCore/property.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/geometry.h"
#include "MagickCore/image-private.h"
#include "MagickCore/list.h"
#include "MagickCore/log.h"
#include "MagickCore/memory_.h"
#include "MagickCore/memory-private.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/pixel-private.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 DitherImageTag   "Dither/Image"
 
#define PerceptibleImageTag   "Perceptible/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 Image *image, const double *histogram, ExceptionInfo *exception)
 
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 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 WhiteThresholdImage (Image *image, const char *thresholds, ExceptionInfo *exception)
 

Variables

static const char * MinimalThresholdMap
 

Macro Definition Documentation

◆ AdaptiveThresholdImageTag

#define AdaptiveThresholdImageTag   "AdaptiveThreshold/Image"

Referenced by AdaptiveThresholdImage().

◆ ClampImageTag

#define ClampImageTag   "Clamp/Image"

Referenced by ClampImage().

◆ DitherImageTag

#define DitherImageTag   "Dither/Image"

Referenced by OrderedDitherImage().

◆ MaxIntensity

#define MaxIntensity   255

◆ PerceptibleImageTag

#define PerceptibleImageTag   "Perceptible/Image"

Referenced by PerceptibleImage().

◆ ThresholdImageTag [1/4]

#define ThresholdImageTag   "Threshold/Image"

◆ ThresholdImageTag [2/4]

#define ThresholdImageTag   "Threshold/Image"

◆ ThresholdImageTag [3/4]

#define ThresholdImageTag   "Threshold/Image"

◆ ThresholdImageTag [4/4]

#define ThresholdImageTag   "Threshold/Image"

◆ ThresholdsFilename

#define ThresholdsFilename   "thresholds.xml"

Definition at line 96 of file threshold.c.

Referenced by GetThresholdMap(), and ListThresholdMaps().

Function Documentation

◆ AdaptiveThresholdImage()

◆ AutoThresholdImage()

◆ BilevelImage()

◆ BlackThresholdImage()

◆ ClampImage()

◆ DestroyThresholdMap()

◆ GetThresholdMap()

◆ GetThresholdMapFile()

◆ KapurThreshold()

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

◆ ListThresholdMapFile()

◆ 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 1881 of file threshold.c.

Referenced by PerceptibleImage().

◆ RandomThresholdImage()

◆ TriangleThreshold()

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

Definition at line 568 of file threshold.c.

References MaxIntensity.

Referenced by AutoThresholdImage().

◆ WhiteThresholdImage()

Variable Documentation

◆ MinimalThresholdMap

const char* MinimalThresholdMap
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 120 of file threshold.c.

Referenced by GetThresholdMap().