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/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  OperatorT
 
struct  ConstantT
 
struct  FunctionT
 
struct  ImgAttrT
 
struct  SymbolT
 
struct  ControlT
 
struct  TernaryT
 
struct  ChannelT
 
struct  UserSymbolT
 
struct  ElementT
 
struct  fxRtT
 
struct  _FxInfo
 

Macros

#define MaxTokenLen   100
 
#define RpnInit   100
 
#define TableExtend   0.1
 
#define InitNumOprStack   50
 
#define MinValStackSize   100
 
#define InitNumUserSymbols   50
 
#define FirstFunc   ((FunctionE) (oNull+1))
 
#define FirstImgAttr   ((ImgAttrE) (fNull+1))
 
#define FirstSym   ((SymbolE) (aNull+1))
 
#define FirstCont   (sNull+1)
 
#define NULL_ADDRESS   -2
 
#define NO_CHAN_QUAL   ((PixelChannel) (-1))
 
#define THIS_CHANNEL   ((PixelChannel) (-2))
 
#define HUE_CHANNEL   ((PixelChannel) (-3))
 
#define SAT_CHANNEL   ((PixelChannel) (-4))
 
#define LIGHT_CHANNEL   ((PixelChannel) (-5))
 
#define INTENSITY_CHANNEL   ((PixelChannel) (-6))
 
#define MaxLen   20
 
#define MAX_SLIMIT   10
 
#define FxMaxFunctionDepth   200
 
#define WHICH_ATTR_CHAN
 
#define WHICH_NON_ATTR_CHAN
 
#define FxImageTag   "FxNew/Image"
 

Typedefs

typedef long double fxFltType
 

Enumerations

enum  OperatorE {
  oAddEq, oSubtractEq, oMultiplyEq, oDivideEq,
  oPlusPlus, oSubSub, oAdd, oSubtract,
  oMultiply, oDivide, oModulus, oUnaryPlus,
  oUnaryMinus, oLshift, oRshift, oEq,
  oNotEq, oLtEq, oGtEq, oLt,
  oGt, oLogAnd, oLogOr, oLogNot,
  oBitAnd, oBitOr, oBitNot, oPow,
  oQuery, oColon, oOpenParen, oCloseParen,
  oOpenBracket, oCloseBracket, oOpenBrace, oCloseBrace,
  oAssign, oNull
}
 
enum  ConstantE {
  cEpsilon, cE, cOpaque, cPhi,
  cPi, cQuantumRange, cQuantumScale, cTransparent,
  cMaxRgb, cNull
}
 
enum  FunctionE {
  fAbs = oNull+1, fAcos, fAlt, fAsin,
  fAtan2, fAtan, fCeil, fChannel,
  fClamp, fCosh, fCos, fDebug,
  fDrc, fExp, fFloor, fGauss,
  fGcd, fHypot, fInt, fIsnan,
  fLn, fLogtwo, fLog, fMax,
  fMin, fMod, fNot, fPow,
  fRand, fRound, fSign, fSinc,
  fSinh, fSin, fSqrt, fSquish,
  fTanh, fTan, fTrunc, fDo,
  fFor, fIf, fWhile, fU,
  fU0, fUP, fS, fV,
  fP, fSP, fVP, fNull
}
 
enum  ImgAttrE {
  aDepth = fNull+1, aExtent, aKurtosis, aMaxima,
  aMean, aMedian, aMinima, aPage,
  aPageX, aPageY, aPageWid, aPageHt,
  aPrintsize, aPrintsizeX, aPrintsizeY, aQuality,
  aRes, aResX, aResY, aSkewness,
  aStdDev, aH, aN, aT,
  aW, aZ, aNull
}
 
enum  SymbolE {
  sHue = aNull+1, sIntensity, sLightness, sLuma,
  sLuminance, sSaturation, sA, sB,
  sC, sG, sI, sJ,
  sK, sM, sO, sR,
  sY, sNull
}
 
enum  ControlE {
  rGoto = FirstCont, rIfZeroGoto, rIfNotZeroGoto, rCopyFrom,
  rCopyTo, rZerStk, rNull
}
 
enum  ElementTypeE {
  etOperator, etConstant, etFunction, etImgAttr,
  etSymbol, etColourConstant, etControl
}
 

Functions

static MagickBooleanType TranslateStatementList (FxInfo *pfx, const char *strLimit, char *chLimit)
 
static MagickBooleanType TranslateExpression (FxInfo *pfx, const char *strLimit, char *chLimit, MagickBooleanType *needPopAll)
 
static MagickBooleanType GetFunction (FxInfo *pfx, FunctionE fe)
 
static MagickBooleanType InitFx (FxInfo *pfx, const Image *img, ExceptionInfo *exception)
 
static MagickBooleanType DeInitFx (FxInfo *pfx)
 
static ElementTypeE TypeOfOpr (int op)
 
