VCLib Documentation  6.12.2

Affine Image Transformations And Scaling

Affine Image Transformations And Scaling

Functions

I32 mirror_hor (image *src, image *dst)
 Mirror Image Horizontally. More...
 
I32 mirror_ver (image *src, image *dst)
 Mirror Image Vertically. More...
 
I32 rotate90l (image *src, image *dst)
 Rotate Image by 90 Degrees Counter-Clockwise. More...
 
I32 rotate90r (image *src, image *dst)
 Rotate Image by 90 Degrees Clockwise. More...
 
I32 rotate180 (image *src, image *dst)
 Rotate Image by 180 Degrees. More...
 
void xshear (image *src, F32 shear, image *dst, F32 offset, U8 bgnd)
 Horizontal Image Shear. More...
 
I32 move_image_alpha (image *src, image *dst, F32 mx, F32 my, U8 bgnd)
 Subpixel Interpolated XY-Movement of Image. More...
 
I32 pyramidx (image *a, image *b, void(*func)())
 Pyramid Reduction for Images. More...
 
I32 pyramidc (image *a, image *b, void(*func)())
 Pyramid Reduction for Color Images. More...
 
void subsample (image *a, image *b, I32 rh, I32 rv)
 Subsampling of Images. More...
 
void zoom_up (image *a, image *b, I32 factor)
 Enlargement of an Image. More...
 
void zoom_up_xy (image *a, image *b, I32 fx, I32 fy)
 Enlargement of an Image. More...
 
I32 threepoint_calculate (point *p0, point *p1, point *p2, point *q0, point *q1, point *q2, F32 **a, F32 *t)
 Calculates the Inverse Affine Transformation Matrix for 2×3 Coordinate Points. More...
 
void calc_rotation_matrix (F32 angle, F32 cx, F32 cy, F32 a[2][2], F32 t[2])
 Calculates the Inverse Rotation Matrix and Vector for a Clockwise Rotation around a Center Point. More...
 
void calc_rotation (F32 angle, point *p, point *target_p, F32 a[2][2], F32 t[2])
 Sample Point driven Calculation of the Inverse Rotation Matrix and Vector for a Clockwise Rotation. More...
 
I32 affine_image_transform (image *src, image *dst, F32 a[2][2], F32 t[2], U8 bgnd)
 Subpixel Interpolated (Inverse) Affine Image Transformation. More...
 
I32 affine_image_transform2 (image *src, image *dst, F32 a[2][2], F32 t[2], U8 bgnd)
 Subpixel Interpolated (Inverse) Affine Image Transformation using float. More...
 
I32 affine_image_transform3 (image *src, image *dst, F32 a[2][2], F32 t[2], U8 bgnd)
 Quadratic Subpixel Interpolated (Inverse) Affine Image Transformation using Integers. More...
 
I32 affine_pixellist_transform (I32 *src, I32 *dst, U32 pxCount, F32 a[2][2], F32 t[2])
 Pixellist (Inverse) Affine Transformation. More...
 
I32 vc_line_greys (U8 *px, I32 *pxCnt, I32 pxMaxBytes, image *a, I32 x1In, I32 y1In, I32 x2In, I32 y2In, I32 *x1UsedOrNULL, I32 *y1UsedOrNULL, I32 *x2UsedOrNULL, I32 *y2UsedOrNULL)
 Grey Value Extraction at a Bresenham Line of an Image. More...
 
I32 vc_line_greys_scaled (U8 *px, I32 *pxCnt, I32 pxMaxBytes, image *a, F32 x1In, F32 y1In, F32 x2In, F32 y2In, I32 scale, F32 *x1UsedOrNULL, F32 *y1UsedOrNULL, F32 *x2UsedOrNULL, F32 *y2UsedOrNULL)
 Grey Value Extraction at a Bresenham Line of an Image (subpixel interpolated scale) More...
 
I32 resample_image (image *src, image *dst, I32(*func)())
 Subpixel Interpolated Image Resampling Transformation. More...
 
#define pyramid(a, b)   pyramidx(a, b, (void (*)())FL_2x2_PAV_U8P_U8P)
 Pyramid Filter for Image Variable. More...
 
#define pyr_max(a, b)   pyramidx(a, b, (void (*)())FL_2x2_PMX_U8P_U8P)
 Pyramid Filter Maximum for Image Variable. More...
 
#define pyr_min(a, b)   pyramidx(a, b, (void (*)())FL_2x2_PMN_U8P_U8P)
 Pyramid Filter Minimum for Image Variable. More...
 
