MagickCore  7.0.3
fx.c File Reference
#include "MagickCore/studio.h"
#include "MagickCore/accelerate-private.h"
#include "MagickCore/annotate.h"
#include "MagickCore/artifact.h"
#include "MagickCore/attribute.h"
#include "MagickCore/cache.h"
#include "MagickCore/cache-view.h"
#include "MagickCore/channel.h"
#include "MagickCore/color.h"
#include "MagickCore/color-private.h"
#include "MagickCore/colorspace-private.h"
#include "MagickCore/composite.h"
#include "MagickCore/decorate.h"
#include "MagickCore/distort.h"
#include "MagickCore/draw.h"
#include "MagickCore/effect.h"
#include "MagickCore/enhance.h"
#include "MagickCore/exception.h"
#include "MagickCore/exception-private.h"
#include "MagickCore/fx.h"
#include "MagickCore/fx-private.h"
#include "MagickCore/gem.h"
#include "MagickCore/gem-private.h"
#include "MagickCore/geometry.h"
#include "MagickCore/layer.h"
#include "MagickCore/list.h"
#include "MagickCore/log.h"
#include "MagickCore/image.h"
#include "MagickCore/image-private.h"
#include "MagickCore/magick.h"
#include "MagickCore/memory_.h"
#include "MagickCore/monitor.h"
#include "MagickCore/monitor-private.h"
#include "MagickCore/option.h"
#include "MagickCore/pixel.h"
#include "MagickCore/pixel-accessor.h"
#include "MagickCore/property.h"
#include "MagickCore/quantum.h"
#include "MagickCore/quantum-private.h"
#include "MagickCore/random_.h"
#include "MagickCore/random-private.h"
#include "MagickCore/resample.h"
#include "MagickCore/resample-private.h"
#include "MagickCore/resize.h"
#include "MagickCore/resource_.h"
#include "MagickCore/splay-tree.h"
#include "MagickCore/statistic.h"
#include "MagickCore/string_.h"
#include "MagickCore/string-private.h"
#include "MagickCore/thread-private.h"
#include "MagickCore/transform.h"
#include "MagickCore/transform-private.h"
#include "MagickCore/utility.h"
Include dependency graph for fx.c:

Go to the source code of this file.

Data Structures

struct  _FxInfo
 

Macros

#define LeftShiftOperator   0xf5U
 
#define RightShiftOperator   0xf6U
 
#define LessThanEqualOperator   0xf7U
 
#define GreaterThanEqualOperator   0xf8U
 
#define EqualOperator   0xf9U
 
#define NotEqualOperator   0xfaU
 
#define LogicalAndOperator   0xfbU
 
#define LogicalOrOperator   0xfcU
 
#define ExponentialNotation   0xfdU
 
#define AddNoiseImageTag   "AddNoise/Image"
 
#define BlueShiftImageTag   "BlueShift/Image"
 
#define ColorizeImageTag   "Colorize/Image"
 
#define Colorize(pixel, blend_percentage, colorize)   (((pixel)*(100.0-(blend_percentage))+(colorize)*(blend_percentage))/100.0)
 
#define ColorMatrixImageTag   "ColorMatrix/Image"
 
#define FxMaxParenthesisDepth   58
 
#define FxImageTag   "Fx/Image"
 
#define ImplodeImageTag   "Implode/Image"
 
#define MorphImageTag   "Morph/Image"
 
#define SepiaToneImageTag   "SepiaTone/Image"
 
#define ShadowImageTag   "Shadow/Image"
 
#define SolarizeImageTag   "Solarize/Image"
 
#define GetBit(alpha, i)   ((((size_t) (alpha) >> (size_t) (i)) & 0x01) != 0)
 
#define SetBit(alpha, i, set)
 
#define SteganoImageTag   "Stegano/Image"
 
#define StereoImageTag   "Stereo/Image"
 
#define SwirlImageTag   "Swirl/Image"
 
#define TintImageTag   "Tint/Image"
 
#define WaveImageTag   "Wave/Image"
 

Functions

MagickPrivate FxInfoAcquireFxInfo (const Image *image, const char *expression, ExceptionInfo *exception)
 
MagickExport ImageAddNoiseImage (const Image *image, const NoiseType noise_type, const double attenuate, ExceptionInfo *exception)
 
MagickExport ImageBlueShiftImage (const Image *image, const double factor, ExceptionInfo *exception)
 
MagickExport ImageCharcoalImage (const Image *image, const double radius, const double sigma, ExceptionInfo *exception)
 
