MagickCore  7.0.0
enhance.c File Reference
Include dependency graph for enhance.c:

Go to the source code of this file.

Macros

#define BrightnessContastImageTag   "BrightnessContast/Image"
 
#define ClutImageTag   "Clut/Image"
 
#define ColorDecisionListCorrectImageTag   "ColorDecisionList/Image"
 
#define ContrastImageTag   "Contrast/Image"
 
#define MaxRange(color)   ((double) ScaleQuantumToMap((Quantum) (color)))
 
#define ContrastStretchImageTag   "ContrastStretch/Image"
 
#define EnhancePixel(weight)
 
#define EnhanceImageTag   "Enhance/Image"
 
#define EqualizeImageTag   "Equalize/Image"
 
#define GammaCorrectImageTag   "GammaCorrect/Image"
 
#define GrayscaleImageTag   "Grayscale/Image"
 
#define HaldClutImageTag   "Clut/Image"
 
#define LevelImageTag   "Level/Image"
 
#define LevelizeImageTag   "Levelize/Image"
 
#define LevelizeValue(x)
 
#define LinearStretchImageTag   "LinearStretch/Image"
 
#define ModulateImageTag   "Modulate/Image"
 
#define NegateImageTag   "Negate/Image"
 
#define Sigmoidal(a, b, x)   ( 1.0/(1.0+exp((a)*((b)-(x)))) )
 
#define ScaledSigmoidal(a, b, x)
 
#define SigmoidalContrastImageTag   "SigmoidalContrast/Image"
 
#define ScaledSig(x)
 
#define InverseScaledSig(x)
 

Functions

MagickExport MagickBooleanType AutoGammaImage (Image *image, ExceptionInfo *exception)
 
MagickExport MagickBooleanType AutoLevelImage (Image *image, ExceptionInfo *exception)
 
MagickExport MagickBooleanType BrightnessContrastImage (Image *image, const double brightness, const double contrast, ExceptionInfo *exception)
 
MagickExport MagickBooleanType ClutImage (Image *image, const Image *clut_image, const PixelInterpolateMethod method, ExceptionInfo *exception)
 
MagickExport MagickBooleanType ColorDecisionListImage (Image *image, const char *color_correction_collection, ExceptionInfo *exception)
 
static void Contrast (const int sign, double *red, double *green, double *blue)
 
MagickExport MagickBooleanType ContrastImage (Image *image, const MagickBooleanType sharpen, ExceptionInfo *exception)
 
MagickExport MagickBooleanType ContrastStretchImage (Image *image, const double black_point, const double white_point, ExceptionInfo *exception)
 
MagickExport ImageEnhanceImage (const Image *image, ExceptionInfo *exception)
 
MagickExport MagickBooleanType EqualizeImage (Image *image, ExceptionInfo *exception)
 
static double gamma_pow (const double value, const double gamma)
 
MagickExport MagickBooleanType GammaImage (Image *image, const double gamma, ExceptionInfo *exception)
 
static MagickRealType MagickMax (const MagickRealType x, const MagickRealType y)
 
static MagickRealType MagickMin (const MagickRealType x, const MagickRealType y)
 
MagickExport MagickBooleanType GrayscaleImage (Image *image, const PixelIntensityMethod method, ExceptionInfo *exception)
 
MagickExport MagickBooleanType HaldClutImage (Image *image, const Image *hald_image, ExceptionInfo *exception)
 
static double LevelPixel (const double black_point, const double white_point, const double gamma, const double pixel)
 
MagickExport MagickBooleanType LevelImage (Image *image, const double black_point, const double white_point, const double gamma, ExceptionInfo *exception)
 
MagickExport MagickBooleanType LevelizeImage (Image *image, const double black_point, const double white_point, const double gamma, ExceptionInfo *exception)
 
MagickExport MagickBooleanType LevelImageColors (Image *image, const PixelInfo *black_color, const PixelInfo *white_color, const MagickBooleanType invert, ExceptionInfo *exception)
 
MagickExport MagickBooleanType LinearStretchImage (Image *image, const double black_point, const double white_point, ExceptionInfo *exception)
 
static void ModulateHCL (const double percent_hue, const double percent_chroma, const double percent_luma, double *red, double *green, double *blue)
 
static void ModulateHCLp (const double percent_hue, const double percent_chroma, const double percent_luma, double *red, double *green, double *blue)
 
static void ModulateHSB (const double percent_hue, const double percent_saturation, const double percent_brightness, double *red, double *green, double *blue)
 
static void ModulateHSI (const double percent_hue, const double percent_saturation, const double percent_intensity, double *red, double *green, double *blue)
 