static char * SetPtrShortExp (FxInfo *pfx, char *pExp, size_t len)
 
static char * SetShortExp (FxInfo *pfx)
 
static int FindUserSymbol (FxInfo *pfx, char *name)
 
static MagickBooleanType ExtendUserSymbols (FxInfo *pfx)
 
static int AddUserSymbol (FxInfo *pfx, char *pex, size_t len)
 
static void DumpTables (FILE *fh)
 
static char * NameOfUserSym (FxInfo *pfx, int ndx, char *buf)
 
static void DumpUserSymbols (FxInfo *pfx, FILE *fh)
 
static MagickBooleanType BuildRPN (FxInfo *pfx)
 
static MagickBooleanType AllocFxRt (FxInfo *pfx, fxRtT *pfxrt)
 
static MagickBooleanType ExtendRPN (FxInfo *pfx)
 
static MagickBooleanType OprInPlace (int op)
 
static const char * OprStr (int oprNum)
 
static MagickBooleanType DumpRPN (FxInfo *pfx, FILE *fh)
 
static void DestroyRPN (FxInfo *pfx)
 
static void DestroyFxRt (fxRtT *pfxrt)
 
static size_t GetToken (FxInfo *pfx)
 
static MagickBooleanType TokenMaybeUserSymbol (FxInfo *pfx)
 
static MagickBooleanType AddElement (FxInfo *pfx, fxFltType val, int oprNum)
 
static MagickBooleanType AddAddressingElement (FxInfo *pfx, int oprNum, int EleNdx)
 
static MagickBooleanType AddColourElement (FxInfo *pfx, fxFltType val0, fxFltType val1, fxFltType val2)
 
static void SkipSpaces (FxInfo *pfx)
 
static char PeekChar (FxInfo *pfx)
 
static MagickBooleanType PeekStr (FxInfo *pfx, const char *str)
 
static MagickBooleanType ExpectChar (FxInfo *pfx, char c)
 
static int MaybeXYWH (FxInfo *pfx, ImgAttrE *pop)
 
static MagickBooleanType ExtendOperatorStack (FxInfo *pfx)
 
static MagickBooleanType PushOperatorStack (FxInfo *pfx, int op)
 
static OperatorE GetLeadingOp (FxInfo *pfx)
 
static MagickBooleanType OprIsUnaryPrefix (OperatorE op)
 
static MagickBooleanType TopOprIsUnaryPrefix (FxInfo *pfx)
 
static MagickBooleanType PopOprOpenParen (FxInfo *pfx, OperatorE op)
 
static int GetCoordQualifier (FxInfo *pfx, int op)
 
static PixelChannel GetChannelQualifier (FxInfo *pfx, int op)
 
static ImgAttrE GetImgAttrToken (FxInfo *pfx)
 
static ImgAttrE GetImgAttrQualifier (FxInfo *pfx, int op)
 
static MagickBooleanType IsQualifier (FxInfo *pfx)
 
static ssize_t GetProperty (FxInfo *pfx, fxFltType *val)
 
static ssize_t GetConstantColour (FxInfo *pfx, fxFltType *v0, fxFltType *v1, fxFltType *v2)
 
static ssize_t GetHexColour (FxInfo *pfx, fxFltType *v0, fxFltType *v1, fxFltType *v2)
 
static MagickBooleanType IsStealth (int op)
 
static MagickBooleanType GetOperand (FxInfo *pfx, MagickBooleanType *UserSymbol, MagickBooleanType *NewUserSymbol, int *UserSymNdx, MagickBooleanType *needPopAll)
 
static MagickBooleanType IsRealOperator (OperatorE op)
 
static MagickBooleanType ProcessTernaryOpr (FxInfo *pfx, TernaryT *ptern)
 
static MagickBooleanType GetOperator (FxInfo *pfx, MagickBooleanType *Assign, MagickBooleanType *Update, MagickBooleanType *IncrDecr)
 
static MagickBooleanType ResolveTernaryAddresses (FxInfo *pfx, TernaryT *ptern)
 
static MagickBooleanType TranslateStatement (FxInfo *pfx, char *strLimit, char *chLimit)
 
static MagickBooleanType CollectStatistics (FxInfo *pfx)
 
static MagickBooleanType PushVal (FxInfo *pfx, fxRtT *pfxrt, fxFltType val, int addr)
 
static fxFltType PopVal (FxInfo *pfx, fxRtT *pfxrt, int addr)
 
static fxFltType ImageStat (FxInfo *pfx, ssize_t ImgNum, PixelChannel channel, ImgAttrE ia)
 
static fxFltType FxGcd (fxFltType x, fxFltType y, const size_t depth)
 
static ssize_t ChkImgNum (FxInfo *pfx, fxFltType f)
 
static fxFltType GetHslFlt (FxInfo *pfx, ssize_t ImgNum, const fxFltType fx, const fxFltType fy, int channel)
 