MagickExport ImageColorizeImage (const Image *image, const char *blend, const PixelInfo *colorize, ExceptionInfo *exception)
 
MagickExport ImageColorMatrixImage (const Image *image, const KernelInfo *color_matrix, ExceptionInfo *exception)
 
MagickPrivate FxInfoDestroyFxInfo (FxInfo *fx_info)
 
static double FxChannelStatistics (FxInfo *fx_info, Image *image, PixelChannel channel, const char *symbol, ExceptionInfo *exception)
 
static double FxEvaluateSubexpression (FxInfo *, const PixelChannel, const ssize_t, const ssize_t, const char *, size_t *, double *, ExceptionInfo *)
 
static MagickOffsetType FxGCD (MagickOffsetType alpha, MagickOffsetType beta)
 
static const char * FxSubexpression (const char *expression, ExceptionInfo *exception)
 
static double FxGetSymbol (FxInfo *fx_info, const PixelChannel channel, const ssize_t x, const ssize_t y, const char *expression, ExceptionInfo *exception)
 
static const char * FxOperatorPrecedence (const char *expression, ExceptionInfo *exception)
 
MagickPrivate MagickBooleanType FxEvaluateExpression (FxInfo *fx_info, double *alpha, ExceptionInfo *exception)
 
MagickExport MagickBooleanType FxPreprocessExpression (FxInfo *fx_info, double *alpha, ExceptionInfo *exception)
 
MagickPrivate MagickBooleanType FxEvaluateChannelExpression (FxInfo *fx_info, const PixelChannel channel, const ssize_t x, const ssize_t y, double *alpha, ExceptionInfo *exception)
 
static FxInfo ** DestroyFxThreadSet (FxInfo **fx_info)
 
static FxInfo ** AcquireFxThreadSet (const Image *image, const char *expression, ExceptionInfo *exception)
 
MagickExport ImageFxImage (const Image *image, const char *expression, ExceptionInfo *exception)
 
MagickExport ImageImplodeImage (const Image *image, const double amount, const PixelInterpolateMethod method, ExceptionInfo *exception)
 
MagickExport ImageMorphImages (const Image *image, const size_t number_frames, ExceptionInfo *exception)
 
static Quantum PlasmaPixel (RandomInfo *random_info, const double pixel, const double noise)
 
static MagickBooleanType PlasmaImageProxy (Image *image, CacheView *image_view, CacheView *u_view, CacheView *v_view, RandomInfo *random_info, const SegmentInfo *segment, size_t attenuate, size_t depth, ExceptionInfo *exception)
 
MagickExport MagickBooleanType PlasmaImage (Image *image, const SegmentInfo *segment, size_t attenuate, size_t depth, ExceptionInfo *exception)
 
MagickExport ImagePolaroidImage (const Image *image, const DrawInfo *draw_info, const char *caption, const double angle, const PixelInterpolateMethod method, ExceptionInfo *exception)
 
MagickExport ImageSepiaToneImage (const Image *image, const double threshold, ExceptionInfo *exception)
 
MagickExport ImageShadowImage (const Image *image, const double alpha, const double sigma, const ssize_t x_offset, const ssize_t y_offset, ExceptionInfo *exception)
 
MagickExport ImageSketchImage (const Image *image, const double radius, const double sigma, const double angle, ExceptionInfo *exception)
 
MagickExport MagickBooleanType SolarizeImage (Image *image, const double threshold, ExceptionInfo *exception)
 
MagickExport ImageSteganoImage (const Image *image, const Image *watermark, ExceptionInfo *exception)
 
MagickExport ImageStereoImage (const Image *left_image, const Image *right_image, ExceptionInfo *exception)
 
MagickExport ImageStereoAnaglyphImage (const Image *left_image, const Image *right_image, const ssize_t x_offset, const ssize_t y_offset, ExceptionInfo *exception)
 
MagickExport ImageSwirlImage (const Image *image, double degrees, const PixelInterpolateMethod method, ExceptionInfo *exception)
 
MagickExport ImageTintImage (const Image *image, const char *blend, const PixelInfo *tint, ExceptionInfo *exception)
 
MagickExport ImageVignetteImage (const Image *image, const double radius, const double sigma, const ssize_t x, const ssize_t y, ExceptionInfo *exception)
 
MagickExport ImageWaveImage (const Image *image, const double amplitude, const double wave_length, const PixelInterpolateMethod method, ExceptionInfo *exception)
 
static void HatTransform (const float *magick_restrict pixels, const size_t stride, const size_t extent, const size_t scale, float *kernel)
 
