![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Stream/ImageStreamCache.h>
A singleton class for caching the output of an ImageStream in a SharedImageSet. More...
Inheritance diagram for ImageStreamCache:A singleton class for caching the output of an ImageStream in a SharedImageSet.
The ImageStreamCache class provides a convenient way to access the image data of a ImageStream from different locations. When a new image for a ImageStream is requested, the ImageStreamCache attaches itself to the stream and stores the image data in the MemImage of a SharedImageSet. Once the last user of the requested image is deleted, the ImageStreamCache is detaching itself from the stream again. To track the lifetime of the requested image, the SharedImageSet is not returned directly but wrapped in a StreamSharedImageSet that behaves like a scoped pointer.
Classes | |
| struct | StreamCacheElement |
Signals | |
| void | updateRequested () |
| Emitted after a StreamSharedImageSet has been updated to signal redrawing of the DisplayWidget. | |
| void | imageReceived (ImageStream *stream) |
| Emitted after a new StreamData arrived to signal main thread. | |
Public Member Functions | |
| StreamSharedImageSet | image (ImageStream *stream) |
| Returns a scoped pointer to the SharedImageSet generated by the stream If this cache is already attached to the stream a scoped pointer to the existing SharedImageSet is returned. | |
| ImageStream * | stream (SharedImageSet *image) |
| Returns the image stream a cache image set is attached to, or nullptr if there is none. | |
Public Member Functions inherited from SignalReceiver | |
| SignalReceiver ()=default | |
| Default constructor. | |
| SignalReceiver (const SignalReceiver &other) | |
| Copy constructor, does not copy any existing signal connections from other. | |
| SignalReceiver & | operator= (SignalReceiver rhs) |
| Assignment operator, disconnects all existing connections, does not copy any existing signal connections from rhs. | |
| virtual | ~SignalReceiver () |
| Virtual destructor disconnects from all connected signals. | |
Static Public Member Functions | |
| static ImageStreamCache & | ref () |
| Returns the singleton instance. | |
Additional Inherited Members | |
Protected Member Functions inherited from SignalReceiver | |
| void | disconnectAll () |
| Disconnects all existing connections. | |
| StreamSharedImageSet image | ( | ImageStream * | stream | ) |
Returns a scoped pointer to the SharedImageSet generated by the stream If this cache is already attached to the stream a scoped pointer to the existing SharedImageSet is returned.
Otherwise this cache will connect to the stream and create a new SharedImageSet. Once all scoped references to the SharedImageSet are deleted, the SharedImageSet itself is deleted and the cache detached from the stream.