static fxFltType GetHslInt (FxInfo *pfx, ssize_t ImgNum, const ssize_t imgx, const ssize_t imgy, int channel)
 
static fxFltType GetIntensity (FxInfo *pfx, ssize_t ImgNum, const fxFltType fx, const fxFltType fy)
 
static MagickBooleanType ExecuteRPN (FxInfo *pfx, fxRtT *pfxrt, fxFltType *result, const PixelChannel channel, const ssize_t imgx, const ssize_t imgy)
 
MagickPrivate MagickBooleanType FxEvaluateChannelExpression (FxInfo *pfx, const PixelChannel channel, const ssize_t x, const ssize_t y, double *result, ExceptionInfo *exception)
 
FxInfoAcquireFxInfo (const Image *images, const char *expression, ExceptionInfo *exception)
 
FxInfoDestroyFxInfo (FxInfo *pfx)
 
MagickExport ImageFxImage (const Image *image, const char *expression, ExceptionInfo *exception)
 

Variables

static const OperatorT Operators []
 
static const ConstantT Constants []
 
static const FunctionT Functions []
 
static const ImgAttrT ImgAttrs []
 
static const SymbolT Symbols []
 
static const ControlT Controls []
 
static const ChannelT Channels []
 
static const char * sElementTypes []
 

Macro Definition Documentation

◆ FirstCont

#define FirstCont   (sNull+1)

Definition at line 523 of file fx.c.

Referenced by AddElement(), DumpTables(), IsStealth(), and OprStr().

◆ FirstFunc

#define FirstFunc   ((FunctionE) (oNull+1))

Definition at line 231 of file fx.c.

Referenced by AddElement(), DumpTables(), GetFunction(), GetOperand(), and OprStr().

◆ FirstImgAttr

#define FirstImgAttr   ((ImgAttrE) (fNull+1))

Definition at line 399 of file fx.c.

Referenced by DumpTables(), GetChannelQualifier(), GetFunction(), GetImgAttrToken(), GetOperand(), and OprStr().

◆ FirstSym

#define FirstSym   ((SymbolE) (aNull+1))

Definition at line 468 of file fx.c.

Referenced by DumpTables(), GetOperand(), and OprStr().

◆ FxImageTag

#define FxImageTag   "FxNew/Image"

Referenced by FxImage().

◆ FxMaxFunctionDepth

#define FxMaxFunctionDepth   200

Referenced by FxGcd().

◆ HUE_CHANNEL

#define HUE_CHANNEL   ((PixelChannel) (-3))

Definition at line 566 of file fx.c.

Referenced by ExecuteRPN(), GetChannelQualifier(), GetFunction(), GetHslFlt(), and GetHslInt().

◆ InitNumOprStack

#define InitNumOprStack   50

Definition at line 104 of file fx.c.

Referenced by BuildRPN().

◆ InitNumUserSymbols

#define InitNumUserSymbols   50

Definition at line 106 of file fx.c.

Referenced by BuildRPN().

◆ INTENSITY_CHANNEL

#define INTENSITY_CHANNEL   ((PixelChannel) (-6))

Definition at line 569 of file fx.c.

Referenced by ExecuteRPN().

◆ LIGHT_CHANNEL

#define LIGHT_CHANNEL   ((PixelChannel) (-5))

Definition at line 568 of file fx.c.

Referenced by ExecuteRPN(), GetChannelQualifier(), GetFunction(), GetHslFlt(), and GetHslInt().

◆ MAX_SLIMIT

#define MAX_SLIMIT   10

Referenced by TranslateStatementList().

◆ MaxLen

#define MaxLen   20

Referenced by SetPtrShortExp().

◆ MaxTokenLen

#define MaxTokenLen   100

Definition at line 101 of file fx.c.

Referenced by GetConstantColour(), GetHexColour(), GetProperty(), GetToken(), and SetShortExp().

◆ MinValStackSize

#define MinValStackSize   100

Definition at line 105 of file fx.c.

Referenced by AllocFxRt().

◆ NO_CHAN_QUAL

#define NO_CHAN_QUAL   ((PixelChannel) (-1))

Definition at line 564 of file fx.c.

Referenced by AddElement(), DumpRPN(), ExecuteRPN(), GetChannelQualifier(), GetFunction(), and GetOperand().

◆ NULL_ADDRESS

#define NULL_ADDRESS   -2

◆ RpnInit

#define RpnInit   100

Definition at line 102 of file fx.c.

Referenced by BuildRPN().

◆ SAT_CHANNEL

#define SAT_CHANNEL   ((PixelChannel) (-4))

Definition at line 567 of file fx.c.

Referenced by ExecuteRPN(), GetChannelQualifier(), GetFunction(), GetHslFlt(), and GetHslInt().

◆ TableExtend

#define TableExtend   0.1

Definition at line 103 of file fx.c.

Referenced by ExtendOperatorStack(), ExtendRPN(), and ExtendUserSymbols().

