MagickCore 6.9.12
distort.c File Reference
Include dependency graph for distort.c:

Go to the source code of this file.

Macros

#define DistortResizeImageTag   "Distort/Image"
 
#define DistortImageTag   "Distort/Image"
 
#define InitalBounds(p)
 
#define ExpandBounds(p)
 
#define ScaleFilter(F, A, B, C, D)
 
#define SparseColorTag   "Distort/SparseColor"
 

Functions

static void AffineArgsToCoefficients (double *affine)
 
static void CoefficientsToAffineArgs (double *coeff)
 
static void InvertAffineCoefficients (const double *coeff, double *inverse)
 
static void InvertPerspectiveCoefficients (const double *coeff, double *inverse)
 
static size_t poly_number_terms (double order)
 
static double poly_basis_fn (ssize_t n, double x, double y)
 
static const char * poly_basis_str (ssize_t n)
 
static double poly_basis_dx (ssize_t n, double x, double y)
 
static double poly_basis_dy (ssize_t n, double x, double y)
 
MagickExport ImageAffineTransformImage (const Image *image, const AffineMatrix *affine_matrix, ExceptionInfo *exception)
 
static double MagickRound (double x)
 
static double * GenerateCoefficients (const Image *image, DistortImageMethod *method, const size_t number_arguments, const double *arguments, size_t number_values, ExceptionInfo *exception)
 
MagickExport ImageDistortResizeImage (const Image *image, const size_t columns, const size_t rows, ExceptionInfo *exception)
 
MagickExport ImageDistortImage (const Image *image, DistortImageMethod method, const size_t number_arguments, const double *arguments, MagickBooleanType bestfit, ExceptionInfo *exception)
 
MagickExport ImageRotateImage (const Image *image, const double degrees, ExceptionInfo *exception)
 
MagickExport ImageSparseColorImage (const Image *image, const ChannelType channel, const SparseColorMethod method, const size_t number_arguments, const double *arguments, ExceptionInfo *exception)
 

Macro Definition Documentation

◆ DistortImageTag

#define DistortImageTag   "Distort/Image"

◆ DistortResizeImageTag

#define DistortResizeImageTag   "Distort/Image"

◆ ExpandBounds

#define ExpandBounds (   p)
Value:
{ \
/* printf("%lg,%lg -> %lg,%lg\n", s.x,s.y, d.x,d.y); */ \
min.x = MagickMin(min.x,p.x); \
max.x = MagickMax(max.x,p.x); \
min.y = MagickMin(min.y,p.y); \
max.y = MagickMax(max.y,p.y); \
}
#define MagickMin(x, y)
Definition: image-private.h:37
#define MagickMax(x, y)
Definition: image-private.h:36

◆ InitalBounds

#define InitalBounds (   p)
Value:
{ \
/* printf("%lg,%lg -> %lg,%lg\n", s.x,s.y, d.x,d.y); */ \
min.x = max.x = p.x; \
min.y = max.y = p.y; \
}

◆ ScaleFilter

#define ScaleFilter (   F,
  A,
  B,
  C,
 
)
Value:
output_scaling*(A), output_scaling*(B), \
output_scaling*(C), output_scaling*(D) )
MagickExport void ScaleResampleFilter(ResampleFilter *resample_filter, const double dux, const double duy, const double dvx, const double dvy)
Definition: resample.c:1050

◆ SparseColorTag

#define SparseColorTag   "Distort/SparseColor"

Function Documentation

◆ AffineArgsToCoefficients()

static void AffineArgsToCoefficients ( double *  affine)
inlinestatic

Definition at line 81 of file distort.c.

Referenced by GenerateCoefficients().

◆ AffineTransformImage()

◆ CoefficientsToAffineArgs()

static void CoefficientsToAffineArgs ( double *  coeff)
inlinestatic

Definition at line 89 of file distort.c.

Referenced by DistortImage().

◆ DistortImage()

MagickExport Image * DistortImage ( const Image image,
DistortImageMethod  method,
const size_t  number_arguments,
const double *  arguments,
MagickBooleanType  bestfit,
ExceptionInfo exception 
)

Definition at line 1679 of file distort.c.

