MagickCore 7.1.0
Convert, Edit, Or Compose Bitmap Images
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/policy.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  ImgT
 
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
}
 
enum  RunTypeE { rtUnknown , rtEntireImage , rtCornerOnly }
 

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, MagickBooleanType CalcAllStats, 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 ChannelStatisticsCollectOneImgStats (FxInfo *pfx, Image *img)
 
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)
 
static FxInfoAcquireFxInfoPrivate (const Image *images, const char *expression, MagickBooleanType CalcAllStats, 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 526 of file fx.c.

◆ FirstFunc

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

Definition at line 232 of file fx.c.

◆ FirstImgAttr

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

Definition at line 400 of file fx.c.

◆ FirstSym

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

Definition at line 471 of file fx.c.

◆ FxImageTag

#define FxImageTag   "FxNew/Image"

◆ FxMaxFunctionDepth

#define FxMaxFunctionDepth   200

◆ HUE_CHANNEL

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

Definition at line 569 of file fx.c.

◆ InitNumOprStack

#define InitNumOprStack   50

Definition at line 105 of file fx.c.

◆ InitNumUserSymbols

#define InitNumUserSymbols   50

Definition at line 107 of file fx.c.

◆ INTENSITY_CHANNEL

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

Definition at line 572 of file fx.c.

◆ LIGHT_CHANNEL

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

Definition at line 571 of file fx.c.

◆ MAX_SLIMIT

#define MAX_SLIMIT   10

◆ MaxLen

#define MaxLen   20

◆ MaxTokenLen

#define MaxTokenLen   100

Definition at line 102 of file fx.c.

◆ MinValStackSize

#define MinValStackSize   100

Definition at line 106 of file fx.c.

◆ NO_CHAN_QUAL

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

Definition at line 567 of file fx.c.

◆ NULL_ADDRESS

#define NULL_ADDRESS   -2

Definition at line 555 of file fx.c.

◆ RpnInit

#define RpnInit   100

Definition at line 103 of file fx.c.

◆ SAT_CHANNEL

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

Definition at line 570 of file fx.c.

◆ TableExtend

#define TableExtend   0.1

Definition at line 104 of file fx.c.

◆ THIS_CHANNEL

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

Definition at line 568 of file fx.c.

◆ 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:568
#define NO_CHAN_QUAL
Definition: fx.c:567
@ CompositePixelChannel
Definition: pixel.h:96

Definition at line 2995 of file fx.c.

◆ 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
@ RedPixelChannel
Definition: pixel.h:73

Definition at line 2999 of file fx.c.

Typedef Documentation

◆ fxFltType

typedef long double fxFltType

Definition at line 109 of file fx.c.

Enumeration Type Documentation

◆ ConstantE

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

Definition at line 200 of file fx.c.

◆ ControlE

enum ControlE
Enumerator
rGoto 
rIfZeroGoto 
rIfNotZeroGoto 
rCopyFrom 
rCopyTo 
rZerStk 
rNull 

Definition at line 529 of file fx.c.

◆ ElementTypeE

Enumerator
etOperator 
etConstant 
etFunction 
etImgAttr 
etSymbol 
etColourConstant 
etControl 

Definition at line 600 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 234 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 402 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 111 of file fx.c.

◆ RunTypeE

enum RunTypeE
Enumerator
rtUnknown 
rtEntireImage 
rtCornerOnly 

Definition at line 636 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 473 of file fx.c.

Function Documentation

◆ AcquireFxInfo()

FxInfo * AcquireFxInfo ( const Image images,
const char *  expression,
ExceptionInfo exception 
)

Definition at line 4105 of file fx.c.

References AcquireFxInfoPrivate(), and MagickFalse.

◆ AcquireFxInfoPrivate()

◆ 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 2980 of file fx.c.

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

Referenced by ExecuteRPN().

◆ CollectOneImgStats()

◆ 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 902 of file fx.c.

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

Referenced by AcquireFxInfoPrivate().

◆ 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 3090 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(), CollectOneImgStats(), _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(), _FxInfo::GotStats, _RectangleInfo::height, HUE_CHANNEL, _FxInfo::image, _FxInfo::Images, ImageStat(), ElementT::ImgAttrQual, _FxInfo::ImgListLen, _FxInfo::ImgNum, _FxInfo::Imgs, 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, QuantumScale, fxRtT::random_info, rCopyFrom, rCopyTo, RelinquishMagickMemory(), _Image::resolution, rGoto, rIfNotZeroGoto, rIfZeroGoto, rNull, _Image::rows, rZerStk, sA, SAT_CHANNEL, sB, sC, SetPtrShortExp(), _ExceptionInfo::severity, 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, UndefinedException, _FxInfo::usedElements, fxRtT::usedValStack, fxRtT::UserSymVals, ElementT::val, ElementT::val1, ElementT::val2, ImgT::View, 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 2969 of file fx.c.

References FxGcd(), and FxMaxFunctionDepth.

Referenced by ExecuteRPN(), and FxGcd().

◆ FxImage()

◆ GetChannelQualifier()

◆ GetConstantColour()

◆ GetCoordQualifier()

static int GetCoordQualifier ( FxInfo pfx,
int  op 
)
static

Definition at line 1383 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 1459 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 1346 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 1472 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 2337 of file fx.c.

References MagickFalse, MagickTrue, and oCloseBrace.

Referenced by GetOperator().

◆ IsStealth()

static MagickBooleanType IsStealth ( int  op)
static

Definition at line 2035 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 893 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 1006 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 1359 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 1253 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 1259 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 1371 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 801 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 1173 of file fx.c.

References MagickFalse, MagickTrue, and _FxInfo::token.

Referenced by GetOperand().

◆ TopOprIsUnaryPrefix()

static MagickBooleanType TopOprIsUnaryPrefix ( FxInfo pfx)
static

Definition at line 1364 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 789 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 HUE_CHANNEL
Definition: fx.c:569
#define INTENSITY_CHANNEL
Definition: fx.c:572
#define SAT_CHANNEL
Definition: fx.c:570
#define LIGHT_CHANNEL
Definition: fx.c:571
@ CyanPixelChannel
Definition: pixel.h:74
@ BluePixelChannel
Definition: pixel.h:84
@ YellowPixelChannel
Definition: pixel.h:85
@ GreenPixelChannel
Definition: pixel.h:80
@ AlphaPixelChannel
Definition: pixel.h:88
@ BlackPixelChannel
Definition: pixel.h:87
@ MagentaPixelChannel
Definition: pixel.h:81

Definition at line 574 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"}
}
@ cOpaque
Definition: fx.c:203
@ cE
Definition: fx.c:202
@ cNull
Definition: fx.c:210
@ cMaxRgb
Definition: fx.c:209
@ cEpsilon
Definition: fx.c:201
@ cTransparent
Definition: fx.c:208
@ cPi
Definition: fx.c:205
@ cPhi
Definition: fx.c:204
@ cQuantumRange
Definition: fx.c:206
@ cQuantumScale
Definition: fx.c:207
#define MagickPI
Definition: image-private.h:42
#define MagickPHI
Definition: image-private.h:40
#define QuantumRange
Definition: magick-type.h:87
#define MagickEpsilon
Definition: magick-type.h:114
#define QuantumScale
Definition: magick-type.h:119

