#include <stdint.h>Go to the source code of this file.
Classes
Macros
Typedefs
Functions
Detailed Description
C API for using the EnSight grpc shared memory image transport API. Version 1.0 This library implements a shared memory (memory mapped file) image transport system. To use the system, the client needs to do the following:- Create a physical file on disk that will serve as the memory mapped interface.
- Make sure the file is large enough to hold 2 frames of imagery at maximum size plus 2K. So if the largest image would be for a 4K display, the file needs to be at least 24M + 2K in size (4K*3bytes/pixel*2 frames).
- Make an EnSight grpc SubscribeImages() call with SubscribeImageOptions.type=GRPC and the name of the file created in the previous step passed with the “filename” key in SubscribeImageOptions.options. Note: that SubscribeImageOptions.prefix needs to be set to a unique string that will identify this channel. It is suggested that a GUID be used.
- The EnSight grpc server will initialize the shared memory communication block and register it with the ‘prefix’ passed in the SubscribeImages() call. If the shared memory system can be constructed, it returns success.
-
On successful return from SubscribeImages(), the client then calls SharedMemoryImageStream_create() to connect to the server.
-
Periodically, the client checks for a new image:
If a lock is successful, the frame will be valid and the shared memory system potentially blocked until unlock is called. Once unlock is called, the data returned in frame is no longer valid.
-
When the communication is finished, the client should make the grpc Unsubscribe() call with the same prefix passed in (3) and then call:
Macro Definition Documentation
IMAGESTREAM_API_VERSION
IMAGESTREAM_BAD_ARGS
IMAGESTREAM_BAD_FILE_SIZE
IMAGESTREAM_FRAME_TOO_LARGE
IMAGESTREAM_IS_NOTSERVER
IMAGESTREAM_IS_SERVER
IMAGESTREAM_LOCKED
IMAGESTREAM_MEMORY_ALLOC_ERROR
IMAGESTREAM_NO_BUFFERAVAILABLE
IMAGESTREAM_NO_FRAMEAVAILABLE
IMAGESTREAM_NOERROR
IMAGESTREAM_NOT_LOCKED
IMAGESTREAM_OPTIONS_FLIPVERTICAL
IMAGESTREAM_OPTIONS_NONE
IMAGESTREAM_RECONNECTING
IMAGESTREAM_THREAD_CREATE_ERROR
IMAGESTREAM_UNABLE_TO_MAP_FILE
IMAGESTREAM_UNABLE_TO_OPEN_FILE
IMAGESTREAM_UNCONNECTED
Typedef Documentation
SharedMemoryFrame
SharedMemoryImageError
SharedMemoryImageStream
Function Documentation
SharedMemoryImageStream_create()
Returns
SharedMemoryImageError - the error code for this call.
SharedMemoryImageStream_destroy()
Returns
SharedMemoryImageError - error code for the operation
SharedMemoryImageStream_errorstring()
Returns
const char * - The string describing the error (utf8 encoding)
SharedMemoryImageStream_lock()
Returns
SharedMemoryImageError - the error code for the operation.
SharedMemoryImageStream_unlock()
Returns
SharedMemoryImageError - error code for the operation