References AcquireAuthenticCacheView(), AcquireQuantumMemory(), AcquireResampleFilterTLS(), AffineDistortion, ArcDistortion, _Image::background_color, BarrelDistortion, BarrelInverseDistortion, BilinearDistortion, BilinearForwardDistortion, BilinearReverseDistortion, CloneImage(), CMYKColorspace, CoefficientsToAffineArgs(), _Image::colorspace, _Image::columns, ConvertRGBToCMYK(), Cylinder2PlaneDistortion, DePolarDistortion, DestroyCacheView(), DestroyImage(), DestroyResampleFilterTLS(), DirectClass, DistortImageTag, DistortResizeImage(), _Image::exception, ExpandBounds, _Image::filename, FormatLocaleFile(), FormatLocaleString(), GenerateCoefficients(), GetCacheViewAuthenticIndexQueue(), GetImageArtifact(), GetMagickModule, GetMagickPixelPacket(), GetMagickPrecision(), GetOpenMPThreadId(), _RectangleInfo::height, InheritException(), InitalBounds, InvertAffineCoefficients(), InvertPerspectiveCoefficients(), IsEventLogging(), IsGrayColorspace(), IsPixelGray(), LogMagickEvent(), Magick2PI, magick_restrict, MagickCoreSignature, MagickEpsilon, MagickFalse, MagickPI, MagickPI2, MagickPixelCompositeBlend(), MagickRound(), MagickTrue, _Image::matte, _Image::matte_color, MaxTextExtent, NoValue, _PixelPacket::opacity, OpaqueOpacity, OptionError, OptionWarning, _Image::page, ParseAbsoluteGeometry(), PerceptibleReciprocal(), PerspectiveDistortion, Plane2CylinderDistortion, PolarDistortion, poly_basis_dx(), poly_basis_dy(), poly_basis_fn(), poly_basis_str(), PolynomialDistortion, _Image::progress_monitor, QueueCacheViewAuthenticPixels(), RelinquishMagickMemory(), ResamplePixelColor(), ResizeDistortion, ResourceLimitError, _Image::rows, ScaleFilter, SetImageColorspace(), SetImageProgress(), SetImageStorageClass(), SetMagickPixelPacket(), SetPixelPacket(), ShepardsDistortion, _ExceptionInfo::signature, _Image::signature, sRGBColorspace, StringToDouble(), SyncCacheViewAuthenticPixels(), ThrowMagickException(), TraceEvent, UndefinedVirtualPixelMethod, _RectangleInfo::width, _PointInfo::x, _RectangleInfo::x, _PointInfo::y, and _RectangleInfo::y.

Referenced by AffineTransformImage(), DistortResizeImage(), and RotateImage().

◆ DistortResizeImage()

◆ GenerateCoefficients()

◆ InvertAffineCoefficients()

static void InvertAffineCoefficients ( const double *  coeff,
double *  inverse 
)
static

Definition at line 96 of file distort.c.

References PerceptibleReciprocal().

Referenced by DistortImage(), and GenerateCoefficients().

◆ InvertPerspectiveCoefficients()

static void InvertPerspectiveCoefficients ( const double *  coeff,
double *  inverse 
)
static

Definition at line 110 of file distort.c.

References PerceptibleReciprocal().

Referenced by DistortImage(), and GenerateCoefficients().

◆ MagickRound()

static double MagickRound ( double  x)
inlinestatic

Definition at line 364 of file distort.c.

Referenced by DistortImage(), and GenerateCoefficients().

◆ poly_basis_dx()

static double poly_basis_dx ( ssize_t  n,
double  x,
double  y 
)
static

Definition at line 211 of file distort.c.

Referenced by DistortImage(), and poly_basis_dy().

◆ poly_basis_dy()

static double poly_basis_dy ( ssize_t  n,
double  x,
double  y 
)
static

Definition at line 239 of file distort.c.

References poly_basis_dx().

Referenced by DistortImage().

◆ poly_basis_fn()

static double poly_basis_fn ( ssize_t  n,
double  x,
double  y 
)
static

Definition at line 155 of file distort.c.

Referenced by DistortImage(), and GenerateCoefficients().

◆ poly_basis_str()

static const char * poly_basis_str ( ssize_t  n)
static

Definition at line 183 of file distort.c.

Referenced by DistortImage().

◆ poly_number_terms()

static size_t poly_number_terms ( double  order)
static

Definition at line 146 of file distort.c.

References MagickEpsilon.

Referenced by GenerateCoefficients().

◆ RotateImage()

◆ SparseColorImage()