VisionX V4 | VFNEWIM | VisionX V4 |
NAME
|
Vfnewim, Vfembed, Vfread, Vfwrite
|
SYNOPSIS
|
int Vfnewim(&i, type, bbx, chan);
Vfstruct(i);
float bbx[4];
int type, chan;
int Vfembed(&i, &j ,x1,x2,y1,y2);
Vfstruct(i);
Vfstruct(j);
float x1,x2,y1,y2;
int Vfread(&i, fname);
Vfstruct(i);
char *fname;
int Vfwrite(&i, fname);
Vfstruct(i);
char *fname;
|
DESCRIPTION
|
Image data in VisionX is managed by a set of programming
tools that record image array accessing information in a
single structure (VisXimage_t). The image is considered as a
two dimensional array. An image in a data list consists of
two consecutive data elements, a bounding box followed by a
conforming pixel data element. The image tools provide
convenient structured access to the data element under the
constraints of the bounding box.
The image toolkit contains the following functions:
Vfnewim − creates a new image structure,
Vfembed − creates an
image copy with an optional border set to 0, Vfread reads one image
from a file and Vfwrite writes an image to a file.
|
Vfnewim
|
Vfnewim Initializes an image structure, this is used
to create an image array from scratch. All pixels in the image
are initialized to the value of 0.
The arguments are: the image structure to be initialized, the
base data type e.g. VX_PBYTE, the bounding box for the
image, and the number of channels in the image. A list
structure is allocated that contains the image information
and a reference structure is allocated that will be used for
convenient image data access.
|
Vfembed
|
Vfembed creates a copy of an image in a
second image structure. The additional arguments are
positive integers that specify a border region of zeros for
each of the four sides of the image: x1 adds elements before the
start of an image row and x2 adds pixels at the end of an image row.
This feature is very
useful for local filtering operations since it permits
simple access to elements outside the boundary of the
original image. To make a direct copy of an image simply set
the border values to zero.
|
Vfread
|
Vfread reads a single image from the named file into a Vfstruct.
If the file name is null ("") then it will read from standard input.
It returns the value 1
for a successful read and 0 if there is no more data in the file or if there is
an error in reading the file.
It may be called multiple times to read all the images in a file in turn.
Once reading a file the pixel type (in .type) should be checked before
accessing the data as only one of the pixel type arrays will be created.
If no image is found in the file then the type set to VXNULL; any file
contents will still be available in .list.
|
Vfwrite
|
Vfwrite writes an image (actually the whole list) to a file
from a Vfstruct.
If the file name is set to NULL ("") then the list is written to standard
out. Vfwrite may be called multiple times on the same file. Each time a
the list will be added to the end of the file.
|
SEE ALSO
|
V3newim,V3embed,V3fread(3), V3fwrite(3)
|
AUTHOR
|