static void ModulateHSL (const double percent_hue, const double percent_saturation, const double percent_lightness, double *red, double *green, double *blue)
 
static void ModulateHSV (const double percent_hue, const double percent_saturation, const double percent_value, double *red, double *green, double *blue)
 
static void ModulateHWB (const double percent_hue, const double percent_whiteness, const double percent_blackness, double *red, double *green, double *blue)
 
static void ModulateLCHab (const double percent_luma, const double percent_chroma, const double percent_hue, double *red, double *green, double *blue)
 
static void ModulateLCHuv (const double percent_luma, const double percent_chroma, const double percent_hue, double *red, double *green, double *blue)
 
MagickExport MagickBooleanType ModulateImage (Image *image, const char *modulate, ExceptionInfo *exception)
 
MagickExport MagickBooleanType NegateImage (Image *image, const MagickBooleanType grayscale, ExceptionInfo *exception)
 
MagickExport MagickBooleanType NormalizeImage (Image *image, ExceptionInfo *exception)
 
static double InverseScaledSigmoidal (const double a, const double b, const double x)
 
MagickExport MagickBooleanType SigmoidalContrastImage (Image *image, const MagickBooleanType sharpen, const double contrast, const double midpoint, ExceptionInfo *exception)
 

Macro Definition Documentation

#define BrightnessContastImageTag   "BrightnessContast/Image"
#define ClutImageTag   "Clut/Image"

Referenced by ClutImage().

#define ColorDecisionListCorrectImageTag   "ColorDecisionList/Image"

Referenced by ColorDecisionListImage().

#define ContrastImageTag   "Contrast/Image"

Referenced by ContrastImage().

#define ContrastStretchImageTag   "ContrastStretch/Image"

Referenced by ContrastStretchImage().

#define EnhanceImageTag   "Enhance/Image"

Referenced by EnhanceImage().

#define EnhancePixel (   weight)
Value:
mean=((double) r[i]+GetPixelChannel(enhance_image,channel,q))/2.0; \
distance=(double) r[i]-(double) GetPixelChannel(enhance_image,channel,q); \
distance_squared=QuantumScale*(2.0*((double) QuantumRange+1.0)+mean)* \
distance*distance; \
if (distance_squared < ((double) QuantumRange*(double) QuantumRange/25.0f)) \
{ \
aggregate+=(weight)*r[i]; \
total_weight+=(weight); \
} \
r+=GetPixelChannels(image);

Referenced by EnhanceImage().

#define EqualizeImageTag   "Equalize/Image"

Referenced by EqualizeImage().

#define GammaCorrectImageTag   "GammaCorrect/Image"

Referenced by GammaImage().

#define GrayscaleImageTag   "Grayscale/Image"

Referenced by GrayscaleImage().

#define HaldClutImageTag   "Clut/Image"

Referenced by HaldClutImage().

#define InverseScaledSig (   x)
#define LevelImageTag   "Level/Image"

Referenced by LevelImage().

#define LevelizeImageTag   "Levelize/Image"

Referenced by LevelizeImage().

#define LevelizeValue (   x)
Value:
(QuantumScale*(x)),gamma))*(white_point-black_point)+black_point)

Referenced by LevelizeImage().

#define LinearStretchImageTag   "LinearStretch/Image"
#define MaxRange (   color)    ((double) ScaleQuantumToMap((Quantum) (color)))

Referenced by ContrastStretchImage().

#define ModulateImageTag   "Modulate/Image"

Referenced by ModulateImage().

#define NegateImageTag   "Negate/Image"

Referenced by NegateImage().

#define ScaledSig (   x)
#define ScaledSigmoidal (   a,
  b,
 
)
Value:
( \
(Sigmoidal((a),(b),(x))-Sigmoidal((a),(b),0.0)) / \
(Sigmoidal((a),(b),1.0)-Sigmoidal((a),(b),0.0)) )

Definition at line 3705 of file enhance.c.

#define Sigmoidal (   a,
  b,
 
)    ( 1.0/(1.0+exp((a)*((b)-(x)))) )

Definition at line 3686 of file enhance.c.

Referenced by InverseScaledSigmoidal().

#define SigmoidalContrastImageTag   "SigmoidalContrast/Image"

Referenced by SigmoidalContrastImage().

Function Documentation

MagickExport MagickBooleanType AutoLevelImage ( Image image,
ExceptionInfo exception 
)

Definition at line 183 of file enhance.c.

References MinMaxStretchImage().