◆ THIS_CHANNEL

#define THIS_CHANNEL   ((PixelChannel) (-2))

Definition at line 565 of file fx.c.

Referenced by DumpRPN(), and ExecuteRPN().

◆ WHICH_ATTR_CHAN

#define WHICH_ATTR_CHAN
Value:
(pel->ChannelQual == NO_CHAN_QUAL) ? CompositePixelChannel : \
(pel->ChannelQual == THIS_CHANNEL) ? channel : pel->ChannelQual
#define THIS_CHANNEL
Definition: fx.c:565
#define NO_CHAN_QUAL
Definition: fx.c:564

Definition at line 2866 of file fx.c.

Referenced by ExecuteRPN().

◆ WHICH_NON_ATTR_CHAN

#define WHICH_NON_ATTR_CHAN
Value:
(pel->ChannelQual == NO_CHAN_QUAL || \
pel->ChannelQual == THIS_CHANNEL || \
pel->ChannelQual == CompositePixelChannel \
) ? (channel == CompositePixelChannel ? RedPixelChannel: channel) \
: pel->ChannelQual
#define THIS_CHANNEL
Definition: fx.c:565
#define NO_CHAN_QUAL
Definition: fx.c:564

Definition at line 2870 of file fx.c.

Referenced by ExecuteRPN().

Typedef Documentation

◆ fxFltType

typedef long double fxFltType

Definition at line 108 of file fx.c.

Enumeration Type Documentation

◆ ConstantE

enum ConstantE
Enumerator
cEpsilon 
cE 
cOpaque 
cPhi 
cPi 
cQuantumRange 
cQuantumScale 
cTransparent 
cMaxRgb 
cNull 

Definition at line 199 of file fx.c.

◆ ControlE

enum ControlE
Enumerator
rGoto 
rIfZeroGoto 
rIfNotZeroGoto 
rCopyFrom 
rCopyTo 
rZerStk 
rNull 

Definition at line 526 of file fx.c.

◆ ElementTypeE

Enumerator
etOperator 
etConstant 
etFunction 
etImgAttr 
etSymbol 
etColourConstant 
etControl 

Definition at line 597 of file fx.c.

◆ FunctionE

enum FunctionE
Enumerator
fAbs 
fAcos 
fAlt 
fAsin 
fAtan2 
fAtan 
fCeil 
fChannel 
fClamp 
fCosh 
fCos 
fDebug 
fDrc 
fExp 
fFloor 
fGauss 
fGcd 
fHypot 
fInt 
fIsnan 
fLn 
fLogtwo 
fLog 
fMax 
fMin 
fMod 
fNot 
fPow 
fRand 
fRound 
fSign 
fSinc 
fSinh 
fSin 
fSqrt 
fSquish 
fTanh 
fTan 
fTrunc 
fDo 
fFor 
fIf 
fWhile 
fU 
fU0 
fUP 
fS 
fV 
fP 
fSP 
fVP 
fNull 

Definition at line 233 of file fx.c.

◆ ImgAttrE

enum ImgAttrE
Enumerator
aDepth 
aExtent 
aKurtosis 
aMaxima 
aMean 
aMedian 
aMinima 
aPage 
aPageX 
aPageY 
aPageWid 
aPageHt 
aPrintsize 
aPrintsizeX 
aPrintsizeY 
aQuality 
aRes 
aResX 
aResY 
aSkewness 
aStdDev 
aH 
aN 
aT 
aW 
aZ 
aNull 

Definition at line 401 of file fx.c.

◆ OperatorE

enum OperatorE
Enumerator
oAddEq 
oSubtractEq 
oMultiplyEq 
oDivideEq 
oPlusPlus 
oSubSub 
oAdd 
oSubtract 
oMultiply 
oDivide 
oModulus 
oUnaryPlus 
oUnaryMinus 
oLshift 
oRshift 
oEq 
oNotEq 
oLtEq 
oGtEq 
oLt 
oGt 
oLogAnd 
oLogOr 
oLogNot 
oBitAnd 
oBitOr 
oBitNot 
oPow 
oQuery 
oColon 
oOpenParen 
oCloseParen 
oOpenBracket 
oCloseBracket 
oOpenBrace 
oCloseBrace 
oAssign 
oNull 

Definition at line 110 of file fx.c.

◆ SymbolE

enum SymbolE
Enumerator
sHue 
sIntensity 
sLightness 
sLuma 
sLuminance 
sSaturation 
sA 
sB 
sC 
sG 
sI 
sJ 
sK 
sM 
sO 
sR 
sY 
sNull 

Definition at line 470 of file fx.c.

Function Documentation

◆ AcquireFxInfo()

◆ AddAddressingElement()

static MagickBooleanType AddAddressingElement ( FxInfo pfx,
int  oprNum,
int  EleNdx 
)
static

◆ AddColourElement()

