gd_interpolation.c

Summary
gd_interpolation.c
Functions
gdImageScale
gdImageRotateInterpolated
Affine transformation
Transform
gdTransformAffineGetImageApplies an affine transformation to a region and return an image containing the complete transformation.
gdTransformAffineCopyApplies an affine transformation to a region and copy the result in a destination to the given position.
gdTransformAffineBoundingBoxReturns the bounding box of an affine transformation applied to a rectangular area <gdRect>
gdImageSetInterpolationMethod
gdImageGetInterpolationMethodReturn the interpolation mode set in ‘im’.

Functions

gdImageScale

gdImagePtr gdImageScale(const gdImagePtr src,
const unsigned int new_width,
const unsigned int new_height)

gdImageRotateInterpolated

gdImagePtr gdImageRotateInterpolated(const gdImagePtr src,
const float angle,
int bgcolor)

Affine transformation

Summary
Transform
gdTransformAffineGetImageApplies an affine transformation to a region and return an image containing the complete transformation.
gdTransformAffineCopyApplies an affine transformation to a region and copy the result in a destination to the given position.
gdTransformAffineBoundingBoxReturns the bounding box of an affine transformation applied to a rectangular area <gdRect>
gdImageSetInterpolationMethod
gdImageGetInterpolationMethodReturn the interpolation mode set in ‘im’.

Transform

gdTransformAffineGetImage

int gdTransformAffineGetImage(gdImagePtr *dst,
const gdImagePtr src,
gdRectPtr src_area,
const double affine[6])

Applies an affine transformation to a region and return an image containing the complete transformation.

Parameters

dstPointer to a gdImagePtr to store the created image, NULL when the creation or the transformation failed
srcSource image
src_arearectangle defining the source region to transform
dstYY position in the destination image
affineThe desired affine transformation

Returns

GD_TRUE if the affine is rectilinear or GD_FALSE

gdTransformAffineCopy

int gdTransformAffineCopy(gdImagePtr dst,
int dst_x,
int dst_y,
const gdImagePtr src,
gdRectPtr src_region,
const double affine[6])

Applies an affine transformation to a region and copy the result in a destination to the given position.

Parameters

dstImage to draw the transformed image
srcSource image
dstXX position in the destination image
dstYY position in the destination image
src_areaRectangular region to rotate in the src image

Returns

GD_TRUE if the affine is rectilinear or GD_FALSE

gdTransformAffineBoundingBox

int gdTransformAffineBoundingBox(gdRectPtr src,
const double affine[6],
gdRectPtr bbox)

Returns the bounding box of an affine transformation applied to a rectangular area <gdRect>

Parameters

srcRectangular source area for the affine transformation
affinethe affine transformation
bboxthe resulting bounding box

Returns

GD_TRUE if the affine is rectilinear or GD_FALSE

gdImageSetInterpolationMethod

int gdImageSetInterpolationMethod(gdImagePtr im,
gdInterpolationMethod id)

gdImageGetInterpolationMethod

gdInterpolationMethod gdImageGetInterpolationMethod(gdImagePtr im)

Return the interpolation mode set in ‘im’.  This is here so that the value can be read via a language or VM with an FFI but no (portable) way to extract the value from the struct.

gdImagePtr gdImageScale(const gdImagePtr src,
const unsigned int new_width,
const unsigned int new_height)
gdImagePtr gdImageRotateInterpolated(const gdImagePtr src,
const float angle,
int bgcolor)
int gdTransformAffineGetImage(gdImagePtr *dst,
const gdImagePtr src,
gdRectPtr src_area,
const double affine[6])
Applies an affine transformation to a region and return an image containing the complete transformation.
int gdTransformAffineCopy(gdImagePtr dst,
int dst_x,
int dst_y,
const gdImagePtr src,
gdRectPtr src_region,
const double affine[6])
Applies an affine transformation to a region and copy the result in a destination to the given position.
int gdTransformAffineBoundingBox(gdRectPtr src,
const double affine[6],
gdRectPtr bbox)
Returns the bounding box of an affine transformation applied to a rectangular area gdRect
int gdImageSetInterpolationMethod(gdImagePtr im,
gdInterpolationMethod id)
gdInterpolationMethod gdImageGetInterpolationMethod(gdImagePtr im)
Return the interpolation mode set in ‘im’.
Close