Ocean
Ocean::Media::PixelImage Class Reference

This class implements a frame medium object which uses an explicit frame only. More...

Inheritance diagram for Ocean::Media::PixelImage:

Public Member Functions

bool isStarted () const override
 Returns whether the medium is started currently. More...
 
HomogenousMatrixD4 device_T_camera () const override
 Returns the transformation between the camera and device. More...
 
void setDevice_T_camera (const HomogenousMatrixD4 &device_T_camera)
 Sets the transformation between the camera and device. More...
 
bool start () override
 Starts the medium. More...
 
bool pause () override
 Pauses the medium. More...
 
bool stop () override
 Stops the medium. More...
 
Timestamp startTimestamp () const override
 Returns the start timestamp. More...
 
Timestamp pauseTimestamp () const override
 Returns the pause timestamp. More...
 
Timestamp stopTimestamp () const override
 Returns the stop timestamp. More...
 
virtual bool setPixelImage (Frame &&frame, SharedAnyCamera anyCamera=nullptr)
 Sets or changes the explicit frame of this pixel image. More...
 
virtual bool setPixelImage (const Frame &frame, SharedAnyCamera anyCamera=nullptr)
 Sets or changes the explicit frame of this pixel image. More...
 
- Public Member Functions inherited from Ocean::Media::FrameMedium
 ~FrameMedium () override
 Destructs a frame object. More...
 
bool hasFrame () const
 Returns whether the object holds a frame. More...
 
FrameFrequency frameFrequency () const
 Returns the frequency of the frame in Hz. More...
 
virtual FrameRef frame (SharedAnyCamera *anyCamera=nullptr) const
 Returns the most recent frame. More...
 
virtual FrameRef frame (const Timestamp timestamp, SharedAnyCamera *anyCamera=nullptr) const
 Returns the frame with a specific timestamp. More...
 
virtual FrameRef frameTimeout (const double timeout, SharedAnyCamera *anyCamera=nullptr) const
 Waits until the first frame is available. More...
 
virtual bool hasFrame (const Timestamp timestamp) const
 Returns whether this media object currently holds a frame with specified timestamp. More...
 
unsigned int preferredFrameWidth () const
 Returns the preferred width of the frame in pixel. More...
 
unsigned int preferredFrameHeight () const
 Returns the preferred height of the frame in pixel. More...
 
FrameType::PixelFormat preferredFramePixelFormat () const
 Returns the preferred frame pixel format. More...
 
FrameFrequency preferredFrameFrequency () const
 Returns the preferred frame frequency in Hz. More...
 
virtual bool setPreferredFrameDimension (const unsigned int width, const unsigned int height)
 Sets the preferred frame dimension. More...
 
virtual bool setPreferredFramePixelFormat (const FrameType::PixelFormat format)
 Sets the preferred frame pixel format. More...
 
virtual bool setPreferredFrameFrequency (const FrameFrequency frequency)
 Sets the preferred frame frequency in Hz. More...
 
size_t capacity () const
 Returns the capacity of the frame history of this frame medium object. More...
 
bool setCapacity (const size_t capacity)
 Sets or changes the capacity of the frame history of this frame medium object. More...
 
FrameCallbackScopedSubscription addFrameCallback (FrameCallbackFunction &&frameCallbackFunction)
 Adds a callback function which is called whenever a new frame arrives. More...
 
- Public Member Functions inherited from Ocean::Media::Medium
const std::string & url () const
 Returns the url of the medium. More...
 
bool isValid () const
 Returns whether the medium is valid. More...
 
const std::string & library () const
 Returns the name of the owner library. More...
 
Type type () const
 Returns the type of the medium. More...
 
bool isType (const Type type) const
 Returns whether a medium has a given type. More...
 
bool isExclusive () const
 Returns whether this medium can be use exclusively. More...
 
virtual MediumRef clone () const
 Clones this medium and returns a new independent instance of this medium. More...
 

Protected Member Functions

 PixelImage (const std::string &url)
 Creates a new pixel image by an arbitrary url defining the name of the resulting object. More...
 
- Protected Member Functions inherited from Ocean::Media::FrameMedium
 FrameMedium (const std::string &url)
 Creates a new frame medium by a given url. More...
 
virtual bool deliverNewFrame (Frame &&frame, SharedAnyCamera &&anyCamera=SharedAnyCamera())
 Delivers a new frame to this FrameMedium. More...
 
- Protected Member Functions inherited from Ocean::Media::Medium
 Medium (const Medium &medium)=delete
 Disabled copy constructor. More...
 
 Medium (const std::string &url)
 Creates a new medium by a given url. More...
 
virtual ~Medium ()
 Destructs a medium. More...
 
Mediumoperator= (const Medium &medium)=delete
 Disabled copy operator. More...
 

Protected Attributes

Timestamp startTimestamp_
 Start timestamp. More...
 
Timestamp pauseTimestamp_
 Pause timestamp. More...
 
Timestamp stopTimestamp_
 Stop timestamp. More...
 
bool isStarted_
 Determining whether this image is 'started' and holds valid image data. More...
 
HomogenousMatrixD4 device_T_camera_
 The transformation between camera and device. More...
 
- Protected Attributes inherited from Ocean::Media::FrameMedium
FrameCollection frameCollection_
 Frame collection storing several frames with different timestamps. More...
 
FrameCallbackHandler frameCallbackHandler_
 The handler for frame callback functions. More...
 
FrameFrequency recentFrameFrequency_ = FrameFrequency(0)
 Frame frequency. More...
 
MediaFrameType preferredFrameType_
 Preferred frame type of the medium. More...
 
- Protected Attributes inherited from Ocean::Media::Medium
std::string url_
 Url of the medium. More...
 