static MagickBooleanType AddColourElement ( FxInfo pfx,
fxFltType  val0,
fxFltType  val1,
fxFltType  val2 
)
static

◆ AddElement()

◆ AddUserSymbol()

static int AddUserSymbol ( FxInfo pfx,
char *  pex,
size_t  len 
)
static

◆ AllocFxRt()

◆ BuildRPN()

◆ ChkImgNum()

static ssize_t ChkImgNum ( FxInfo pfx,
fxFltType  f 
)
inlinestatic

Definition at line 2852 of file fx.c.

References _FxInfo::exception, GetMagickModule, _FxInfo::ImgListLen, OptionError, and ThrowMagickException().

Referenced by ExecuteRPN().

◆ CollectStatistics()

◆ DeInitFx()

◆ DestroyFxInfo()

◆ DestroyFxRt()

static void DestroyFxRt ( fxRtT pfxrt)
static

◆ DestroyRPN()

◆ DumpRPN()

◆ DumpTables()

static void DumpTables ( FILE *  fh)
static

◆ DumpUserSymbols()

static void DumpUserSymbols ( FxInfo pfx,
FILE *  fh 
)
static

Definition at line 879 of file fx.c.

References MagickPathExtent, NameOfUserSym(), and _FxInfo::usedUserSymbols.

Referenced by AcquireFxInfo().

◆ ExecuteRPN()

static MagickBooleanType ExecuteRPN ( FxInfo pfx,
fxRtT pfxrt,
fxFltType result,
const PixelChannel  channel,
const ssize_t  imgx,
const ssize_t  imgy 
)
static

Definition at line 2956 of file fx.c.

References aDepth, aExtent, aH, aKurtosis, aMaxima, aMean, aMedian, aMinima, aN, aNull, aPage, aPageHt, aPageWid, aPageX, aPageY, aPrintsize, aPrintsizeX, aPrintsizeY, aQuality, aRes, aResX, aResY, aSkewness, aStdDev, aT, aW, aZ, _Image::channel_map, ElementT::ChannelQual, ChkImgNum(), _Image::columns, ConvertRGBToHSL(), ElementT::DoPush, _FxInfo::Elements, ElementT::EleNdx, etColourConstant, _FxInfo::exception, _Image::extent, fAbs, fAcos, fAlt, fAsin, fAtan, fAtan2, fCeil, fChannel, fClamp, fCos, fCosh, fDebug, fDo, fDrc, fExp, fFloor, fFor, fGauss, fGcd, fHypot, fIf, _Image::filename, fInt, fIsnan, fLn, fLog, fLogtwo, fMax, fMin, fMod, fNot, fNull, fP, fPow, fRand, fRound, fS, fSign, fSin, fSinc, fSinh, fSP, fSqrt, fSquish, fTan, fTanh, fTrunc, fU, fU0, fUP, fV, fVP, fWhile, FxGcd(), GetCacheViewVirtualPixels(), GetHslFlt(), GetHslInt(), GetImageDepth(), GetIntensity(), GetMagickModule, GetPixelAlpha(), GetPixelBlack(), GetPixelBlue(), GetPixelCyan(), GetPixelGreen(), GetPixelRed(), GetPixelYellow(), GetPseudoRandomValue(), _RectangleInfo::height, HUE_CHANNEL, _FxInfo::image, _FxInfo::Images, ImageStat(), ElementT::ImgAttrQual, _FxInfo::ImgListLen, _FxInfo::ImgNum, INTENSITY_CHANNEL, _Image::interpolate, InterpolatePixelChannel(), IsNaN, ElementT::IsRelative, _ChannelStatistics::kurtosis, ElementT::lenExp, LIGHT_CHANNEL, MagickEpsilon, MagickFalse, MagickPI, MagickTrue, _ChannelStatistics::maxima, _ChannelStatistics::mean, _ChannelStatistics::median, _ChannelStatistics::minima, ElementT::nArgs, _FxInfo::NeedHsl, _FxInfo::NeedStats, NO_CHAN_QUAL, oAdd, oAddEq, oAssign, oBitAnd, oBitNot, oBitOr, oCloseBrace, oCloseBracket, oCloseParen, oColon, oDivide, oDivideEq, oEq, _PixelChannelMap::offset, oGt, oGtEq, oLogAnd, oLogNot, oLogOr, oLshift, oLt, oLtEq, oModulus, oMultiply, oMultiplyEq, oNotEq, oNull, oOpenBrace, oOpenBracket, oOpenParen, oPlusPlus, oPow, ElementT::oprNum, OprStr(), OptionError, oQuery, oRshift, oSubSub, oSubtract, oSubtractEq, oUnaryMinus, oUnaryPlus, _Image::page, PerceptibleReciprocal(), ElementT::pExpStart, PopVal(), _FxInfo::precision, PushVal(), _Image::quality, QuantumRange, QuantumScale, fxRtT::random_info, rCopyFrom, rCopyTo, _Image::resolution, rGoto, rIfNotZeroGoto, rIfZeroGoto, rNull, _Image::rows, rZerStk, sA, SAT_CHANNEL, sB, sC, SetPtrShortExp(), sG, sHue, sI, sIntensity, sJ, sK, _ChannelStatistics::skewness, sLightness, sLuma, sLuminance, sM, sNull, sO, sR, sSaturation, _ChannelStatistics::standard_deviation, _FxInfo::statistics, sY, THIS_CHANNEL, fxRtT::thisPixel, ThrowMagickException(), ElementT::type, _FxInfo::usedElements, fxRtT::usedValStack, fxRtT::UserSymVals, ElementT::val, ElementT::val1, ElementT::val2, _FxInfo::Views, WHICH_ATTR_CHAN, WHICH_NON_ATTR_CHAN, _RectangleInfo::width, _PointInfo::x, _RectangleInfo::x, _PointInfo::y, and _RectangleInfo::y.

