3D simple VisionX V4 functions

NAME

V3fnewim, V3fembed, V3fread, V3fwrite

SYNOPSIS
int V3fnewim(&i, type, bbx, chan);
V3fstruct(i);
float bbx[6];
int type, chan;

int V3fembed(&i, &j ,x1,x2,y1,y2,z1,z2);
V3fstruct(i);
V3fstruct(j);
float x1,x2,y1,y2,z1,z2;

int V3fread(&i, fname);
V3fstruct(i);
char *fname;

int V3fwrite(&i, fname);
V3fstruct(i);
char *fname;
DESCRIPTION

Three dimensional image data in VisionX is managed by a set of programming tools that record image array accessing information in a single structure (VisX3dim_t). The image is considered as a three dimensional array. An image in a data list consists of two consecutive data elements, a bounding box followed by a conforming pixel data element. A three-dimensional image is represented by a set of two-dimensional images in the file format. The 3D image tools provide convenient structured access to the data element under the constraints of the bounding box.

The image toolkit contains the following functions: V3fnewim − creates a new image structure, V3fembed − creates an image copy with an optional border set to 0, V3fread reads one image from a file and V3fwrite writes an image to a file.

V3fnewim

V3fnewim 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.

V3fembed

V3Fembed 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 six sides of the 3D 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.

V3fread

V3fread reads a single 3D image from the named file into a V3fstruct. 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 only nonce for a given file since the whole file is read. 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.

V3fwrite

V3fwrite writes an image (actually the whole list) to a file from a V3fstruct. If the file name is set to NULL ("") then the list is writen to standard out. V3fwrite 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

Vfnewim,Vfembed,Vfread(3), Vfwrite(3)

AUTHOR

A. P. Reeves