|
Ocean
|
This class implements a frame medium object which is defined by a given buffer and image or frame type. More...
#include <BufferImage.h>
Public Member Functions | |
| bool | isStarted () const override |
| Returns whether the medium is started currently. | |
| Timestamp | startTimestamp () const override |
| Returns the start timestamp. | |
| Timestamp | pauseTimestamp () const override |
| Returns the pause timestamp. | |
| Timestamp | stopTimestamp () const override |
| Returns the stop timestamp. | |
| virtual bool | setBufferImage (const void *buffer, const size_t size, const std::string &imageBufferType=std::string()) |
| Sets or changes the buffer of this image, the given memory buffer is copied and stored internally. | |
| const std::string & | getImageBufferType () const |
| Returns the image buffer type. | |
Public Member Functions inherited from Ocean::Media::FrameMedium | |
| ~FrameMedium () override | |
| Destructs a frame object. | |
| bool | hasFrame () const |
| Returns whether the object holds a frame. | |
| FrameFrequency | frameFrequency () const |
| Returns the frequency of the frame in Hz. | |
| virtual FrameRef | frame (SharedAnyCamera *anyCamera=nullptr) const |
| Returns the most recent frame. | |
| virtual FrameRef | frame (const Timestamp timestamp, SharedAnyCamera *anyCamera=nullptr) const |
| Returns the frame with a specific timestamp. | |
| virtual FrameRef | frameTimeout (const double timeout, SharedAnyCamera *anyCamera=nullptr) const |
| Waits until the first frame is available. | |
| virtual bool | hasFrame (const Timestamp timestamp) const |
| Returns whether this media object currently holds a frame with specified timestamp. | |
| unsigned int | preferredFrameWidth () const |
| Returns the preferred width of the frame in pixel. | |
| unsigned int | preferredFrameHeight () const |
| Returns the preferred height of the frame in pixel. | |
| FrameType::PixelFormat | preferredFramePixelFormat () const |
| Returns the preferred frame pixel format. | |
| FrameFrequency | preferredFrameFrequency () const |
| Returns the preferred frame frequency in Hz. | |
| virtual HomogenousMatrixD4 | device_T_camera () const |
| Returns the transformation between the camera and device. | |
| virtual bool | setPreferredFrameDimension (const unsigned int width, const unsigned int height) |
| Sets the preferred frame dimension. | |
| virtual bool | setPreferredFramePixelFormat (const FrameType::PixelFormat format) |
| Sets the preferred frame pixel format. | |
| virtual bool | setPreferredFrameFrequency (const FrameFrequency frequency) |
| Sets the preferred frame frequency in Hz. | |
| size_t | capacity () const |
| Returns the capacity of the frame history of this frame medium object. | |
| bool | setCapacity (const size_t capacity) |
| Sets or changes the capacity of the frame history of this frame medium object. | |
| virtual bool | setCamera (SharedAnyCamera &&camera) |
| Sets the known camera profile of this frame medium. | |
| FrameCallbackScopedSubscription | addFrameCallback (FrameCallbackFunction &&frameCallbackFunction) |
| Adds a callback function which is called whenever a new frame arrives. | |
Public Member Functions inherited from Ocean::Media::Medium | |
| const std::string & | url () const |
| Returns the url of the medium. | |
| bool | isValid () const |
| Returns whether the medium is valid. | |
| const std::string & | library () const |
| Returns the name of the owner library. | |
| Type | type () const |
| Returns the type of the medium. | |
| bool | isType (const Type type) const |
| Returns whether a medium has a given type. | |
| bool | isExclusive () const |
| Returns whether this medium can be use exclusively. | |
| virtual bool | start ()=0 |
| Starts the medium. | |
| virtual bool | pause ()=0 |
| Pauses the medium. | |
| virtual bool | stop ()=0 |
| Stops the medium. | |
| virtual MediumRef | clone () const |
| Clones this medium and returns a new independent instance of this medium. | |
Protected Member Functions | |
| BufferImage (const std::string &url) | |
| Creates a new buffer image by an arbitrary url defining the name of the resulting object. | |
| ~BufferImage () override=default | |
| Destructs a buffer image object. | |
Protected Member Functions inherited from Ocean::Media::FrameMedium | |
| FrameMedium (const std::string &url) | |
| Creates a new frame medium by a given url. | |
| virtual bool | deliverNewFrame (Frame &&frame, SharedAnyCamera &&anyCamera=SharedAnyCamera()) |
| Delivers a new frame to this FrameMedium. | |
Protected Member Functions inherited from Ocean::Media::Medium | |
| Medium (const Medium &medium)=delete | |
| Disabled copy constructor. | |
| Medium (const std::string &url) | |
| Creates a new medium by a given url. | |
| virtual | ~Medium () |
| Destructs a medium. | |
| Medium & | operator= (const Medium &medium)=delete |
| Disabled copy operator. | |
Protected Attributes | |
| Timestamp | startTimestamp_ |
| Start timestamp. | |
| Timestamp | pauseTimestamp_ |
| Pause timestamp. | |
| Timestamp | stopTimestamp_ |
| Stop timestamp. | |
| bool | started_ = false |
| Determining whether this image is 'started' and holds valid image data. | |
| Memory | memory_ |
| The object's memory. | |
| std::string | bufferType_ |
| The type of the buffer image. | |
Protected Attributes inherited from Ocean::Media::FrameMedium | |
| FrameCollection | frameCollection_ |
| Frame collection storing several frames with different timestamps. | |
| FrameCallbackHandler | frameCallbackHandler_ |
| The handler for frame callback functions. | |
| FrameFrequency | recentFrameFrequency_ = FrameFrequency(0) |
| Frame frequency. | |
| MediaFrameType | preferredFrameType_ |
| Preferred frame type of the medium. | |
Protected Attributes inherited from Ocean::Media::Medium | |
| std::string | url_ |
| Url of the medium. | |
| std::string | libraryName_ |
| Name of the owner library. | |
| bool | isValid_ = false |
| Determines whether the medium is valid. | |
| Type | type_ = MEDIUM |
| Type of the medium. | |
| Lock | lock_ |
| Medium lock. | |
Friends | |
| class | Manager |
Additional Inherited Members | |
Public Types inherited from Ocean::Media::FrameMedium | |
| using | FrameFrequency = double |
| Definition of a frame frequency defined in Hz. | |
| using | FrameCallbackFunction = std::function< void(const Frame &frame, const SharedAnyCamera &camera)> |
| Definition of a callback function for frame events. | |
| using | FrameCallbackScopedSubscription = ScopedSubscriptionHandler::ScopedSubscriptionType |
| Definition of a subscription object for frame callback events. | |
Public Types inherited from Ocean::Media::Medium | |
| enum | Type : uint32_t { MEDIUM = 0u , FRAME_MEDIUM = 1u << 0u , SOUND_MEDIUM = 1u << 1u , FINITE_MEDIUM = 1u << 2u , LIVE_MEDIUM = 1u << 3u , CONFIG_MEDIUM = 1u << 4u , AUDIO = (1u << 5u) | FINITE_MEDIUM | SOUND_MEDIUM , IMAGE = (1u << 6u) | FRAME_MEDIUM , PIXEL_IMAGE = (1u << 7u) | FRAME_MEDIUM , BUFFER_IMAGE = (1u << 8u) | FRAME_MEDIUM , IMAGE_SEQUENCE = (1u << 9u) | FRAME_MEDIUM | FINITE_MEDIUM , LIVE_AUDIO = (1u << 10u) | LIVE_MEDIUM | SOUND_MEDIUM , LIVE_VIDEO = (1u << 11u) | LIVE_MEDIUM | FRAME_MEDIUM , MICROPHONE = (1u << 12u) | LIVE_MEDIUM , MOVIE = (1u << 13u) | FINITE_MEDIUM | FRAME_MEDIUM | SOUND_MEDIUM } |
| Definition of different medium types. More... | |
Static Public Member Functions inherited from Ocean::Media::FrameMedium | |
| static bool | syncedFrames (const FrameMediumRefs &frameMediums, const Timestamp lastTimestamp, FrameRefs &frames, SharedAnyCameras &cameras, const unsigned int waitTime=2u, bool *timedOut=nullptr, HomogenousMatricesD4 *device_T_cameras=nullptr) |
| Extracts most recent frames from several frame medium objects and ensures that the timestamps of all frames are identical. | |
Static Public Member Functions inherited from Ocean::Media::Medium | |
| static std::string | convertType (const Type type) |
| Converts a medium type to a unique string. | |
| static Type | convertType (const std::string &type) |
| Converts a medium type string to a medium type. | |
Protected Types inherited from Ocean::Media::FrameMedium | |
| using | FrameCallbackHandler = ScopedSubscriptionCallbackHandlerT< FrameCallbackFunction, FrameMedium, true > |
| Definition of a thread-safe subscription handler for frame callback functions. | |
| using | FrameTypes = std::vector< MediaFrameType > |
| Definition of a vector holding frame types. | |
This class implements a frame medium object which is defined by a given buffer and image or frame type.
A buffer image can be used to define an explicit frame without loading the content from e.g. a file but from a given memory buffer.
|
explicitprotected |
Creates a new buffer image by an arbitrary url defining the name of the resulting object.
| url | Arbitrary name to identify this pixel image later, if necessary |
|
overrideprotecteddefault |
Destructs a buffer image object.
|
inline |
Returns the image buffer type.
|
overridevirtual |
Returns whether the medium is started currently.
Implements Ocean::Media::Medium.
|
overridevirtual |
|
virtual |
Sets or changes the buffer of this image, the given memory buffer is copied and stored internally.
| buffer | The buffer to be copied, must be valid |
| size | The size of the given memory buffer in bytes, with range [1, infinity) |
| imageBufferType | Type of the image that is stored in the given buffer, should be specified if known (e.g. the file extension of a corresponding image file) |
|
overridevirtual |
|
overridevirtual |
|
protected |
The type of the buffer image.
|
protected |
The object's memory.
|
protected |
Pause timestamp.
|
protected |
Determining whether this image is 'started' and holds valid image data.
|
protected |
Start timestamp.
|
protected |
Stop timestamp.