Referenced by FxEvaluateChannelExpression(), and FxImage().

◆ ExpectChar()

static MagickBooleanType ExpectChar ( FxInfo pfx,
char  c 
)
static

◆ ExtendOperatorStack()

◆ ExtendRPN()

◆ ExtendUserSymbols()

◆ FindUserSymbol()

static int FindUserSymbol ( FxInfo pfx,
char *  name 
)
static

◆ FxEvaluateChannelExpression()

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

◆ FxGcd()

static fxFltType FxGcd ( fxFltType  x,
fxFltType  y,
const size_t  depth 
)
inlinestatic

Definition at line 2841 of file fx.c.

References FxMaxFunctionDepth.

Referenced by ExecuteRPN().

◆ FxImage()

◆ GetChannelQualifier()

◆ GetConstantColour()

◆ GetCoordQualifier()

static int GetCoordQualifier ( FxInfo pfx,
int  op 
)
static

Definition at line 1355 of file fx.c.

References fP, fS, fU, fV, GetFunction(), GetToken(), _FxInfo::lenToken, and _FxInfo::token.

Referenced by GetFunction().

◆ GetFunction()

◆ GetHexColour()

◆ GetHslFlt()

◆ GetHslInt()

static fxFltType GetHslInt ( FxInfo pfx,
ssize_t  ImgNum,
const ssize_t  imgx,
const ssize_t  imgy,
int  channel 
)
static

◆ GetImgAttrQualifier()

static ImgAttrE GetImgAttrQualifier ( FxInfo pfx,
int  op 
)
static

Definition at line 1431 of file fx.c.

References aNull, fP, fS, fU, fV, GetImgAttrToken(), GetToken(), and _FxInfo::lenToken.

Referenced by GetFunction().

◆ GetImgAttrToken()

◆ GetIntensity()

◆ GetLeadingOp()

static OperatorE GetLeadingOp ( FxInfo pfx)
static

Definition at line 1318 of file fx.c.

References oBitNot, oLogNot, oNull, oOpenParen, oUnaryMinus, oUnaryPlus, and _FxInfo::pex.

Referenced by GetOperand().

◆ GetOperand()

◆ GetOperator()

◆ GetProperty()

◆ GetToken()

◆ ImageStat()

◆ InitFx()

◆ IsQualifier()

static MagickBooleanType IsQualifier ( FxInfo pfx)
static

Definition at line 1444 of file fx.c.

References MagickFalse, MagickTrue, PeekChar(), and _FxInfo::pex.

Referenced by GetFunction(), and GetOperand().

◆ IsRealOperator()

static MagickBooleanType IsRealOperator ( OperatorE  op)
inlinestatic

Definition at line 2280 of file fx.c.

References MagickFalse, MagickTrue, and oCloseBrace.

Referenced by GetOperator().

◆ IsStealth()

static MagickBooleanType IsStealth ( int  op)
static

Definition at line 1978 of file fx.c.

References FirstCont, fSP, fU0, fUP, fVP, MagickFalse, MagickTrue, and rNull.

Referenced by GetOperand().

◆ MaybeXYWH()

◆ NameOfUserSym()

static char* NameOfUserSym ( FxInfo pfx,
int  ndx,
char *  buf 
)
static

Definition at line 870 of file fx.c.

References CopyMagickString(), UserSymbolT::len, UserSymbolT::pex, and _FxInfo::UserSymbols.

Referenced by DumpRPN(), DumpUserSymbols(), and FxImage().

◆ OprInPlace()

static MagickBooleanType OprInPlace ( int  op)
inlinestatic

Definition at line 983 of file fx.c.

References MagickFalse, MagickTrue, oAddEq, and oSubSub.

Referenced by DumpRPN(), GetOperator(), and TranslateExpression().

◆ OprIsUnaryPrefix()

static MagickBooleanType OprIsUnaryPrefix ( OperatorE  op)
inlinestatic

Definition at line 1331 of file fx.c.

