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 (4K3bytes/pixel2 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:
- When the communication is finished, the client should make the grpc Unsubscribe() call with the same prefix passed in (3) and then call:
Classes
Includes
- <stdint.h>
Included by
Macros
Macro IMAGESTREAM_API_VERSION
Macro IMAGESTREAM_UNCONNECTED
Macro IMAGESTREAM_RECONNECTING
Macro IMAGESTREAM_NO_FRAMEAVAILABLE
Macro IMAGESTREAM_NO_BUFFERAVAILABLE
Macro IMAGESTREAM_NOERROR
Macro IMAGESTREAM_BAD_ARGS
Macro IMAGESTREAM_NOT_LOCKED
Macro IMAGESTREAM_BAD_FILE_SIZE
Macro IMAGESTREAM_UNABLE_TO_OPEN_FILE
Macro IMAGESTREAM_UNABLE_TO_MAP_FILE
Macro IMAGESTREAM_MEMORY_ALLOC_ERROR
Macro IMAGESTREAM_THREAD_CREATE_ERROR
Macro IMAGESTREAM_IS_SERVER
Macro IMAGESTREAM_IS_NOTSERVER
Macro IMAGESTREAM_FRAME_TOO_LARGE
Macro IMAGESTREAM_LOCKED
Macro IMAGESTREAM_OPTIONS_NONE
Macro IMAGESTREAM_OPTIONS_FLIPVERTICAL
Typedefs
Typedef SharedMemoryImageError
Typedef SharedMemoryImageStream
Typedef SharedMemoryFrame
Functions
Function SharedMemoryImageStream_create
- filename: - the name of a pre-existing file to use as the shared memory window
- options: - stream creation options
- stream: - if the returned error value is >=0, this pointer will be returned.
- const char * filename
- uint32_t options
- SharedMemoryImageStream * stream
Function SharedMemoryImageStream_lock
- stream: - the stream to check for imagery
- frame: - the currently available image (if any)
- SharedMemoryImageStream stream
- SharedMemoryFrame * frame
Function SharedMemoryImageStream_unlock
- stream: - the stream to use
- SharedMemoryImageStream stream
Function SharedMemoryImageStream_destroy
- stream: - the stream to use
- SharedMemoryImageStream stream
Function SharedMemoryImageStream_errorstring
- err: - the error code