MagickCore  7.0.10
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/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/transform.h"
#include "MagickCore/transform-private.h"
#include "MagickCore/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

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 MagickOffsetType FxGCD (MagickOffsetType alpha, MagickOffsetType beta)
 
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

#define FxImageTag   "Fx/Image"

Referenced by FxImage().

#define FxMaxParenthesisDepth   58

Referenced by FxEvaluateSubexpression().

#define FxMaxSubexpressionDepth   200

Referenced by FxEvaluateSubexpression().

#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') \
{ \
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:1145
#define GetMagickModule()
Definition: log.h:28
Definition: exception.h:56

Referenced by FxEvaluateSubexpression().

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

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
MagickPrivate MagickBooleanType FxEvaluateChannelExpression ( FxInfo fx_info,
const PixelChannel  channel,
const ssize_t  x,
const ssize_t  y,
double *  alpha,
ExceptionInfo exception 
)
MagickPrivate MagickBooleanType FxEvaluateExpression ( FxInfo fx_info,
double *  alpha,
ExceptionInfo exception 
)
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
static MagickOffsetType FxGCD ( MagickOffsetType  alpha,
MagickOffsetType  beta 
)
static

Referenced by FxEvaluateSubexpression().

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

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(), 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, StripString(), ThrowMagickException(), UndefinedPixelTrait, _FxInfo::view, _RectangleInfo::width, _PointInfo::x, _RectangleInfo::x, _GeometryInfo::xi, XiValue, _PointInfo::y, _RectangleInfo::y, and YellowPixelChannel.

Referenced by FxEvaluateSubexpression().

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 *magick_restrict  fx_info,
const char *  symbol 
)
inlinestatic
static MagickBooleanType IsFxFunction ( const char *  expression,
const char *  name,
const size_t  length 
)
inlinestatic