Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ xil_affine(3) — SunOS 5.6

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

xil_translate(3)

xil_rotate(3)

xil_scale(3)

xil_transpose(3)

xil_tablewarp(3)

xil_subsample_adaptive(3)

xil_affine(3)

NAME

xil_affine − perform an affine transform on an image

SYNOPSIS

#include <xil/xil.h>

void xil_affine (XilImage src,

XilImage dst,
char ∗interpolation,
float ∗matrix);

DESCRIPTION

This function performs an affine transform on an image.  src is the source image handle.  dst is the destination image handle.  interpolation is a string that specifies the type of interpolation to be used.  The supported interpolation types are nearest (nearest neighbor), bilinear, bicubic, and general.  general interpolation type allows user to specify a separable function of the pixels in a rectangular region surrounding the src pixel when computing the destintation pixel.  matrix is a six-entry floating point array that defines an arbitrary affine transform on a source image.  This transform combines a scale, rotation, translation and shearing.  The order of the entries in the matrix is: a, b, c, d, tx, ty.  The affine transform equations are as follows:

xd = a∗xs + c∗ys + tx
yd = b∗xs + d∗ys + ty

where xs and ys are coordinates in the source image, and xd and yd are coordinates in the destination image. 

ROI Behavior

If an ROI (region of interest) is attached to the source image, it is used as a read mask and is transformed into the destination image’s space, where it is intersected with the destination ROI (if there is one). 

ERRORS

For a complete list of XIL error messages by number, consult Appendix B of the XIL Programmer’s Guide. 

EXAMPLES

Transform an image using nearest neighbor interpolation and the following affine transform matrix: {2.0, 0.0, 0.0, 2.0, 10.0, 10.0}. This transform matrix scales an image by 2.0 in width and height) and translates it by 10 pixels in both the x and y directions. 

XilImage src, dst;
float matrix[6] = {2.0, 0.0, 0.0, 2.0, 10.0, 10.0};
xil_affine(src, dst, "nearest", matrix);

NOTES

The source and destination images to be transformed must have the same data type and number of bands.  This operation cannot be performed in place. 

SEE ALSO

xil_translate(3), xil_rotate(3), xil_scale(3), xil_transpose(3), xil_tablewarp(3), xil_subsample_adaptive(3). 
 

SunOS 5.6  —  Last change: 10 September 1996

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026