MagickExport MagickBooleanType BrightnessContrastImage ( Image image,
const double  brightness,
const double  contrast,
ExceptionInfo exception 
)
static void Contrast ( const int  sign,
double *  red,
double *  green,
double *  blue 
)
static

Definition at line 824 of file enhance.c.

References ConvertHSBToRGB(), ConvertRGBToHSB(), and MagickPI.

Referenced by ContrastImage().

static double gamma_pow ( const double  value,
const double  gamma 
)
inlinestatic

Definition at line 1750 of file enhance.c.

Referenced by GammaImage(), and LevelPixel().

static double InverseScaledSigmoidal ( const double  a,
const double  b,
const double  x 
)
inlinestatic

Definition at line 3717 of file enhance.c.

References MagickEpsilon, and Sigmoidal.

static double LevelPixel ( const double  black_point,
const double  white_point,
const double  gamma,
const double  pixel 
)
inlinestatic

Definition at line 2369 of file enhance.c.

References gamma_pow(), and QuantumRange.

Referenced by LevelImage().

static MagickRealType MagickMax ( const MagickRealType  x,
const MagickRealType  y 
)
inlinestatic

Definition at line 1931 of file enhance.c.

Referenced by GrayscaleImage().

static MagickRealType MagickMin ( const MagickRealType  x,
const MagickRealType  y 
)
inlinestatic

Definition at line 1939 of file enhance.c.

Referenced by GrayscaleImage(), and HaldClutImage().

static void ModulateHCL ( const double  percent_hue,
const double  percent_chroma,
const double  percent_luma,
double *  red,
double *  green,
double *  blue 
)
inlinestatic

Definition at line 2935 of file enhance.c.

References ConvertHCLToRGB(), and ConvertRGBToHCL().

Referenced by ModulateImage().

static void ModulateHCLp ( const double  percent_hue,
const double  percent_chroma,
const double  percent_luma,
double *  red,
double *  green,
double *  blue 
)
inlinestatic

Definition at line 2958 of file enhance.c.

References ConvertHCLpToRGB(), and ConvertRGBToHCLp().

Referenced by ModulateImage().

static void ModulateHSB ( const double  percent_hue,
const double  percent_saturation,
const double  percent_brightness,
double *  red,
double *  green,
double *  blue 
)
inlinestatic

Definition at line 2981 of file enhance.c.

References ConvertHSBToRGB(), and ConvertRGBToHSB().

Referenced by ModulateImage().

static void ModulateHSI ( const double  percent_hue,
const double  percent_saturation,
const double  percent_intensity,
double *  red,
double *  green,
double *  blue 
)
inlinestatic

Definition at line 3004 of file enhance.c.

References ConvertHSIToRGB(), and ConvertRGBToHSI().

Referenced by ModulateImage().

static void ModulateHSL ( const double  percent_hue,
const double  percent_saturation,
const double  percent_lightness,
double *  red,
double *  green,
double *  blue 
)
inlinestatic

Definition at line 3027 of file enhance.c.

References ConvertHSLToRGB(), and ConvertRGBToHSL().

Referenced by ModulateImage().

static void ModulateHSV ( const double  percent_hue,
const double  percent_saturation,
const double  percent_value,
double *  red,
double *  green,
double *  blue 
)
inlinestatic

Definition at line 3050 of file enhance.c.

References ConvertHSVToRGB(), and ConvertRGBToHSV().

Referenced by ModulateImage().

static void ModulateHWB ( const double  percent_hue,
const double  percent_whiteness,
const double  percent_blackness,
double *  red,
double *  green,
double *  blue 
)
inlinestatic

Definition at line 3073 of file enhance.c.

References ConvertHWBToRGB(), and ConvertRGBToHWB().

Referenced by ModulateImage().

static void ModulateLCHab ( const double  percent_luma,
const double  percent_chroma,
const double  percent_hue,
double *  red,
double *  green,
double *  blue 
)
inlinestatic

Definition at line 3096 of file enhance.c.

References ConvertLCHabToRGB(), and ConvertRGBToLCHab().

Referenced by ModulateImage().

static void ModulateLCHuv ( const double  percent_luma,
const double  percent_chroma,
const double  percent_hue,
double *  red,
double *  green,
double *  blue 
)
inlinestatic

Definition at line 3119 of file enhance.c.

References ConvertLCHuvToRGB(), and ConvertRGBToLCHuv().

Referenced by ModulateImage().

MagickExport MagickBooleanType NormalizeImage ( Image image,
ExceptionInfo exception 
)

Definition at line 3607 of file enhance.c.

References _Image::columns, ContrastStretchImage(), and _Image::rows.

Referenced by CharcoalImage(), SepiaToneImage(), and SketchImage().