MagickCore  6.9.11-60
Convert, Edit, Or Compose Bitmap Images
fx.c File Reference
#include "magick/studio.h"
#include "magick/accelerate-private.h"
#include "magick/annotate.h"
#include "magick/artifact.h"
#include "magick/attribute.h"
#include "magick/cache.h"
#include "magick/cache-view.h"
#include "magick/channel.h"
#include "magick/color.h"
#include "magick/color-private.h"
#include "magick/colorspace.h"
#include "magick/colorspace-private.h"
#include "magick/composite.h"
#include "magick/decorate.h"
#include "magick/distort.h"
#include "magick/draw.h"
#include "magick/effect.h"
#include "magick/enhance.h"
#include "magick/exception.h"
#include "magick/exception-private.h"
#include "magick/fx.h"
#include "magick/fx-private.h"
#include "magick/gem.h"
#include "magick/geometry.h"
#include "magick/layer.h"
#include "magick/list.h"
#include "magick/log.h"
#include "magick/image.h"
#include "magick/image-private.h"
#include "magick/magick.h"
#include "magick/memory_.h"
#include "magick/memory-private.h"
#include "magick/monitor.h"
#include "magick/monitor-private.h"
#include "magick/opencl-private.h"
#include "magick/option.h"
#include "magick/pixel-accessor.h"
#include "magick/pixel-private.h"
#include "magick/property.h"
#include "magick/quantum.h"
#include "magick/quantum-private.h"
#include "magick/random_.h"
#include "magick/random-private.h"
#include "magick/resample.h"
#include "magick/resample-private.h"
#include "magick/resize.h"
#include "magick/resource_.h"
#include "magick/splay-tree.h"
#include "magick/statistic.h"
#include "magick/string_.h"
#include "magick/string-private.h"
#include "magick/thread-private.h"
#include "magick/threshold.h"
#include "magick/token.h"
#include "magick/transform.h"
#include "magick/utility.h"

Data Structures

struct  _FxInfo
 

Macros

#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

MagickExport FxInfoAcquireFxInfo (const Image *images, const char *expression)
 
MagickExport FxInfoDestroyFxInfo (FxInfo *fx_info)
 
static const double * GetFxSymbolValue (FxInfo *fx_info, const char *symbol)
 
static MagickBooleanType SetFxSymbolValue (FxInfo *magick_restrict fx_info, const char *magick_restrict symbol, const double value)
 
static double FxChannelStatistics (FxInfo *fx_info, const Image *image, ChannelType channel, const char *symbol, ExceptionInfo *exception)
 
static double FxEvaluateSubexpression (FxInfo *, const ChannelType, 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)
 
static const char * FxSubexpression (const char *expression, ExceptionInfo *exception)
 
static double FxGetSymbol (FxInfo *fx_info, const ChannelType 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)
 
MagickExport MagickBooleanType FxEvaluateExpression (FxInfo *fx_info, double *alpha, ExceptionInfo *exception)
 
MagickExport MagickBooleanType FxPreprocessExpression (FxInfo *fx_info, double *alpha, ExceptionInfo *exception)
 
MagickExport MagickBooleanType FxEvaluateChannelExpression (FxInfo *fx_info, const ChannelType 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 ImageFxImageChannel (const Image *image, const ChannelType channel, const char *expression, ExceptionInfo *exception)
 

Macro Definition Documentation

◆ FxImageTag

#define FxImageTag   "Fx/Image"

◆ FxMaxParenthesisDepth

#define FxMaxParenthesisDepth   58

◆ FxMaxSubexpressionDepth

#define FxMaxSubexpressionDepth   200

◆ 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:1149
#define GetMagickModule()
Definition: log.h:29

◆ FxReturn

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

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 

Function Documentation

◆ AcquireFxInfo()

◆ AcquireFxThreadSet()

◆ DestroyFxInfo()

◆ DestroyFxThreadSet()

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

◆ FxChannelStatistics()

◆ FxEvaluateChannelExpression()

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

◆ FxEvaluateExpression()

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

◆ FxEvaluateSubexpression()

static double FxEvaluateSubexpression ( FxInfo fx_info,
const ChannelType  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 
)
inlinestatic

Referenced by FxEvaluateSubexpression().

◆ FxGetSymbol()

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

References AcquireString(), AddValueToSplayTree(), BlackChannel, _MagickPixelPacket::blue, BlueChannel, _GeometryInfo::chi, ChiValue, ClampToQuantum(), CloneMagickPixelPacket(), CMYKColorspace, _FxInfo::colors, _Image::colorspace, _Image::columns, ConstantString(), ConvertRGBToHSL(), CopyMagickString(), CyanChannel, DefaultChannels, DestroyString(), _FxInfo::exception, _Image::extent, _Image::filename, FxChannelStatistics(), FxEvaluateSubexpression(), GetBlobSize(), GetFxSymbolValue(), GetImageArtifact(), GetImageChannelDepth(), GetImageFromList(), GetImageIndexInList(), GetImageListLength(), GetMagickModule, GetMagickPixelIntensity(), GetMagickPixelPacket(), GetPixelAlpha, GetValueFromSplayTree(), _MagickPixelPacket::green, GreenChannel, _RectangleInfo::height, ImageError, _FxInfo::images, _MagickPixelPacket::index, IndexChannel, _Image::interpolate, InterpolateMagickPixelPacket(), IsFxFunction(), LocaleCompare(), LocaleNCompare(), MagentaChannel, MagickFalse, _MagickPixelPacket::matte, MaxTextExtent, _MagickPixelPacket::opacity, OpacityChannel, OptionError, _Image::page, ParseGeometry(), PerceptibleReciprocal(), _GeometryInfo::psi, PsiValue, _Image::quality, QuantumScale, QueryMagickColor(), _MagickPixelPacket::red, RedChannel, _GeometryInfo::rho, RhoValue, _Image::rows, SetFxSymbolValue(), _GeometryInfo::sigma, SigmaValue, StringToDouble(), StripString(), ThrowMagickException(), _FxInfo::view, _RectangleInfo::width, _PointInfo::x, _RectangleInfo::x, _Image::x_resolution, _GeometryInfo::xi, XiValue, _PointInfo::y, _RectangleInfo::y, _Image::y_resolution, and YellowChannel.

Referenced by FxEvaluateSubexpression().

◆ FxImage()

MagickExport Image* FxImage ( const Image image,
const char *  expression,
ExceptionInfo exception 
)

References FxImageChannel(), and GrayChannel.

◆ FxImageChannel()

◆ FxOperatorPrecedence()

◆ FxPreprocessExpression()

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

◆ FxSubexpression()

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

◆ GetFxSymbolValue()

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

◆ IsFxFunction()

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

◆ SetFxSymbolValue()