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

Go to the source code of this file.

Defines

#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 double MagickMin (const double x, const double y)
static double MagickMax (const double x, const double y)
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 double MagickRound (double x)
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 * 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 SparseColorMethod method, const size_t number_arguments, const double *arguments, ExceptionInfo *exception)

Define Documentation

#define DistortImageTag   "Distort/Image"

Referenced by DistortImage().

#define DistortResizeImageTag   "Distort/Image"
#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); \
}

Referenced by DistortImage().

#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; \
}

Referenced by DistortImage().

#define ScaleFilter (   F,
  A,
  B,
  C,
 
)
Value:
ScaleResampleFilter( (F), \
      output_scaling*(A), output_scaling*(B), \
      output_scaling*(C), output_scaling*(D) )

Referenced by DistortImage().

#define SparseColorTag   "Distort/SparseColor"

Referenced by SparseColorImage().


Function Documentation

static void AffineArgsToCoefficients ( double *  affine) [inline, static]

Definition at line 86 of file distort.c.

Referenced by GenerateCoefficients().

static void CoefficientsToAffineArgs ( double *  coeff) [inline, static]

Definition at line 94 of file distort.c.

Referenced by DistortImage().

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

Definition at line 1671 of file distort.c.

References _Image::signature, MagickSignature, _Image::debug, MagickFalse, LogMagickEvent(), TraceEvent, GetMagickModule, _Image::filename, _ExceptionInfo::signature, ResizeDistortion, ThrowMagickException(), OptionError, DistortResizeImage(), GenerateCoefficients(), _RectangleInfo::width, _Image::columns, _RectangleInfo::height, _Image::rows, _RectangleInfo::x, _RectangleInfo::y, ArcDistortion, MagickTrue, _PointInfo::x, _PointInfo::y, AffineDistortion, InvertAffineCoefficients(), _Image::page, InitalBounds, ExpandBounds, PerspectiveDistortion, InvertPerspectiveCoefficients(), MagickEpsilon, MagickPI2, Magick2PI, PolarDistortion, DePolarDistortion, Cylinder2PlaneDistortion, Plane2CylinderDistortion, ShepardsDistortion, BilinearForwardDistortion, BilinearReverseDistortion, PolynomialDistortion, BarrelDistortion, BarrelInverseDistortion, GetImageArtifact(), ParseAbsoluteGeometry(), MaxTextExtent, FormatLocaleString(), AcquireQuantumMemory(), RelinquishMagickMemory(), ResourceLimitError, CoefficientsToAffineArgs(), FormatLocaleFile(), poly_basis_str(), StringToDouble(), CloneImage(), SetImageStorageClass(), DirectClass, DestroyImage(), _Image::background_color, _PixelInfo::alpha, OpaqueAlpha, _Image::matte, GetPixelInfo(), AcquireResampleFilterThreadSet(), UndefinedVirtualPixelMethod, AcquireCacheView(), GetOpenMPThreadId(), QueueCacheViewAuthenticPixels(), ScaleFilter, _Image::matte_color, _Image::colorspace, CMYKColorspace, ConvertRGBToCMYK(), BilinearDistortion, poly_basis_fn(), poly_basis_dx(), poly_basis_dy(), MagickRound(), MagickPI, SetPixelInfoPixel(), ResamplePixelColor(), CompositePixelInfoBlend(), GetPixelChannels(), SyncCacheViewAuthenticPixels(), _Image::progress_monitor, SetImageProgress(), DistortImageTag, DestroyCacheView(), and DestroyResampleFilterThreadSet().

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

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

Definition at line 101 of file distort.c.

Referenced by GenerateCoefficients(), and DistortImage().

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

Definition at line 115 of file distort.c.

Referenced by GenerateCoefficients(), and DistortImage().

static double MagickMax ( const double  x,
const double  y 
) [inline, static]

Definition at line 81 of file distort.c.

Referenced by GenerateCoefficients().

static double MagickMin ( const double  x,
const double  y 
) [inline, static]

Definition at line 77 of file distort.c.

Referenced by GenerateCoefficients().

static double MagickRound ( double  x) [inline, static]

Definition at line 132 of file distort.c.

Referenced by GenerateCoefficients(), and DistortImage().

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

Definition at line 226 of file distort.c.

Referenced by poly_basis_dy(), and DistortImage().

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

Definition at line 254 of file distort.c.

References poly_basis_dx().

Referenced by DistortImage().

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

Definition at line 170 of file distort.c.

Referenced by GenerateCoefficients(), and DistortImage().

static const char* poly_basis_str ( ssize_t  n) [static]

Definition at line 198 of file distort.c.

Referenced by DistortImage().

static size_t poly_number_terms ( double  order) [static]

Definition at line 161 of file distort.c.

References MagickEpsilon.

Referenced by GenerateCoefficients().