VCLinux Library Documentation  3.11.2

Continuous Image Transfer: 'libvcimgnet' and 'vcimgnetsrv'

Continuous Image Transfer: 'libvcimgnet' and 'vcimgnetsrv'
+ Collaboration diagram for Continuous Image Transfer: 'libvcimgnet' and 'vcimgnetsrv':

Data Structures

struct  VCImgNetCtl
 Controls vcimgnet. More...
 
I32 vcimgnet_attach (image *psImg, VCImgNetCfg *cfg)
 Establishes an Asynchronous Connection to an Image Transfer Server. More...
 
I32 vcimgnet_detach (VCImgNetCfg *cfg)
 Removes Image Connection. More...
 

Detailed Description

Preliminary Note: Read the documentation of vcimgnet_attach() for information about asynchronity!

Connecting from the user program is as easy as follows. You set the desired resolution of the transfer image and attach it to the running vcimgnetsrv process. While being attached, the actual pixel data at the moment of transfer will be submitted to the connected client.

vcimgnetsrv_connection.png
image disp;
VCImgNetCfg imgNetCfg;
disp.pitch = 1280;
disp.dx = 1280;
disp.dy = 1024;
disp.st = NULL;
vcimgnet_attach(&disp, &imgNetCfg);
// Do your work here, the volatile data of the disp image</code></li>
// will be transferred continuously.</code></li>
vcimgnet_detach(&imgNetCfg);

A good way to transfer several state images of processing is to use the shared image for the debug display environment. You can easily copy your interim images to one of the debug display sub windows and keep the overview of the whole process. See the VCLib documentation for information how to use the debug display environment.


Data Structure Documentation

◆ VCImgNetCtl

struct VCImgNetCtl
+ Collaboration diagram for VCImgNetCtl:
Data Fields
int pid

Process ID of the Requester

char shmId[SHMIDMAXLEN]

Shared Memory Id to the Image Data (st)

int shmFd

Image Transfer Server Check: 'shm closed?'

image img

Maximum Image Dimensions to be transferred

Function Documentation

◆ vcimgnet_attach()

I32 vcimgnet_attach ( image img,
VCImgNetCfg cfg 
)

This function establishes an asynchronous connection to an image transfer server in form of an image. At this moment only images of type IMAGE_GREY are supported. The image *p img will be set to use the shared memory and so should be unallocated beforehand.

Note
The image data transfer is asynchronous. This may have the disadvantage of transferring partially written data which can result in a half-old half-new picture. The function is mainly developed for development purposes, and since the connection is asynchronous, you can pass the image to deeper functions where you then can easily view the contents of processing results by copying to that image without the need of handling synchronization, so that this attached image can be used to assign it, for example, to the debug display struct.

vcimgnet_detach().

◆ vcimgnet_detach()

I32 vcimgnet_detach ( VCImgNetCfg cfg)

This function the connection between the user application and the image transfer client. Call this function to cleanly disconnect at the end.

vcimgnet_attach().