#define pyr_col(a, b)   pyramidc(a, b, (void (*)())FL_2x2_PAC_U8P_U8P)
 Pyramid Averaging Filter for Bayer Pattern Image Variable. More...
 
I32 AffineInitTable (I32 mode)
 Allocates and Initializes a Unit Vector Table for Affine Biquadratic Transform. More...
 
void AffineDeinitTable ()
 Deallocates the Interpolation Table for Affine Biquadratic Transform. More...
 
#define resample_bilinear(src, dst)   resample_image(src, dst, (I32 (*)())affine_image_transform)
 Image Resampling to the Destination Image Size Using Bilinear Interpolation (Macro). More...
 
#define resample_quadratic(src, dst)   resample_image(src, dst, (I32 (*)())affine_image_transform3)
 Image Resampling to the Destination Image Size Using Quadratic Interpolation (Macro). More...
 

Detailed Description

Affine transformations map pixels to different pixels using a linear mapping. All affine transformations can be specified by the following formula:

\[ \left( \begin{array}{c} x_\textrm{dst} \\ y_\textrm{dst} \end{array} \right) = \left( \begin{array}{cc} a_{00} & a_{01} \\ a_{10} & a_{11} \end{array} \right) \left( \begin{array}{c} x_\textrm{src} \\ y_\textrm{src} \end{array} \right) + \left( \begin{array}{c} t_0 \\ t_1 \end{array} \right), \]

where

With the above formula any combination of the following transformation may be performed:

For the function affine_image_transform() the inverse transformation matrix is used. The functions calc_rotation_matrix(), calc_rotation() and threepoint_calculate() return the inverse matrix and vector which can than be used by the affine_image_transform() routine:

\begin{eqnarray*} \left( \begin{array}{c} x_\textrm{src} \\ y_\textrm{src} \end{array} \right) &= \left( \begin{array}{cc} a_{00} & a_{01} \\ a_{10} & a_{11} \end{array} \right)^{-1} \left( \begin{array}{c} x_\textrm{dst} \\ y_\textrm{dst} \end{array} \right) &- \left[\left( \begin{array}{cc} a_{00} & a_{01} \\ a_{10} & a_{11} \end{array} \right)^{-1} \left( \begin{array}{c} t_0 \\ t_1 \end{array} \right) \right]\\ &=: \left( \begin{array}{cc} b_{00} & b_{01} \\ b_{10} & b_{11} \end{array} \right) \left( \begin{array}{c} x_\textrm{dst} \\ y_\textrm{dst} \end{array} \right) &+ \left( \begin{array}{c} u_0 \\ u_1 \end{array} \right), \end{eqnarray*}

where

Macro Definition Documentation

◆ pyramid

#define pyramid (   a,
 
)    pyramidx(a, b, (void (*)())FL_2x2_PAV_U8P_U8P)

The macro computes the pyramid filter operation of an image defined by image variable a. The result is stored in image b.

a1a2
a3a4

Four values of the source image are combined to one pixel of the destination image according to the following formula:

\[ \textrm{result} = (a1, a2, a3, a4)/4 \]

pyramid() is a macro which calls pyramidx() with basic function FL_2x2_PAV_U8P_U8P() as an argument.

◆ pyr_max

#define pyr_max (   a,
 
)    pyramidx(a, b, (void (*)())FL_2x2_PMX_U8P_U8P)

The macro computes the pyramid filter operation of an image defined by image variable a. The result is stored in image b.

a1a2
a3a4

Four values of the source image are combined to one pixel of the destination image according to the following formula:

\[ \textrm{result} = \textrm{max}(a1, a2, a3, a4) \]

pyr_max() is a macro which calls pyramidx() with basic function FL_2x2_PMX_U8P_U8P() as an argument.

◆ pyr_min

#define pyr_min (   a,
 
)    pyramidx(a, b, (void (*)())FL_2x2_PMN_U8P_U8P)

The macro computes the pyramid filter operation of an image defined by image variable a. The result is stored in image b.

a1a2
a3a4

Four values of the source image are combined to one pixel of the destination image according to the following formula:

\[ \textrm{result} = \textrm{min}(a1, a2, a3, a4) \]

pyr_min() is a macro which calls pyramidx() with basic function FL_2x2_PMN_U8P_U8P() as an argument.

◆ pyr_col

#define pyr_col (   a,
 
)    pyramidc(a, b, (void (*)())FL_2x2_PAC_U8P_U8P)