Definition at line 219 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}
}
@ rIfNotZeroGoto
Definition: fx.c:532
@ rNull
Definition: fx.c:536
@ rZerStk
Definition: fx.c:535
@ rIfZeroGoto
Definition: fx.c:531
@ rCopyTo
Definition: fx.c:534
@ rCopyFrom
Definition: fx.c:533
@ rGoto
Definition: fx.c:530

Definition at line 545 of file fx.c.

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

◆ Functions

const FunctionT Functions[]
static

Definition at line 320 of file fx.c.

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

◆ ImgAttrs

const ImgAttrT ImgAttrs[]
static

Definition at line 438 of file fx.c.

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

◆ Operators

const OperatorT Operators[]
static

Definition at line 159 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 610 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"}
}
@ sNull
Definition: fx.c:491
@ sA
Definition: fx.c:480
@ sY
Definition: fx.c:490
@ sM
Definition: fx.c:487
@ sB
Definition: fx.c:481
@ sSaturation
Definition: fx.c:479
@ sLuminance
Definition: fx.c:478
@ sC
Definition: fx.c:482
@ sR
Definition: fx.c:489
@ sG
Definition: fx.c:483
@ sIntensity
Definition: fx.c:475
@ sI
Definition: fx.c:484
@ sK
Definition: fx.c:486
@ sLightness
Definition: fx.c:476
@ sJ
Definition: fx.c:485
@ sLuma
Definition: fx.c:477
@ sO
Definition: fx.c:488
@ sHue
Definition: fx.c:474

Definition at line 499 of file fx.c.

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