xil_kernel_get_by_name(3)
NAME
xil_kernel_get_by_name, xil_kernel_get_name, xil_kernel_set_name − get and set a kernel object name and get a handle to a kernel by specifying its name
SYNOPSIS
#include <xil/xil.h>
XilKernel xil_kernel_get_by_name (XilSystemState State,
char ∗name);
char∗ xil_kernel_get_name (XilKernel kernel);
void xil_kernel_set_name (XilKernel kernel,
char ∗name);
DESCRIPTION
Use these functions to assign names to kernel objects, to read kernel names, and to retrieve kernel objects by name. A predefined kernel is created at the time of an xil_open(3) call. This kernel can be retrieved by xil_kernel_get_by_name().
xil_kernel_get_by_name() returns the handle to the kernel with the specified name name. If such a kernel does not exist, NULL is returned. xil_kernel_get_by_name() does not make a copy of the kernel.
xil_kernel_get_name() returns a copy of the specified kernel’s name. A call to free (3) should be used to free the space allocated by xil_kernel_get_name(). If the specified kernel has no name, NULL is returned.
xil_kernel_set_name() sets the name of the specified kernel to the one provided.
Standard Kernel Provided
The XIL library creates a predefined kernel at the time of an xil_open(3) call. This kernel, "floyd-steinberg", can be used with error diffusion operations.
ERRORS
For a complete list of XIL error messages by number, consult Appendix B of the XIL Programmer’s Guide.
EXAMPLES
Create an edge-sharpening kernel named "sharp1":
XilSystemState State;
XilKernel kernel;
float data[] = { 0.0 -1.0 0.0
-1.0 5.0 -1.0
0.0 -1.0 0.0 };
kernel = xil_kernel_create(State,3,3,1,1,data);
xil_kernel_set_name(kernel, "sharp1");
Use a kernel named "sharp1" to filter an image:
XilSystemState State;
XilImage src, dst;
XilKernel kernel;
kernel = xil_kernel_get_by_name(State,"sharp1");
xil_convolve(src, dst, kernel, XIL_EDGE_ZERO_FILL);
NOTES
The set of standard objects is generated for each instantiation of an XilSystemState. If these standard objects are deleted, they become unavailable for the duration of the current XIL session.
If you give two kernels the same name, it is not defined which kernel will be retrieved by a call to xil_kernel_get_by_name().
SEE ALSO
xil_open(3), xil_kernel_create(3).
SunOS 5.6 — Last change: 04 August 1993