This macro performs a pyramid reduction for color images coded as a bayer pattern image: 2×2 pixels of source are averaged and written to 1 pixel at the destination image.

pyramidc.png

pyr_col() is a macro which calls pyramidc() with basic function FL_2x2_PAC_U8P_U8P() as an argument.

◆ resample_bilinear

#define resample_bilinear (   src,
  dst 
)    resample_image(src, dst, (I32 (*)())affine_image_transform)

The macro resamples the source image content to the dimensions of the destination image using a bilinear interpolation.

Parameters
srcPoints to Source Image.
dstPoints to Destination Image.

resample_bilinear() is a macro which calls resample() with basic function affine_image_transform() as an argument.

◆ resample_quadratic

#define resample_quadratic (   src,
  dst 
)    resample_image(src, dst, (I32 (*)())affine_image_transform3)

The macro resamples the source image content to the dimensions of the destination image using a quadratic interpolation.

Parameters
srcPoints to Source Image.
dstPoints to Destination Image.

resample_bilinear() is a macro which calls resample() with basic function affine_image_transform3() as an argument.

Function Documentation

◆ mirror_hor()

I32 mirror_hor ( image src,
image dst 
)

The function mirrors an image horizontally with respect to its central axis. It is possible to use the function in-place, i.e. source and destination images may be identical. In this case, the function uses a slightly faster exchange-and-reverse routine.

If source and destination images are not identical but overlap, the result is not defined. The function mirrors the whole image if src and dst image have equal dimensions. If this is not the case, only a fraction of the source image is mirrored with the following dimensions: dx = min( src->dx, dst->dx), dy = min( src->dy, dst->dy)

Memory Consumption
None.
See also
mirror_ver().
Return values
ERR_NONEon Success.

◆ mirror_ver()

I32 mirror_ver ( image src,
image dst 
)

The function mirrors an image vertically with respect to its central axis. It is possible to use the function in-place, i.e. source and destination images may be identical. In this case, the function uses a slightly faster exchange-and-reverse routine.

If source and destination images are not identical but overlap, the result is not defined. The function mirrors the whole image if src and dst image have equal dimensions. If this is not the case, only a fraction of the source image is mirrored with the following dimensions: dx = min( src->dx, dst->dx), dy = min( src->dy, dst->dy).

Memory Consumption
None.
See also
mirror_hor().
Return values
ERR_NONEon Success.

◆ rotate90l()

I32 rotate90l ( image src,
image dst 
)

The function rotates an image by 90 degrees counter-clockwise. It is not possible to use the function in-place, i.e. source and destination images must not overlap.

The function rotates the whole image if src and dst image have equal dimensions.

If this is not the case, only a fraction of the source image is rotated with the following dimensions:

dx = min( src->dx, dst->dy) dy = min( src->dy, dst->dx).

The function splits the source image into tiles which can be processed very efficiently even with limited cache memory size.

Memory Consumption
None.
See also
rotate90r(), rotate180().
Return values
ERR_TYPEif Image Types are not identical or wrong.
ERR_NONEon Success.

◆ rotate90r()

I32 rotate90r ( image src,
image dst 
)

The function rotates an image by 90 degrees clockwise.

Please refer to the documentation of rotate90l() for the details.

Memory Consumption
None.
See also
rotate90l(), rotate180().
Return values
ERR_TYPEif Image Types are not identical or wrong.
ERR_NONEon Success.

◆ rotate180()

I32 rotate180 ( image src,
image dst 
)

The function rotates an image by 180 degrees. It is possible to use the function in-place, i.e. source and destination images may be identical. In this case, the function uses a slightly faster exchange-and-reverse routine.

If source and destination images are not identical but overlap, the result is not defined. The function rotates the whole image if src and dst image have equal dimensions.

If this is not the case, only a fraction of the source image is rotated with the following dimensions:

dx = min( src->dx, dst->dx), dy = min( src->dy, dst->dy).

Memory Consumption
None.
See also
rotate90l(), rotate90r().
Return values
ERR_NONEon Success.

◆ xshear()

void xshear ( image src,
F32  shear,
image dst,
F32  Offset,
U8  bgnd 
)

The function performs a horizontal image shear of the source image by a shear factor of shear. A horizontal displacement offset offset may be added. Pixels for which the corresponding source image is not defined, are set to bgnd.

If source and destination images are not identical but overlap, the result is not defined.

Memory Consumption
None.
See also
yshear().

◆ move_image_alpha()