References MagickFalse, MagickTrue, oBitNot, oLogNot, oUnaryMinus, and oUnaryPlus.

Referenced by GetOperand(), and TopOprIsUnaryPrefix().

◆ OprStr()

static const char* OprStr ( int  oprNum)
static

◆ PeekChar()

static char PeekChar ( FxInfo pfx)
inlinestatic

Definition at line 1225 of file fx.c.

References _FxInfo::pex, and SkipSpaces().

Referenced by ExpectChar(), GetFunction(), IsQualifier(), and MaybeXYWH().

◆ PeekStr()

static MagickBooleanType PeekStr ( FxInfo pfx,
const char *  str 
)
inlinestatic

Definition at line 1231 of file fx.c.

References LocaleNCompare(), MagickFalse, MagickTrue, _FxInfo::pex, and SkipSpaces().

Referenced by GetProperty().

◆ PopOprOpenParen()

static MagickBooleanType PopOprOpenParen ( FxInfo pfx,
OperatorE  op 
)
static

Definition at line 1343 of file fx.c.

References MagickFalse, MagickTrue, _FxInfo::OperatorStack, and _FxInfo::usedOprStack.

Referenced by GetFunction(), and GetOperand().

◆ PopVal()

static fxFltType PopVal ( FxInfo pfx,
fxRtT pfxrt,
int  addr 
)
inlinestatic

◆ ProcessTernaryOpr()

◆ PushOperatorStack()

static MagickBooleanType PushOperatorStack ( FxInfo pfx,
int  op 
)
static

◆ PushVal()

static MagickBooleanType PushVal ( FxInfo pfx,
fxRtT pfxrt,
fxFltType  val,
int  addr 
)
inlinestatic

◆ ResolveTernaryAddresses()

◆ SetPtrShortExp()

static char* SetPtrShortExp ( FxInfo pfx,
char *  pExp,
size_t  len 
)
static

Definition at line 778 of file fx.c.

References CopyMagickString(), MaxLen, and _FxInfo::ShortExp.

Referenced by ExecuteRPN(), and SetShortExp().

◆ SetShortExp()

◆ SkipSpaces()

static void SkipSpaces ( FxInfo pfx)
inlinestatic

◆ TokenMaybeUserSymbol()

static MagickBooleanType TokenMaybeUserSymbol ( FxInfo pfx)
static

Definition at line 1145 of file fx.c.

References MagickFalse, MagickTrue, and _FxInfo::token.

Referenced by GetOperand().

◆ TopOprIsUnaryPrefix()

static MagickBooleanType TopOprIsUnaryPrefix ( FxInfo pfx)
static

Definition at line 1336 of file fx.c.

References MagickFalse, _FxInfo::OperatorStack, OprIsUnaryPrefix(), and _FxInfo::usedOprStack.

Referenced by TranslateExpression().

◆ TranslateExpression()

◆ TranslateStatement()

static MagickBooleanType TranslateStatement ( FxInfo pfx,
char *  strLimit,
char *  chLimit 
)
static

◆ TranslateStatementList()

static MagickBooleanType TranslateStatementList ( FxInfo pfx,
const char *  strLimit,
char *  chLimit 
)
static

◆ TypeOfOpr()

static ElementTypeE TypeOfOpr ( int  op)
static

Definition at line 766 of file fx.c.

References aNull, etConstant, etControl, etFunction, etImgAttr, etOperator, etSymbol, fNull, oNull, rNull, and sNull.

Referenced by AddElement().

Variable Documentation

◆ Channels

const ChannelT Channels[]
static
Initial value:
= {
{"hue", HUE_CHANNEL},
{"saturation", SAT_CHANNEL},
{"lightness", LIGHT_CHANNEL},
{"intensity", INTENSITY_CHANNEL},
{"this", THIS_CHANNEL},
}
#define INTENSITY_CHANNEL
Definition: fx.c:569
#define THIS_CHANNEL
Definition: fx.c:565
#define SAT_CHANNEL
Definition: fx.c:567
#define NO_CHAN_QUAL
Definition: fx.c:564
#define LIGHT_CHANNEL
Definition: fx.c:568
#define HUE_CHANNEL
Definition: fx.c:566

Definition at line 571 of file fx.c.

Referenced by GetChannelQualifier().

◆ Constants

const ConstantT Constants[]
static
Initial value:
= {
{cEpsilon, MagickEpsilon, "epsilon"},
{cE, 2.7182818284590452354, "e"},
{cOpaque, 1.0, "opaque"},
{cPhi, MagickPHI, "phi"},
{cPi, MagickPI, "pi"},
{cQuantumRange, QuantumRange, "quantumrange"},
{cQuantumScale, QuantumScale, "quantumscale"},
{cTransparent, 0.0, "transparent"},
{cMaxRgb, QuantumRange, "MaxRGB"},
{cNull, 0.0, "cnull"}
}
Definition: fx.c:208
#define MagickPI
Definition: image-private.h:42
#define MagickEpsilon
Definition: magick-type.h:114
Definition: fx.c:203
Definition: fx.c:201
#define MagickPHI
Definition: image-private.h:40
Definition: fx.c:202
#define QuantumScale
Definition: magick-type.h:119
Definition: fx.c:204
Definition: fx.c:200
Definition: fx.c:209
#define QuantumRange
Definition: magick-type.h:87

