xil_create_temporary(3)
NAME
xil_create_temporary, xil_create_temporary_from_type - create a temporary image
SYNOPSIS
#include <xil/xil.h>
XilImage xil_create_temporary(XilSystemState system_state,
unsigned int width,
unsigned int height,
unsigned int nbands,
XilDataType datatype);
XilImage xil_create_temporary_from_type(XilSystemState system_state,
XilImageType imagetype);
DESCRIPTION
Temporary images share all the properties of standard XIL images except that they can only be written into once and read from once. You use temporary images as interim images when performing a sequence of XIL functions on a source image to produce a particular destination image.
Temporary images provide a significant benefit with tiling. In addition, they help the deferred execution mechanism recognize when images are no longer needed. It is strongly recommended that you create temporary images for all interim images that you know you won’t be processing again.
xil_create_temporary () creates an image with the specified dimensions and data type. width is the width (extent in x) of the image. height is the height (extent in y) of the image. nbands is the number of bands in the image. datatype is the data type of the image, which can be one of the following enumeration constants of type XilDataType:
XIL_BIT 1-bit
XIL_BYTE unsigned 8-bit
XIL_SHORT signed 16-bit
XIL_FLOAT 32-bit IEEE floating point
xil_create_temporary_from_type () creates an image from an XilImageType object. All the parameters needed to create the image are contained within the XilImageType object. An XilImageType object is often used as a shortcut for creating new images equivalent to an existing image without having to query the image or image type for its individual characteristics. The characteristics of an XilImageType object are xsize, ysize, nbands, datatype, and colorspace.
ERRORS
For a complete list of XIL error messages by number, consult Appendix B of the XIL Programmer’s Guide.
EXAMPLES
Take a particular source image and perform a series of operations before displaying the final image.
XilSystemState state;
XilImage filesrc;
XilImage display;
XilImage tmp1, tmp2;
unsigned int width, height, nbands;
XilDataType datatype;
Display∗ xdisplay;
Window xwindow;
filesrc = xil_create(state, width, height, nbands, datatype);
display = xil_create_from_window(state, xdisplay, xwindow);
tmp1 = xil_create_temporary(state, width, height, nbands,datatype);
/∗ process filesrc into the display ∗/
xil_lookup(filesrc, tmp1);
tmp2 = xil_create_temporary(state, width, height, nbands,datatype);
xil_convolve(tmp1, tmp2);
xil_ordered_dither (tmp2, display);
/∗ wait ∗/
xil_destroy(filesrc);
xil_destroy(display);
NOTES
A temporary image may only be modified up until the point that it has been written in to. That is, the origin, ROI, and colorspace may be modified until the temporary image has been used as a destination.
As soon as the temporary image has been used as a source to an operation, it no longer exists.
If a temporary image has not been used as a source to an operation, it still exists and the user would be responsible for destroying the temporary image before exiting XIL. A temporary image may not be exported.
SEE ALSO
xil_create(3), xil_create_from_type(3).
SunOS 5.6 — Last change: 10 February 1997