MagickCore  6.9.11-60
Convert, Edit, Or Compose Bitmap Images
threshold.c File Reference
#include "magick/studio.h"
#include "magick/artifact.h"
#include "magick/blob.h"
#include "magick/cache-view.h"
#include "magick/color.h"
#include "magick/color-private.h"
#include "magick/colormap.h"
#include "magick/colorspace.h"
#include "magick/colorspace-private.h"
#include "magick/configure.h"
#include "magick/constitute.h"
#include "magick/decorate.h"
#include "magick/draw.h"
#include "magick/enhance.h"
#include "magick/exception.h"
#include "magick/exception-private.h"
#include "magick/effect.h"
#include "magick/fx.h"
#include "magick/gem.h"
#include "magick/geometry.h"
#include "magick/image-private.h"
#include "magick/list.h"
#include "magick/log.h"
#include "magick/memory_.h"
#include "magick/monitor.h"
#include "magick/monitor-private.h"
#include "magick/montage.h"
#include "magick/option.h"
#include "magick/pixel-private.h"
#include "magick/property.h"
#include "magick/quantize.h"
#include "magick/quantum.h"
#include "magick/random_.h"
#include "magick/random-private.h"
#include "magick/resize.h"
#include "magick/resource_.h"
#include "magick/segment.h"
#include "magick/shear.h"
#include "magick/signature-private.h"
#include "magick/string_.h"
#include "magick/string-private.h"
#include "magick/thread-private.h"
#include "magick/threshold.h"
#include "magick/transform.h"
#include "magick/xml-tree.h"
Include dependency graph for threshold.c:

Data Structures

struct  _ThresholdMap
 

Macros

#define ThresholdsFilename   "thresholds.xml"
 
#define ThresholdImageTag   "Threshold/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

MagickExport ImageAdaptiveThresholdImage (const Image *image, const size_t width, const size_t height, const ssize_t offset, 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)
 
MagickExport MagickBooleanType AutoThresholdImage (Image *image, const AutoThresholdMethod method, ExceptionInfo *exception)
 
MagickExport MagickBooleanType BilevelImage (Image *image, const double threshold)
 
MagickExport MagickBooleanType BilevelImageChannel (Image *image, const ChannelType channel, const double threshold)
 
MagickExport MagickBooleanType BlackThresholdImage (Image *image, const char *threshold)
 
MagickExport MagickBooleanType BlackThresholdImageChannel (Image *image, const ChannelType channel, const char *thresholds, ExceptionInfo *exception)
 
MagickExport MagickBooleanType ClampImage (Image *image)
 
MagickExport MagickBooleanType ClampImageChannel (Image *image, const ChannelType channel)
 
MagickExport ThresholdMapDestroyThresholdMap (ThresholdMap *map)
 
MagickExport ThresholdMapGetThresholdMapFile (const char *xml, const char *filename, const char *map_id, ExceptionInfo *exception)
 
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)
 
MagickExport MagickBooleanType OrderedDitherImageChannel (Image *image, const ChannelType channel, ExceptionInfo *exception)
 
MagickExport MagickBooleanType OrderedPosterizeImage (Image *image, const char *threshold_map, ExceptionInfo *exception)
 
MagickExport MagickBooleanType OrderedPosterizeImageChannel (Image *image, const ChannelType channel, const char *threshold_map, ExceptionInfo *exception)
 
static Quantum PerceptibleThreshold (const Quantum quantum, const double epsilon)
 
MagickExport MagickBooleanType PerceptibleImage (Image *image, const double epsilon)
 
MagickExport MagickBooleanType PerceptibleImageChannel (Image *image, const ChannelType channel, const double epsilon)
 
MagickExport MagickBooleanType RandomThresholdImage (Image *image, const char *thresholds, ExceptionInfo *exception)
 
MagickExport MagickBooleanType RandomThresholdImageChannel (Image *image, const ChannelType channel, const char *thresholds, ExceptionInfo *exception)
 
MagickExport MagickBooleanType WhiteThresholdImage (Image *image, const char *threshold)
 
MagickExport MagickBooleanType WhiteThresholdImageChannel (Image *image, const ChannelType channel, const char *thresholds, ExceptionInfo *exception)
 

Variables

static const char * MinimalThresholdMap
 

Macro Definition Documentation

◆ ClampImageTag

#define ClampImageTag   "Clamp/Image"

◆ DitherImageTag

#define DitherImageTag   "Dither/Image"

◆ MaxIntensity

#define MaxIntensity   255

◆ PerceptibleImageTag

#define PerceptibleImageTag   "Perceptible/Image"

◆ ThresholdImageTag [1/5]

#define ThresholdImageTag   "Threshold/Image"

◆ ThresholdImageTag [2/5]

#define ThresholdImageTag   "Threshold/Image"

◆ ThresholdImageTag [3/5]

#define ThresholdImageTag   "Threshold/Image"

◆ ThresholdImageTag [4/5]

#define ThresholdImageTag   "Threshold/Image"

◆ ThresholdImageTag [5/5]

#define ThresholdImageTag   "Threshold/Image"

◆ ThresholdsFilename

#define ThresholdsFilename   "thresholds.xml"

Function Documentation

◆ AdaptiveThresholdImage()

◆ AutoThresholdImage()

◆ BilevelImage()

MagickExport MagickBooleanType BilevelImage ( Image image,
const double  threshold 
)

◆ BilevelImageChannel()

◆ BlackThresholdImage()

MagickExport MagickBooleanType BlackThresholdImage ( Image image,
const char *  threshold 
)

◆ BlackThresholdImageChannel()

◆ ClampImage()

◆ ClampImageChannel()

◆ DestroyThresholdMap()

◆ GetThresholdMap()

◆ GetThresholdMapFile()

◆ KapurThreshold()

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

◆ ListThresholdMapFile()

◆ ListThresholdMaps()

◆ OrderedDitherImage()

◆ OrderedDitherImageChannel()

MagickExport MagickBooleanType OrderedDitherImageChannel ( Image image,
const ChannelType  channel,
ExceptionInfo exception 
)

◆ OrderedPosterizeImage()

MagickExport MagickBooleanType OrderedPosterizeImage ( Image image,
const char *  threshold_map,
ExceptionInfo exception 
)

◆ OrderedPosterizeImageChannel()

◆ OTSUThreshold()

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

◆ PerceptibleImage()

MagickExport MagickBooleanType PerceptibleImage ( Image image,
const double  epsilon 
)

◆ PerceptibleImageChannel()

◆ PerceptibleThreshold()

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

Referenced by PerceptibleImageChannel().

◆ RandomThresholdImage()

MagickExport MagickBooleanType RandomThresholdImage ( Image image,
const char *  thresholds,
ExceptionInfo exception 
)

◆ RandomThresholdImageChannel()

MagickExport MagickBooleanType RandomThresholdImageChannel ( Image image,
const ChannelType  channel,
const char *  thresholds,
ExceptionInfo exception 
)

◆ TriangleThreshold()

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

References magick_unreferenced, and MaxIntensity.

Referenced by AutoThresholdImage().

◆ WhiteThresholdImage()

MagickExport MagickBooleanType WhiteThresholdImage ( Image image,
const char *  threshold 
)

◆ WhiteThresholdImageChannel()

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>"

Referenced by GetThresholdMap().