I32 move_image_alpha ( image src,
image dst,
float  mx,
float  my,
U8  bgnd 
)

The function moves an image by a fractional number of pixels in x and y direction using bilinear interpolation.

The offset vector (mx, my) is added to the start of source image. The image is then copied using bilinear interpolation. If (mx, my) = (0, 0), the result of the operation is the same as for the copy() function. The resulting image always has the dimensions of the destination image. Missing areas are set to bgnd. The function also performs a bilinear interpolation between edges of the source image and the background color where applicable.

It is possible to use the function in-place if my<0, otherwise the result is not defined.

Parameters
srcPointer to Source Image.
dstPointer to Destination Image.
mxMovement Vector x, mx > 0: Movement to Right.
myMovement Vector y, my > 0: Downward Movement.
bgndBackground Color.
Memory Consumption
is dst->dx Bytes Maximum.
See also
rotate90l(), rotate90r(), rotate180().
Return values
ERR_FORMATif src or dst is NULL.
ERR_MEMORYif Memory Allocation fails.
ERR_NONEon Success.

◆ pyramidx()

I32 pyramidx ( image a,
image b,
void(*)()  func 
)

The function computes the pyramid filter operation of an image defined by image variable a. The result is stored in image b.

a1a2
a3a4

Four values of the source image are combined to one pixel of the destination image. The nature of the operation is defined by the basic function func().

The following macros use this function:

Call Basic function
pyramid(a, b) FL_2x2_PAV_U8P_U8P()
pyr_max(a, b) FL_2x2_PMX_U8P_U8P()
pyr_min(a, b) FL_2x2_PMN_U8P_U8P()

Please note that the result image is smaller by the factor of two in both the horizontal and vertical direction. The operation may be performed in-place, i.e. a and b may be equal.

Memory Consumption
None.
See also
pyramid(), pyr_max(), pyr_min(), subsample().
zoom_up() for the opposite way.
Return values
ERR_TYPEif not Grey Compatible Image.
ERR_NONEon Success.

◆ pyramidc()

I32 pyramidc ( image src,
image dst,
void(*)()  func 
)

This function performs a pyramid reduction for color images coded as a bayer pattern image.

The following macros are available:

Call Basic function
pyr_col(a, b) FL_2x2_PAC_U8P_U8P()

Please note that the result image is smaller by the factor of two in both the horizontal and vertical direction.

The operation may be performed in-place, i.e. src and dst may be equal.

Memory Consumption
none
Parameters
srcSource Image of Type IMAGE_BAYER.
dstDestination Image of Type IMAGE_BAYER.
funcPoints to Low-level Pyramid Function.
See also
pyramid(), pyr_max(), pyr_min(), subsample()
Return values
ERR_TYPEif Image Type is not IMAGE_BAYER.
ERR_NONEon Success.

◆ subsample()

void subsample ( image a,
image b,
I32  rh,
I32  rv 
)

The function copies the image defined by image variable a into image variable b and reduces its size. rh and rv specify the horizontal (rh) and vertical (rv) subsampling ratio.

Constraints: rh, rv > 0

rh=2 means that every other pixel of an original image line will be taken and stored to the result image. The horizontal image width of the result image will be half the source image width.

Memory Consumption
None.
See also
pyramid().

◆ zoom_up()

void zoom_up ( image a,
image b,
I32  factor 
)

The function enlarges the pixels in image variable a by factor and stores the result in image variable b. If the size of b is not sufficient for this operation the maximum size will be truncated to the size of b.

Memory Consumption
None.
See also
pyramid() for the opposite way.

◆ zoom_up_xy()

void zoom_up_xy ( image a,
image b,
I32  fx,
I32  fy 
)

The function enlarges the pixels in image variable a by factors fx and fy and stores the result in image variable b. If the size of b is not sufficient for this operation the maximum size will be truncated to the size of b.

Memory Consumption
None.

◆ threepoint_calculate()

I32 threepoint_calculate ( point p0,
point p1,
point p2,
point q0,
point q1,
point q2,
F32 **  a,
F32 t 
)

Input to the function are three known points in the original coordinate system and their image points in the transformed coordinate system.

See also
Bernd Jaehne, practical handbook on image processing for scientific applications pp 268-270.
Parameters
[in]p0,p1,p2Sample Point Positions before Transformation.
[in]q0,q1,q2Sample Point Positions after Transformation.
[out]aInverse 2D Transformation Matrix 2×2.
[out]tInverse 2D Translation Vector 2×1.
Return values
ERR_MEMORYif Memory Allcoation failed.
ERR_SINGULARif Transformation Matrix is Singular.
ERR_NONEon Success.

