MagickCore  6.9.12-35
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 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

MagickExport FxInfo * AcquireFxInfo (const Image *images, const char *expression)
 
MagickExport FxInfo * DestroyFxInfo (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, const size_t depth)
 
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 Image * FxImage (const Image *image, const char *expression, ExceptionInfo *exception)
 
MagickExport Image * FxImageChannel (const Image *image, const ChannelType channel, const char *expression, ExceptionInfo *exception)
 

Macro Definition Documentation

#define FxImageTag   "Fx/Image"

Referenced by FxImageChannel().

#define FxMaxFunctionDepth   200

Referenced by FxGCD().

#define FxMaxParenthesisDepth   58

Referenced by FxEvaluateSubexpression().

#define FxMaxSubexpressionDepth   200

Referenced by FxEvaluateSubexpression().

#define FxParseConditional (   subexpression,
  sentinal,
  p,
  q 
)
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') \
{ \
OptionError,"UnableToParseExpression","`%s'",subexpression); \
FxReturn(0.0); \
} \
if (strlen(q) == 1) \
*(q+1)='\0'; \
*q='\0'; \
}
#define FxReturn(value)
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
Definition: exception.h:57

Referenced by FxEvaluateSubexpression().

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

Referenced by FxEvaluateSubexpression().

Enumeration Type Documentation

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

static FxInfo** DestroyFxThreadSet ( FxInfo **  fx_info)
static
MagickExport MagickBooleanType FxEvaluateChannelExpression ( FxInfo *  fx_info,
const ChannelType  channel,
const ssize_t  x,
const ssize_t  y,
double *  alpha,
ExceptionInfo *  exception 
)
MagickExport MagickBooleanType FxEvaluateExpression ( FxInfo *  fx_info,
double *  alpha,
ExceptionInfo *  exception 
)
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
static double FxGCD ( const double  alpha,
const double  beta,
const size_t  depth 
)
inlinestatic

References FxMaxFunctionDepth.

Referenced by FxEvaluateSubexpression().

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, _RectangleInfo::x, _PointInfo::x, _Image::x_resolution, _GeometryInfo::xi, XiValue, _RectangleInfo::y, _PointInfo::y, _Image::y_resolution, and YellowChannel.

Referenced by FxEvaluateSubexpression().

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

References FxImageChannel(), and GrayChannel.

MagickExport MagickBooleanType FxPreprocessExpression ( FxInfo *  fx_info,
double *  alpha,
ExceptionInfo *  exception 
)
static const char* FxSubexpression ( const char *  expression,
ExceptionInfo *  exception 
)
inlinestatic
static const double* GetFxSymbolValue ( FxInfo *  fx_info,
const char *  symbol 
)
inlinestatic
static MagickBooleanType IsFxFunction ( const char *  expression,
const char *  name,
const size_t  length 
)
inlinestatic