xil_get_origin(3)
NAME
xil_get_origin, xil_get_origin_x, xil_get_origin_y, xil_set_origin − get and set the origin of an image
SYNOPSIS
#include <xil/xil.h>
void xil_get_origin ( XilImage image,
float ∗x,
float ∗y);
float xil_get_origin_x (XilImage image);
float xil_get_origin_y (XilImage image);
void xil_set_origin (XilImage image,
float x,
float y);
DESCRIPTION
These functions get and set the conceptual origin of an image. In the XIL library, each image has a pair of floating-point numbers that represents a conceptual origin. The default origin for an image when it is created is the upper left corner of the image (0.0, 0.0). When an operation is performed, the origins of the source and destination images are aligned. The floating-point origin values are rounded to integers for this purpose.
For all nongeometric operators, the following semantics are used to determine the extent of the processing. The source image or images and the destination image are conceptually moved so that their origins are coincident. The intersection of the source and destination images then forms the destination bounds. Only the area of intersection is modified in the destination image, and only the area of intersection in the source is used by the operator. This is very similar to the way in which regions of interest (ROIs) are handled.
Geometric operations behave a little differently, in that after the source and destination origins have been lined up, the bounds of the source image are geometrically transformed and then interesected with the bounds of the destination image. Note that as a result of the transform, the intersection may result in a nonrectangular region in the destination where modification can occur. ROIs are also handled in the same manner.
If the semantic described above does not produce any overlap, no pixels in the destination are touched.
xil_get_origin() gets the x and y coordinates of the origin of an image.
xil_get_origin_x() gets the x coordinate of the origin of an image.
xil_get_origin_y() gets the y coordinate of the origin of an image.
xil_set_origin() sets the x and y coordinates of the origin of an image.
ERRORS
For a complete list of XIL error messages by number, consult Appendix B of the XIL Programmer’s Guide.
EXAMPLES
Move the origin of an image +20.0 in x and -30.0 in y :
XilImage image;
float x, y;
xil_get_origin (image, &x, &y);
x += 20.0;
y -= 30.0;
xil_set_origin (image, x, y);
NOTES
The origin is not constrained to lie within the boundaries of the image.
SunOS — Last change: 17 August 1993