◆ calc_rotation_matrix()

void calc_rotation_matrix ( F32  angle,
F32  cx,
F32  cy,
F32  a[2][2],
F32  t[2] 
)

The function calculates the inverse rotation matrix a[2][2] and the translation vector t[2] for a clockwise rotation with respect to a given center point. Matrix a may then be used, for example, by affine_image_transform().

Parameters
[in]angleAngle for Clockwise Rotation in Degrees.
[in]cx,cyRotation Center Coordinate.
[out]aInverse 2D Transformation Matrix.
[out]tInverse 2D Translation Vector.

◆ calc_rotation()

void calc_rotation ( F32  angle,
point p,
point target_p,
F32  a[2][2],
F32  t[2] 
)

The function calculates the inverse rotation matrix a[2][2] and the translation vector t[2] for a clockwise rotation with respect to a given angle and a sample mapping going from position p to the position target_p.

An important special case is p = target_p = center of rotation.

Parameters
[in]angleAngle for Clockwise Rotation in Degrees.
[in]pSample Coordinate Position before Rotation.
[in]target_pSample Coordinate Position after Rotation.
[out]aInverse 2D Transformation Matrix.
[out]tInverse 2D Translation Vector.

◆ affine_image_transform()

I32 affine_image_transform ( image src,
image dst,
float  a[2][2],
float  t[2],
U8  bgnd 
)

This function performs a general affine image transformation on the source image and outputs the result to the destination image. The function uses bilinear interpolation.

The resulting image always has the dimensions of the destination image. Missing areas are set to bgnd. Please be aware, that the function needs the inverse transformation matrix and translation vector as an input. It is not possible to use the function in-place, i.e. source and destination images must not overlap.

Parameters
srcPointer to Source Image.
dstPointer to Destination Image.
aInverse 2D Transformation Matrix.
tInverse 2D Translation Vector.
bgndBackground Grey Value.
Memory Consumption
None.
See also
affine_image_transform2(), affine_image_transform3(), calc_rotation_matrix().
Return values
ERR_FORMATif src or dst is NULL.
ERR_NONEon Success.

◆ affine_image_transform2()

I32 affine_image_transform2 ( image src,
image dst,
float  a[2][2],
float  t[2],
U8  bgnd 
)

Same as affine_image_transform() but with (slow) floating-point calculation. It is recommmended to use function affine_image_transform() instead. Be aware that the inverse transformation matrix is required.

Parameters
srcpointer to source image
dstpointer to destination image
ainverse 2D transformation matrix
tinverse 2D translation vector
bgndbackground grey value
See also
affine_image_transform(), affine_image_transform3(), calc_rotation_matrix().
Return values
ERR_FORMATif src or dst is NULL.
ERR_NONEon Success.

◆ affine_image_transform3()

I32 affine_image_transform3 ( image src,
image dst,
float  a[2][2],
float  t[2],
U8  bgnd 
)

This function performs a subpixel interpolated affine transformation of image using integer values performing a quadratic interpolation. Be aware that the inverse transformation matrix is required.

This function uses an interpolation table which is allocated and calculated automatically for the first call of the function. The table may be set by the user using the function AffineInitTable(). Please make sure to call the function AffineDeinitTable() when the table is no longer needed.

Parameters
[in]srcPoints to Source Image.
[out]dstPoints to Destination Image.
[in]aInverse 2D Transformation Matrix.
[in]tInverse 2D Translation Vector.
[in]bgndBackground Grey Value.
See also
affine_image_transform(), affine_image_transform2(), calc_rotation_matrix().
Return values
ERR_FORMATif src or dst is NULL.
ERR_TYPEif Image Variable Type of src or dst is not of Type IMAGE_GREY, IMAGE_CBCR444, IMAGE_CBCR422, IMAGE_CBCR411, IMAGE_YUVNORM, IMAGE_IHS, IMAGE_VECTOR.
ERR_MEMORYif Memory Allocation fails.
ERR_NONEon Success.

◆ affine_pixellist_transform()

I32 affine_pixellist_transform ( I32 src,
I32 dst,
U32  pxCount,
float  a[2][2],
float  t[2] 
)

This function performs a general affine image transformation on the source pixel list and outputs the result to the destination pixel list. Output pixels are rounded to its next integer positions.

Please be aware, that the function needs the inverse transformation matrix and translation vector as an input. It is possible to use the function in-place, i.e. source and destination pixel lists may be identical.