MagickExport ImageWaveletDenoiseImage (const Image *image, const double threshold, const double softness, ExceptionInfo *exception)
 

Macro Definition Documentation

#define AddNoiseImageTag   "AddNoise/Image"
#define BlueShiftImageTag   "BlueShift/Image"

Referenced by BlueShiftImage().

#define Colorize (   pixel,
  blend_percentage,
  colorize 
)    (((pixel)*(100.0-(blend_percentage))+(colorize)*(blend_percentage))/100.0)

Referenced by ColorizeImage().

#define ColorizeImageTag   "Colorize/Image"

Referenced by ColorizeImage().

#define ColorMatrixImageTag   "ColorMatrix/Image"

Referenced by ColorMatrixImage().

#define EqualOperator   0xf9U

Definition at line 106 of file fx.c.

Referenced by AcquireFxInfo(), FxEvaluateSubexpression(), and FxOperatorPrecedence().

#define ExponentialNotation   0xfdU

Definition at line 110 of file fx.c.

Referenced by AcquireFxInfo(), FxEvaluateSubexpression(), and FxOperatorPrecedence().

#define FxImageTag   "Fx/Image"

Referenced by FxImage().

#define FxMaxParenthesisDepth   58

Referenced by FxEvaluateSubexpression().

#define GetBit (   alpha,
 
)    ((((size_t) (alpha) >> (size_t) (i)) & 0x01) != 0)

Referenced by SteganoImage().

#define GreaterThanEqualOperator   0xf8U

Definition at line 105 of file fx.c.

Referenced by AcquireFxInfo(), FxEvaluateSubexpression(), and FxOperatorPrecedence().

#define ImplodeImageTag   "Implode/Image"

Referenced by ImplodeImage().

#define LeftShiftOperator   0xf5U

Definition at line 102 of file fx.c.

Referenced by AcquireFxInfo(), FxEvaluateSubexpression(), and FxOperatorPrecedence().

#define LessThanEqualOperator   0xf7U

Definition at line 104 of file fx.c.

Referenced by AcquireFxInfo(), FxEvaluateSubexpression(), and FxOperatorPrecedence().

#define LogicalAndOperator   0xfbU

Definition at line 108 of file fx.c.

Referenced by AcquireFxInfo(), FxEvaluateSubexpression(), and FxOperatorPrecedence().

#define LogicalOrOperator   0xfcU

Definition at line 109 of file fx.c.

Referenced by AcquireFxInfo(), FxEvaluateSubexpression(), and FxOperatorPrecedence().

#define MorphImageTag   "Morph/Image"

Referenced by MorphImages().

#define NotEqualOperator   0xfaU

Definition at line 107 of file fx.c.

Referenced by AcquireFxInfo(), FxEvaluateSubexpression(), and FxOperatorPrecedence().

#define RightShiftOperator   0xf6U

Definition at line 103 of file fx.c.

Referenced by AcquireFxInfo(), FxEvaluateSubexpression(), and FxOperatorPrecedence().

#define SepiaToneImageTag   "SepiaTone/Image"

Referenced by SepiaToneImage().

#define SetBit (   alpha,
  i,
  set 
)
Value:
(Quantum) ((set) != 0 ? (size_t) (alpha) \
| (one << (size_t) (i)) : (size_t) (alpha) & ~(one << (size_t) (i)))
unsigned short Quantum
Definition: magick-type.h:70

Referenced by SteganoImage().

#define ShadowImageTag   "Shadow/Image"
#define SolarizeImageTag   "Solarize/Image"

Referenced by SolarizeImage().

#define SteganoImageTag   "Stegano/Image"

Referenced by SteganoImage().

#define StereoImageTag   "Stereo/Image"

Referenced by StereoAnaglyphImage().

#define SwirlImageTag   "Swirl/Image"

Referenced by SwirlImage().

#define TintImageTag   "Tint/Image"

Referenced by TintImage().

#define WaveImageTag   "Wave/Image"

Referenced by WaveImage().

Function Documentation

static FxInfo** DestroyFxThreadSet ( FxInfo **  fx_info)
static

Definition at line 3017 of file fx.c.

References DestroyFxInfo(), GetMagickResourceLimit(), RelinquishMagickMemory(), and ThreadResource.

Referenced by AcquireFxThreadSet(), and FxImage().

MagickPrivate MagickBooleanType FxEvaluateChannelExpression ( FxInfo fx_info,
const PixelChannel  channel,
const ssize_t  x,
const ssize_t  y,
double *  alpha,
ExceptionInfo exception 
)
MagickPrivate MagickBooleanType FxEvaluateExpression ( FxInfo fx_info,
double *  alpha,
ExceptionInfo exception 
)

Definition at line 2943 of file fx.c.

References FxEvaluateChannelExpression(), and GrayPixelChannel.

static MagickOffsetType FxGCD ( MagickOffsetType  alpha,
MagickOffsetType  beta 
)
static

Definition at line 1230 of file fx.c.

Referenced by FxEvaluateSubexpression().

static double FxGetSymbol ( FxInfo fx_info,
const PixelChannel  channel,
const ssize_t  x,
const ssize_t  y,
const char *  expression,
ExceptionInfo exception 
)
static

Definition at line 1264 of file fx.c.

References AddValueToSplayTree(), AllCompliance, _PixelInfo::alpha, _PixelInfo::alpha_trait, AlphaPixelChannel, _PixelInfo::black, BlackPixelChannel, _PixelInfo::blue, BluePixelChannel, _GeometryInfo::chi, ChiValue, ClonePixelInfo(), CMYKColorspace, _FxInfo::colors, _Image::colorspace, _Image::columns, ConstantString(), ConvertRGBToHSL(), CopyMagickString(), CyanPixelChannel, _FxInfo::exception, _FxInfo::expression, _Image::filename, FxChannelStatistics(), FxEvaluateSubexpression(), GetImageDepth(), GetImageFromList(), GetImageIndexInList(), GetImageListLength(), GetMagickModule, GetPixelInfo(), GetPixelIntensity(), GetValueFromSplayTree(), _PixelInfo::green, GreenPixelChannel, _RectangleInfo::height, ImageError, _FxInfo::images, IndexPixelChannel, IntensityPixelChannel, _Image::interpolate, InterpolatePixelInfo(), LocaleCompare(), LocaleNCompare(), MagentaPixelChannel, MagickFalse, MagickPathExtent, MaxPixelChannels, OptionError, _Image::page, ParseGeometry(), _GeometryInfo::psi, PsiValue, _Image::quality, QuantumScale, QueryColorCompliance(), _PixelInfo::red, RedPixelChannel, _Image::resolution, _GeometryInfo::rho, RhoValue, _Image::rows, SetPixelViaPixelInfo(), _GeometryInfo::sigma, SigmaValue, StringToDouble(), StripString(), _FxInfo::symbols, ThrowMagickException(), UndefinedPixelTrait, _FxInfo::view, _RectangleInfo::width, _PointInfo::x, _RectangleInfo::x, _GeometryInfo::xi, XiValue, _PointInfo::y, _RectangleInfo::y, and YellowPixelChannel.

Referenced by FxEvaluateSubexpression().

static const char* FxOperatorPrecedence ( const char *  expression,
ExceptionInfo exception 
)
static
MagickExport MagickBooleanType FxPreprocessExpression ( FxInfo fx_info,
double *  alpha,
ExceptionInfo exception 
)

Definition at line 2954 of file fx.c.

References _FxInfo::file, FxEvaluateChannelExpression(), and GrayPixelChannel.

Referenced by AcquireFxThreadSet().

static const char* FxSubexpression ( const char *  expression,
ExceptionInfo exception 
)
inlinestatic

Definition at line 1237 of file fx.c.

References _FxInfo::expression, GetMagickModule, OptionError, and ThrowMagickException().

Referenced by FxOperatorPrecedence().

static void HatTransform ( const float *magick_restrict  pixels,
const size_t  stride,
const size_t  extent,
const size_t  scale,
float *  kernel 
)
inlinestatic

Definition at line 5776 of file fx.c.

References magick_restrict.

Referenced by WaveletDenoiseImage().

static MagickBooleanType PlasmaImageProxy ( Image image,
CacheView image_view,
CacheView u_view,
CacheView v_view,
RandomInfo random_info,
const SegmentInfo segment,
size_t  attenuate,
size_t  depth,
ExceptionInfo exception 
)
static
static Quantum PlasmaPixel ( RandomInfo random_info,
const double  pixel,
const double  noise 
)
inlinestatic

Definition at line 3693 of file fx.c.

References ClampToQuantum(), GetPseudoRandomValue(), and QuantumRange.

Referenced by PlasmaImageProxy().

MagickExport Image* StereoImage ( const Image left_image,
const Image right_image,
ExceptionInfo exception 
)

Definition at line 4961 of file fx.c.

References StereoAnaglyphImage().