Definition at line 218 of file fx.c.

Referenced by GetOperand().

◆ Controls

const ControlT Controls[]
static
Initial value:
= {
{rGoto, "goto", 0},
{rIfZeroGoto, "ifzerogoto", 1},
{rIfNotZeroGoto, "ifnotzerogoto", 1},
{rCopyFrom, "copyfrom", 0},
{rCopyTo, "copyto", 1},
{rZerStk, "zerstk", 0},
{rNull, "rnull", 0}
}
Definition: fx.c:527
Definition: fx.c:531
Definition: fx.c:533
Definition: fx.c:530
Definition: fx.c:532

Definition at line 542 of file fx.c.

Referenced by AddElement(), DumpTables(), and OprStr().

◆ Functions

const FunctionT Functions[]
static

Definition at line 319 of file fx.c.

Referenced by AddElement(), DumpTables(), GetFunction(), GetOperand(), and OprStr().

◆ ImgAttrs

const ImgAttrT ImgAttrs[]
static
Initial value:
= {
{aDepth, "depth", 1},
{aExtent, "extent", 0},
{aKurtosis, "kurtosis", 1},
{aMaxima, "maxima", 1},
{aMean, "mean", 1},
{aMedian, "median", 1},
{aMinima, "minima", 1},
{aPage, "page", 0},
{aPageX, "page.x", 0},
{aPageY, "page.y", 0},
{aPageWid, "page.width", 0},
{aPageHt, "page.height", 0},
{aPrintsize, "printsize", 0},
{aPrintsizeX, "printsize.x", 0},
{aPrintsizeY, "printsize.y", 0},
{aQuality, "quality", 0},
{aRes, "resolution", 0},
{aResX, "resolution.x", 0},
{aResY, "resolution.y", 0},
{aSkewness, "skewness", 1},
{aStdDev, "standard_deviation", 1},
{aH, "h", 0},
{aN, "n", 0},
{aT, "t", 0},
{aW, "w", 0},
{aZ, "z", 0},
{aNull, "anull", 0}
}
Definition: fx.c:424
Definition: fx.c:414
Definition: fx.c:403
Definition: fx.c:427
Definition: fx.c:406
Definition: fx.c:428
Definition: fx.c:409
Definition: fx.c:426
Definition: fx.c:425
Definition: fx.c:422
Definition: fx.c:419
Definition: fx.c:402
Definition: fx.c:404
Definition: fx.c:411
Definition: fx.c:410
Definition: fx.c:423
Definition: fx.c:418
Definition: fx.c:408
Definition: fx.c:405
Definition: fx.c:413
Definition: fx.c:407
Definition: fx.c:420
Definition: fx.c:421
Definition: fx.c:412
Definition: fx.c:417

Definition at line 437 of file fx.c.

Referenced by DumpTables(), GetImgAttrToken(), GetOperand(), and OprStr().

◆ Operators

const OperatorT Operators[]
static

Definition at line 158 of file fx.c.

Referenced by AddElement(), DumpTables(), GetFunction(), GetOperator(), and OprStr().

◆ sElementTypes

const char* sElementTypes[]
static
Initial value:
= {
"Operator",
"Constant",
"Function",
"ImgAttr",
"Symbol",
"ColConst",
"Control"
}

Definition at line 607 of file fx.c.

Referenced by DumpRPN().

◆ Symbols

const SymbolT Symbols[]
static
Initial value:
= {
{sHue, "hue"},
{sIntensity, "intensity"},
{sLightness, "lightness"},
{sLuma, "luma"},
{sLuminance, "luminance"},
{sSaturation, "saturation"},
{sA, "a"},
{sB, "b"},
{sC, "c"},
{sG, "g"},
{sI, "i"},
{sJ, "j"},
{sK, "k"},
{sM, "m"},
{sO, "o"},
{sR, "r"},
{sY, "y"},
{sNull, "snull"}
}
Definition: fx.c:485
Definition: fx.c:487
Definition: fx.c:478
Definition: fx.c:481
Definition: fx.c:477
Definition: fx.c:471
Definition: fx.c:483
Definition: fx.c:484
Definition: fx.c:479
Definition: fx.c:486
Definition: fx.c:480
Definition: fx.c:472
Definition: fx.c:488
Definition: fx.c:474
Definition: fx.c:482
Definition: fx.c:475
Definition: fx.c:473

Definition at line 496 of file fx.c.

Referenced by DumpTables(), GetOperand(), and OprStr().