std::string libraryName_
 Name of the owner library. More...
 
bool isValid_ = false
 Determines whether the medium is valid. More...
 
Type type_ = MEDIUM
 Type of the medium. More...
 
Lock lock_
 Medium lock. More...
 

Friends

class Manager
 

Additional Inherited Members

- Public Types inherited from Ocean::Media::FrameMedium
typedef double FrameFrequency
 Definition of a frame frequency defined in Hz. More...
 
typedef std::function< void(const Frame &frame, const SharedAnyCamera &camera)> FrameCallbackFunction
 Definition of a callback function for frame events. More...
 
typedef ScopedSubscriptionHandler::ScopedSubscriptionType FrameCallbackScopedSubscription
 Definition of a subscription object for frame callback events. More...
 
- 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. More...
 
- Static Public Member Functions inherited from Ocean::Media::Medium
static std::string convertType (const Type type)
 Converts a medium type to a unique string. More...
 
static Type convertType (const std::string &type)
 Converts a medium type string to a medium type. More...
 
- Protected Types inherited from Ocean::Media::FrameMedium
typedef ScopedSubscriptionCallbackHandlerT< FrameCallbackFunction, FrameMedium, true > FrameCallbackHandler
 Definition of a thread-safe subscription handler for frame callback functions. More...
 
typedef std::vector< MediaFrameTypeFrameTypes
 Definition of a vector holding frame types. More...
 

Detailed Description

This class implements a frame medium object which uses an explicit frame only.

A pixel image can be used to define an explicit frame without any e.g. image or movie stream.

Constructor & Destructor Documentation

◆ PixelImage()

Ocean::Media::PixelImage::PixelImage ( const std::string &  url)
explicitprotected

Creates a new pixel image by an arbitrary url defining the name of the resulting object.

Parameters
urlArbitrary name to identify this pixel image later, if necessary

Member Function Documentation

◆ device_T_camera()

HomogenousMatrixD4 Ocean::Media::PixelImage::device_T_camera ( ) const
overridevirtual

Returns the transformation between the camera and device.

See also
PixelImage::device_T_camera(), setDevice_T_camera().

Reimplemented from Ocean::Media::FrameMedium.

◆ isStarted()

bool Ocean::Media::PixelImage::isStarted ( ) const
overridevirtual

Returns whether the medium is started currently.

See also
Medium:isStarted().

Implements Ocean::Media::Medium.

◆ pause()

bool Ocean::Media::PixelImage::pause ( )
overridevirtual

Pauses the medium.

See also
Medium::pause().

Implements Ocean::Media::Medium.

◆ pauseTimestamp()

Timestamp Ocean::Media::PixelImage::pauseTimestamp ( ) const
overridevirtual

Returns the pause timestamp.

See also
Medium::pauseTimestamp().

Implements Ocean::Media::Medium.

◆ setDevice_T_camera()

void Ocean::Media::PixelImage::setDevice_T_camera ( const HomogenousMatrixD4 device_T_camera)

Sets the transformation between the camera and device.

Parameters
device_T_cameraThe transformation to be set, must be valid
See also
device_T_camera().

◆ setPixelImage() [1/2]

virtual bool Ocean::Media::PixelImage::setPixelImage ( const Frame frame,
SharedAnyCamera  anyCamera = nullptr 
)
virtual

Sets or changes the explicit frame of this pixel image.

Beware: The frame will not be set if the medium is not started, further the frame should have a valid timestamp.

Parameters
frameThe frame to be set, the frame data will be copied
anyCameraThe camera profile of the given frame, if known
Returns
True, if succeeded

◆ setPixelImage() [2/2]

virtual bool Ocean::Media::PixelImage::setPixelImage ( Frame &&  frame,
SharedAnyCamera  anyCamera = nullptr 
)
virtual

Sets or changes the explicit frame of this pixel image.

Beware: The frame will not be set if the medium is not started, further the frame should have a valid timestamp.

Parameters
frameThe frame to be set, the frame will be moved
anyCameraThe camera profile of the given frame, if known
Returns
True, if succeeded

◆ start()

bool Ocean::Media::PixelImage::start ( )
overridevirtual

Starts the medium.

See also
Medium::start().

Implements Ocean::Media::Medium.

◆ startTimestamp()

Timestamp Ocean::Media::PixelImage::startTimestamp ( ) const
overridevirtual

Returns the start timestamp.

See also
Medium::startTimestmap().

Implements Ocean::Media::Medium.

◆ stop()

bool Ocean::Media::PixelImage::stop ( )
overridevirtual

Stops the medium.

See also
Medium::stop().

Implements Ocean::Media::Medium.

◆ stopTimestamp()

Timestamp Ocean::Media::PixelImage::stopTimestamp ( ) const
overridevirtual

Returns the stop timestamp.

See also
Medium::stopTimestamp().

Implements Ocean::Media::Medium.

Friends And Related Function Documentation

◆ Manager

friend class Manager
friend

Field Documentation

◆ device_T_camera_

HomogenousMatrixD4 Ocean::Media::PixelImage::device_T_camera_
protected

The transformation between camera and device.

◆ isStarted_

bool Ocean::Media::PixelImage::isStarted_
protected

Determining whether this image is 'started' and holds valid image data.

◆ pauseTimestamp_

Timestamp Ocean::Media::PixelImage::pauseTimestamp_
protected

Pause timestamp.

◆ startTimestamp_

Timestamp Ocean::Media::PixelImage::startTimestamp_
protected

Start timestamp.

◆ stopTimestamp_

Timestamp Ocean::Media::PixelImage::stopTimestamp_
protected

Stop timestamp.


The documentation for this class was generated from the following file: