MagickCore  7.1.0
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/memory-private.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/threshold.h"
#include "MagickCore/token.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 FxMaxFunctionDepth   200
 
#define FxMaxParenthesisDepth   58
 
#define FxMaxSubexpressionDepth   200
 
#define FxReturn(value)
 
#define FxParseConditional(subexpression, sentinal, p, q)
 
#define FxImageTag   "Fx/Image"
 

Enumerations

enum  FxOperator {
  BitwiseAndAssignmentOperator = 0xd9U, BitwiseOrAssignmentOperator, LeftShiftAssignmentOperator, RightShiftAssignmentOperator,
  PowerAssignmentOperator, ModuloAssignmentOperator, PlusAssignmentOperator, SubtractAssignmentOperator,
  MultiplyAssignmentOperator, DivideAssignmentOperator, IncrementAssignmentOperator, DecrementAssignmentOperator,
  LeftShiftOperator, RightShiftOperator, LessThanEqualOperator, GreaterThanEqualOperator,
  EqualOperator, NotEqualOperator, LogicalAndOperator, LogicalOrOperator,
  ExponentialNotation
}
 

Functions

MagickPrivate FxInfoAcquireFxInfo (const Image *images, const char *expression, ExceptionInfo *exception)
 
MagickPrivate FxInfoDestroyFxInfo (FxInfo *fx_info)
 
static const double * GetFxSymbolValue (FxInfo *magick_restrict fx_info, const char *symbol)
 
static MagickBooleanType SetFxSymbolValue (FxInfo *magick_restrict fx_info, const char *magick_restrict symbol, double const value)
 
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 *, const size_t, double *, ExceptionInfo *)
 
static MagickBooleanType IsFxFunction (const char *expression, const char *name, const size_t length)
 
static double FxGCD (const double alpha, const double beta, const size_t depth)
 
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, const size_t depth, 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)
 

Macro Definition Documentation

◆ FxImageTag

#define FxImageTag   "Fx/Image"

Referenced by FxImage().

◆ FxMaxFunctionDepth

#define FxMaxFunctionDepth   200

Referenced by FxGCD().

◆ FxMaxParenthesisDepth

#define FxMaxParenthesisDepth   58

Referenced by FxEvaluateSubexpression().

◆ FxMaxSubexpressionDepth

#define FxMaxSubexpressionDepth   200

Referenced by FxEvaluateSubexpression().

◆ FxParseConditional

#define FxParseConditional (   subexpression,
  sentinal,
  p,
 
)
Value:
{ \
p=subexpression; \
for (q=(char *) p; (*q != (sentinal)) && (*q != '\0'); q++) \
if (*q == '(') \
{ \
for (q++; (*q != ')') && (*q != '\0'); q++); \
if (*q == '\0') \
break; \
} \
if (*q == '\0') \
{ \
(void) ThrowMagickException(exception,GetMagickModule(), \
OptionError,"UnableToParseExpression","`%s'",subexpression); \
FxReturn(0.0); \
} \
if (strlen(q) == 1) \
*(q+1)='\0'; \
*q='\0'; \
}
MagickExport MagickBooleanType ThrowMagickException(ExceptionInfo *exception, const char *module, const char *function, const size_t line, const ExceptionType severity, const char *tag, const char *format,...)
Definition: exception.c:1145
#define GetMagickModule()
Definition: log.h:28

Referenced by FxEvaluateSubexpression().

◆ FxReturn

#define FxReturn (   value)
Value:
{ \
subexpression=DestroyString(subexpression); \
return(value); \
}
MagickExport char * DestroyString(char *string)
Definition: string.c:788

Referenced by FxEvaluateSubexpression().

Enumeration Type Documentation

◆ FxOperator

enum FxOperator
Enumerator
BitwiseAndAssignmentOperator 
BitwiseOrAssignmentOperator 
LeftShiftAssignmentOperator 
RightShiftAssignmentOperator 
PowerAssignmentOperator 
ModuloAssignmentOperator 
PlusAssignmentOperator 
SubtractAssignmentOperator 
MultiplyAssignmentOperator 
DivideAssignmentOperator 
IncrementAssignmentOperator 
DecrementAssignmentOperator 
LeftShiftOperator 
RightShiftOperator 
LessThanEqualOperator 
GreaterThanEqualOperator 
EqualOperator 
NotEqualOperator 
LogicalAndOperator 
LogicalOrOperator 
ExponentialNotation 

Definition at line 104 of file fx.c.

Function Documentation

◆ AcquireFxInfo()

◆ AcquireFxThreadSet()

static FxInfo** AcquireFxThreadSet ( const Image image,
const char *  expression,
ExceptionInfo exception 
)
static

◆ DestroyFxInfo()

◆ DestroyFxThreadSet()

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

Definition at line 2740 of file fx.c.

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

Referenced by AcquireFxThreadSet(), and FxImage().

◆ FxChannelStatistics()

◆ FxEvaluateChannelExpression()

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

◆ FxEvaluateExpression()

MagickPrivate MagickBooleanType FxEvaluateExpression ( FxInfo fx_info,
double *  alpha,
ExceptionInfo exception 
)

Definition at line 2671 of file fx.c.

References FxEvaluateChannelExpression(), and GrayPixelChannel.

◆ FxEvaluateSubexpression()

static double FxEvaluateSubexpression ( FxInfo fx_info,
const PixelChannel  channel,
const ssize_t  x,
const ssize_t  y,
const char *  expression,
const size_t  depth,
double *  beta,
ExceptionInfo exception 
)
static

◆ FxGCD()

static double FxGCD ( const double  alpha,
const double  beta,
const size_t  depth 
)
inlinestatic

Definition at line 524 of file fx.c.

References FxMaxFunctionDepth.

Referenced by FxEvaluateSubexpression().

◆ FxGetSymbol()

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

Definition at line 563 of file fx.c.

References AcquireString(), 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, CompositePixelChannel, ConstantString(), ConvertRGBToHSL(), CopyMagickString(), CyanPixelChannel, DestroyString(), _FxInfo::exception, _Image::extent, _Image::filename, FxChannelStatistics(), FxEvaluateSubexpression(), GetBlobSize(), GetFxSymbolValue(), GetImageArtifact(), GetImageDepth(), GetImageFromList(), GetImageIndexInList(), GetImageListLength(), GetMagickModule, GetPixelInfo(), GetPixelIntensity(), GetValueFromSplayTree(), _PixelInfo::green, GreenPixelChannel, _RectangleInfo::height, ImageError, _FxInfo::images, IndexPixelChannel, _Image::interpolate, InterpolatePixelInfo(), IsFxFunction(), LocaleCompare(), LocaleNCompare(), MagentaPixelChannel, MagickFalse, MagickPathExtent, MaxPixelChannels, OptionError, _Image::page, ParseGeometry(), PerceptibleReciprocal(), _GeometryInfo::psi, PsiValue, _Image::quality, QuantumScale, QueryColorCompliance(), _PixelInfo::red, RedPixelChannel, _Image::resolution, _GeometryInfo::rho, RhoValue, _Image::rows, SetFxSymbolValue(), SetPixelViaPixelInfo(), _GeometryInfo::sigma, SigmaValue, StringToDouble(), StripMagickString(), ThrowMagickException(), UndefinedPixelTrait, _FxInfo::view, _RectangleInfo::width, _PointInfo::x, _RectangleInfo::x, _GeometryInfo::xi, XiValue, _PointInfo::y, _RectangleInfo::y, and YellowPixelChannel.

Referenced by FxEvaluateSubexpression().

◆ FxImage()

◆ FxOperatorPrecedence()

◆ FxPreprocessExpression()

MagickExport MagickBooleanType FxPreprocessExpression ( FxInfo fx_info,
double *  alpha,
ExceptionInfo exception 
)

Definition at line 2682 of file fx.c.

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

Referenced by AcquireFxThreadSet().

◆ FxSubexpression()

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

Definition at line 536 of file fx.c.

References GetMagickModule, OptionError, and ThrowMagickException().

Referenced by FxOperatorPrecedence().

◆ GetFxSymbolValue()

static const double* GetFxSymbolValue ( FxInfo *magick_restrict  fx_info,
const char *  symbol 
)
inlinestatic

Definition at line 350 of file fx.c.

References GetValueFromSplayTree().

Referenced by FxChannelStatistics(), and FxGetSymbol().

◆ IsFxFunction()

static MagickBooleanType IsFxFunction ( const char *  expression,
const char *  name,
const size_t  length 
)
inlinestatic

Definition at line 505 of file fx.c.

References LocaleNCompare(), MagickFalse, and MagickTrue.

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

◆ SetFxSymbolValue()

static MagickBooleanType SetFxSymbolValue ( FxInfo *magick_restrict  fx_info,
const char *magick_restrict  symbol,
double const  value 
)
inlinestatic