xil_tablewarp(3)
NAME
xil_tablewarp, xil_tablewarp_horizontal, xil_tablewarp_vertical − warp an image with a user-specified warp table
SYNOPSIS
#include <xil/xil.h>
void xil_tablewarp (XilImage src,
XilImage dst,
char∗ interpolation,
XilImage warp_table);
void xil_tablewarp_horizontal (XilImage src,
XilImage dst,
char∗ interpolation,
XilImage warp_table);
void xil_tablewarp_vertical (XilImage src,
XilImage dst,
char∗ interpolation,
XilImage warp_table);
DESCRIPTION
These functions warp an image with the specified warp table. src is the source image handle. dst is the destination image handle. interpolation is a string that specifies the interpolation to be used. The supported interpolation types are nearest (nearest neighbor), bilinear, bicubic, and general. warp_table is a handle to an XilImage structure that describes the backward mapping from a pixel in the destination to a pixel in the source.
A warp table is an XIL image whose pixel values define the backward mapping from a pixel in the destination to a pixel in the source. The warp table is applied at the origin of the destination image. The source origin is then added to the backward mapping position specified by the warp table. A warp table must have the datatype XIL_SHORT, though it can be used to warp images of any data type. The XIL_SHORT value is interpreted as fixed point wth 12 bits value and 4 bits of precision.
The warp table for xil_tablewarp () is a 2-banded image where the bands specify the displacement in x and the displacement in y. The warp table for xil_tablewarp_horizontal () and xil_tablewarp_vertical () is 1-banded and specifies the displacement in the x and y directions, respectively.
ROI Behavior
Because a warp table is technically an XIL image, it can have a defined region of interest (ROI). However, an ROI is meaningless in a warp table and is therefore ignored.
ERRORS
For a complete list of XIL error messages by number, consult Appendix B of the XIL Programmer’s Guide.
EXAMPLES
For this example, a warp table is created to produce the same effect as translation. This example translates a 100 x 120 block from src origin to the right and down with offset (26.0, 37.0) using bilinear interpolation.
XilSystemState State;
XilImage src, dst, warp_table;
float values[2];
warp_table = xil_create(State, 100, 120, 2, XIL_SHORT);
/∗ multiply offsets by 16 because of 12 bit values with 4 bit precision ∗/
values[0] = 26.0 ∗ 16;
values[1] = 37.0 ∗ 16;
xil_set_value(warp_table, values);
xil_tablewarp(src, dst, "bilinear", warp_table);
NOTES
Source and destination images must be the same data type and have the same number of bands. The images need not have the same width and height. This operation cannot be performed in place.
SEE ALSO
xil_set_origin(3), xil_set_pixel(3), xil_set_value(3).
SunOS — Last change: 29 March 1994