distort.c File Reference

#include "magick/studio.h"
#include "magick/artifact.h"
#include "magick/cache.h"
#include "magick/cache-view.h"
#include "magick/colorspace-private.h"
#include "magick/composite-private.h"
#include "magick/distort.h"
#include "magick/exception.h"
#include "magick/exception-private.h"
#include "magick/gem.h"
#include "magick/hashmap.h"
#include "magick/image.h"
#include "magick/list.h"
#include "magick/matrix.h"
#include "magick/memory_.h"
#include "magick/monitor-private.h"
#include "magick/pixel.h"
#include "magick/pixel-private.h"
#include "magick/resample.h"
#include "magick/resample-private.h"
#include "magick/registry.h"
#include "magick/semaphore.h"
#include "magick/string_.h"
#include "magick/string-private.h"
#include "magick/thread-private.h"
#include "magick/token.h"
Include dependency graph for distort.c:

Go to the source code of this file.

Defines

#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 unsigned long poly_number_terms (double order)
static double poly_basis_fn (long n, double x, double y)
static const char * poly_basis_str (long n)
static double poly_basis_dx (long n, double x, double y)
static double poly_basis_dy (long n, double x, double y)
static double * GenerateCoefficients (const Image *image, DistortImageMethod *method, const unsigned long number_arguments, const double *arguments, unsigned long number_values, ExceptionInfo *exception)
MagickExport ImageDistortImage (const Image *image, DistortImageMethod method, const unsigned long number_arguments, const double *arguments, MagickBooleanType bestfit, ExceptionInfo *exception)
MagickExport ImageSparseColorImage (const Image *image, const ChannelType channel, const SparseColorMethod method, const unsigned long number_arguments, const double *arguments, ExceptionInfo *exception)

Define Documentation

#define DistortImageTag   "Distort/Image"

Referenced by DistortImage().

#define ExpandBounds (  ) 
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 (  ) 
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 82 of file distort.c.

Referenced by GenerateCoefficients().

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

Definition at line 90 of file distort.c.

Referenced by DistortImage().

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

Definition at line 1399 of file distort.c.

References AcquireCacheView(), AcquireQuantumMemory(), AcquireResampleFilterThreadSet(), AffineDistortion, ArcDistortion, _Image::background_color, BarrelDistortion, BarrelInverseDistortion, BilinearForwardDistortion, BilinearReverseDistortion, CloneImage(), CMYKColorspace, CoefficientsToAffineArgs(), _Image::colorspace, _Image::columns, ConvertRGBToCMYK(), _Image::debug, DePolarDistortion, DestroyCacheView(), DestroyImage(), DestroyResampleFilterThreadSet(), DirectClass, DistortImageTag, _Image::exception, ExpandBounds, _Image::filename, FormatMagickString(), GenerateCoefficients(), GetCacheViewAuthenticIndexQueue(), GetImageArtifact(), GetMagickModule, GetMagickPixelPacket(), GetOpenMPThreadId(), _RectangleInfo::height, hypot, InheritException(), InitalBounds, InvertAffineCoefficients(), InvertPerspectiveCoefficients(), LogMagickEvent(), Magick2PI, MagickEpsilon, MagickFalse, MagickPI2, MagickPixelCompositeBlend(), MagickRound(), MagickSignature, MagickTrue, _Image::matte, _Image::matte_color, MaxTextExtent, _PixelPacket::opacity, OpaqueOpacity, OptionError, _Image::page, ParseAbsoluteGeometry(), PerspectiveDistortion, PolarDistortion, poly_basis_dx(), poly_basis_dy(), poly_basis_fn(), poly_basis_str(), PolynomialDistortion, _Image::progress_monitor, QueueCacheViewAuthenticPixels(), RelinquishMagickMemory(), ResamplePixelColor(), ResourceLimitError, restrict, _Image::rows, ScaleFilter, SetImageProgress(), SetImageStorageClass(), SetMagickPixelPacket(), SetPixelPacket(), ShepardsDistortion, _ExceptionInfo::signature, _Image::signature, StringToDouble(), SyncCacheViewAuthenticPixels(), ThrowMagickException(), TraceEvent, UndefinedVirtualPixelMethod, _RectangleInfo::width, _PointInfo::x, _RectangleInfo::x, _PointInfo::y, and _RectangleInfo::y.

Referenced by AffineTransformImage().

static double* GenerateCoefficients ( const Image image,
DistortImageMethod method,
const unsigned long  number_arguments,
const double *  arguments,
unsigned long  number_values,
ExceptionInfo exception 
) [static]
static void InvertAffineCoefficients ( const double *  coeff,
double *  inverse 
) [static]

Definition at line 97 of file distort.c.

Referenced by DistortImage(), and GenerateCoefficients().

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

Definition at line 111 of file distort.c.

Referenced by DistortImage(), and GenerateCoefficients().

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

Definition at line 77 of file distort.c.

Referenced by GenerateCoefficients().

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

Definition at line 73 of file distort.c.

Referenced by GenerateCoefficients().

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

Definition at line 128 of file distort.c.

Referenced by DistortImage(), and GenerateCoefficients().

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

Definition at line 220 of file distort.c.

Referenced by DistortImage(), and poly_basis_dy().

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

Definition at line 248 of file distort.c.

References poly_basis_dx().

Referenced by DistortImage().

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

Definition at line 164 of file distort.c.

Referenced by DistortImage(), and GenerateCoefficients().

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

Definition at line 192 of file distort.c.

Referenced by DistortImage().

static unsigned long poly_number_terms ( double  order  )  [static]

Definition at line 155 of file distort.c.

References MagickEpsilon.

Referenced by GenerateCoefficients().

MagickExport Image* SparseColorImage ( const Image image,
const ChannelType  channel,
const SparseColorMethod  method,
const unsigned long  number_arguments,
const double *  arguments,
ExceptionInfo exception 
)
Generated by  doxygen 1.6.2-20100208