Parameters
srcPointer to Source Pixel List.
dstPointer to Destination Pixel List.
pxCountCount of Pixels in List.
aInverse 2D Transformation Matrix.
tInverse 2D Translation Vector.
Memory Consumption
None.
See also
calc_rotation_matrix().
Return values
ERR_NONEalways.

◆ AffineInitTable()

I32 AffineInitTable ( I32  mode)
Parameters
modeTransformation Selector:
  • mode = 0: B-Spline,
  • mode = 1: Biquadratic (Standard).
Return values
ERR_MEMORYif Memory Allocation fails.
ERR_NONEon Success.
ERR_MEMORYif Memory Allocation fails.
ERR_NONEon Success.

◆ AffineDeinitTable()

void AffineDeinitTable ( )

The function deallocates the interpolation table for affine transform allocated after calling AffineInitTable().

◆ vc_line_greys()

I32 vc_line_greys ( U8 px,
I32 pxCnt,
I32  pxMaxBytes,
image a,
I32  x1In,
I32  y1In,
I32  x2In,
I32  y2In,
I32 x1UsedOrNULL,
I32 y1UsedOrNULL,
I32 x2UsedOrNULL,
I32 y2UsedOrNULL 
)

This function extracts grey values of an image lying at a bresenham line. If the given line exceeds the image, only a partial sub-line will be extracted instead. The first coordinate is the coordinate of x1In, y1In or its replacement if the coordinate exceeds the image. The last coordinate is the coordinate of x2In, y2In or its replacement if the coordinate exceeds the image.

Given with pxMaxBytes the output px array must provide at least max(2 * sizeof(I32), sizeof(U8*)) * (1 + max(abs(x2-x1), abs(y2-y1))) bytes.

Parameters
px,pxCntThe result grey value array and its entry number
pxMaxBytesThe maximum px entries allowed, must be at least max(2 * sizeof(I32), sizeof(U8*)) * (1 + max(abs(x2-x1), abs(y2-y1))) bytes.
aThe 8-bit grey value image where pixels will be extracted from
x1In,y1In,x2In,y2InThe requested line of coordinates to be extracted
x1UsedOrNULL,y1UsedOrNULL,x2UsedOrNULL,y2UsedOrNULLOptional pointers to get the sub-line used (you may use x1In ... pointers for overwriting)
See also
vc_line_greys_scaled, affine_image_transform(), affine_image_transform3().

◆ vc_line_greys_scaled()

I32 vc_line_greys_scaled ( U8 px,
I32 pxCnt,
I32  pxMaxBytes,
image a,
F32  x1In,
F32  y1In,
F32  x2In,
F32  y2In,
I32  scale,
F32 x1UsedOrNULL,
F32 y1UsedOrNULL,
F32 x2UsedOrNULL,
F32 y2UsedOrNULL 
)

This function extracts grey values of an image lying at a bresenham line. A scale factor can be given for the output: The upscaled bresenham line positions are bilinearly interpolated between the surrounding four pixel coordinates. If the given line exceeds the image, only a partial sub-line will be extracted instead. The first coordinate is the (scale rounded) subpixel coordinate of x1In, y1In or its replacement if the coordinate exceeds the image. The last coordinate is the (scale rounded) subpixel coordinate of x2In, y2In or its replacement if the coordinate exceeds the image.

Given with pxMaxBytes the output px array must provide at least scale * line length bytes, or processing will fail.

Parameters
px,pxCntThe result grey value array and its entry number
pxMaxBytesThe maximum px entries allowed, must be at least scale * line length bytes
aThe 8-bit grey value image where pixels will be extracted from
x1In,y1In,x2In,y2InThe requested line of coordinates to be extracted (rounded to 1/scale)
scaleThe scale factor used: almost each coordinate at the line scale subpixels are interpolated and outputted
x1UsedOrNULL,y1UsedOrNULL,x2UsedOrNULL,y2UsedOrNULLOptional pointers to get the sub-line used (you may use x1In ... pointers for overwriting)
See also
vc_line_greys, affine_image_transform(), affine_image_transform3().

◆ resample_image()

I32 resample_image ( image src,
image dst,
I32(*)()  func 
)

The source image is resampled to the size of the destination image. Depending on the function pointer used, the operation can be bilinear, biqudratic or differently interpolated.

Parameters
srcPoints to Source Image.
dstPoints to Destination Image.
func()Points to Affine Transformation.
Returns
Standard Error Code.