ifw-ccf 5.0.2
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ifw::ccf::common::DataFrame Class Reference

Frame class used to store the data and metadata for one frames received from the camera. More...

#include <dataFrame.hpp>

Inheritance diagram for ifw::ccf::common::DataFrame:
ifw::ccf::Base

Public Member Functions

 DataFrame (const std::string &frame_id, const int16_t frame_q_nb)
 Get CFITSIO data type.
 
 DataFrame (const DataFrame &source)
 Copy constructor.
 
 DataFrame ()
 
 ~DataFrame ()
 
void Reset ()
 
const std::string & GetFrameId () const
 Return the frame ID allocated.
 
int16_t GetFrameQNb () const
 Return the frame queue number, when used in a queue.
 
void Store (const void *buffer, const uint32_t size, const double time, const int64_t cam_frame_count, const int64_t int_frame_count, const int64_t sub_frame_count, const int64_t exp_nb_sub_frames, const ifw::fnd::datatype::DataType data_type, const int32_t offset_x, const int32_t offset_y, const int32_t width, const int32_t height, const int32_t depth=1)
 Store an image frame (or sub-frame) in the object.
 
void AddData (const void *buffer, const uint32_t size)
 Add a new chunk of data in the image buffer. Used to build up the image incrementally.
 
const void * GetBuffer () const
 Get read-only pointer to internal image buffer.
 
void * GetBufferReadWrite () const
 
uint32_t GetBufferSize () const
 Get the size of the internal buffer allocated, in bytes.
 
uint32_t GetDataSize () const
 Return the size in bytes of the image.
 
void ResetDataSize ()
 Reset the size of the image. This indicates that no image is stored in the object.
 
double GetDataSum () const
 Compute the data sum of all pixels.
 
double GetTime () const
 Get the current time stamp stored in the object.
 
int64_t GetCamFrameCount () const
 
int64_t GetIntFrameCount () const
 Internall frame counter, counting the frames receives since the last Start command (first frame == 1).
 
int64_t GetSubFrameCount () const
 Number of a sub-frame if the data of a frame is received in sub-frames (blocks) (first sub-frame == 1).
 
int64_t GetExpNbSubFrames () const
 Expected number of sub-frames if the data of a frame is received in sub-frames (blocks).
 
int32_t GetOffsetX () const
 Get horisontal offset of the ROI applied by the camera.
 
int32_t GetOffsetY () const
 Get vertical offset of the ROI applied by the camera.
 
int32_t GetWidth () const
 Get the width of the ROI applied by the camera.
 
int32_t GetHeight () const
 Get the height of the ROI applied by the camera.
 
int32_t GetDepth () const
 Get the number of frames if a three dimensional image is contained in the object.
 
ifw::fnd::datatype::DataType GetDataType () const
 
int32_t GetResolution () const
 Get the resolution (bytes/pixel) of the image currently stored in the object.
 
bool GetCompleted () const
 Return true if the image in the object is complete according to width/height/data type.
 
void SetCompleted ()
 Mark the frame as completed.
 
template<class TYPE >
void AddMetaData (const std::string &name, TYPE &value)
 
void RemoveMetaData (const std::string &name)
 Remove a given metadata parameter from the object.
 
template<class TYPE >
bool HasMetadata (const std::string &name, TYPE &value) const
 Get a parameter value from the configuration.
 
std::string ToString (const bool full=false) const
 Generate a representative (short) string representation (summary) of the object.
 
void SetConsumerCount (const uint8_t count)
 
uint8_t GetConsumerCount () const
 
void DecrementConsumerCount (const uint8_t decr=1)
 
void SetHandlingStartTime (const double time)
 Set the start time for handling handling the frame.
 
double GetHandlingStartTime () const
 Get the time for starting the handling of the frame.
 
double GetHandlingTime () const
 Get handling time (duration for handling the frame in the given context).
 
DataFrameoperator= (const DataFrame &source)
 
- Public Member Functions inherited from ifw::ccf::Base
 Base ()
 
 ~Base ()
 
const std::string & GetClassName () const
 Return the allocated name of the class.
 

Additional Inherited Members

- Static Public Member Functions inherited from ifw::ccf::Base
static ifw::ccf::mptk::ManagerMptk ()
 Return reference to internal MPTK instance (singleton).
 
- Protected Member Functions inherited from ifw::ccf::Base
void SetClassName (const std::string &class_name)
 Set the name of the class in question.
 

Detailed Description

Frame class used to store the data and metadata for one frames received from the camera.

Constructor & Destructor Documentation

◆ DataFrame() [1/3]

ifw::ccf::common::DataFrame::DataFrame ( const std::string & frame_id,
const int16_t frame_q_nb )

Get CFITSIO data type.

Constructor which accepts an ID and a instance number. Used when allocated in the internal queues.

◆ DataFrame() [2/3]

ifw::ccf::common::DataFrame::DataFrame ( const DataFrame & source)

Copy constructor.

◆ DataFrame() [3/3]

ifw::ccf::common::DataFrame::DataFrame ( )

◆ ~DataFrame()

ifw::ccf::common::DataFrame::~DataFrame ( )

Member Function Documentation

◆ AddData()

void ifw::ccf::common::DataFrame::AddData ( const void * buffer,
const uint32_t size )

Add a new chunk of data in the image buffer. Used to build up the image incrementally.

◆ AddMetaData()

template<class TYPE >
void ifw::ccf::common::DataFrame::AddMetaData ( const std::string & name,
TYPE & value )
inline

Add a metadata parameter in the object. This may later be written into the output data files or used in other ways by the Processing Recipes or Data Publishers.

◆ DecrementConsumerCount()

void ifw::ccf::common::DataFrame::DecrementConsumerCount ( const uint8_t decr = 1)

Decrement the consumer counter. Used internally by CCF.

◆ GetBuffer()

const void * ifw::ccf::common::DataFrame::GetBuffer ( ) const

Get read-only pointer to internal image buffer.

◆ GetBufferReadWrite()

void * ifw::ccf::common::DataFrame::GetBufferReadWrite ( ) const

Get read/write pointer to internal buffer. To be used with care. To be used with care as the data can be altered.

◆ GetBufferSize()

uint32_t ifw::ccf::common::DataFrame::GetBufferSize ( ) const

Get the size of the internal buffer allocated, in bytes.

◆ GetCamFrameCount()

int64_t ifw::ccf::common::DataFrame::GetCamFrameCount ( ) const

Counter indicating the number of the frame received from the camera, if provided by the camera (first frame == 1).

◆ GetCompleted()

bool ifw::ccf::common::DataFrame::GetCompleted ( ) const

Return true if the image in the object is complete according to width/height/data type.

◆ GetConsumerCount()

uint8_t ifw::ccf::common::DataFrame::GetConsumerCount ( ) const

Return the current consumer counter. Used internally by CCF.

◆ GetDataSize()

uint32_t ifw::ccf::common::DataFrame::GetDataSize ( ) const

Return the size in bytes of the image.

◆ GetDataSum()

double ifw::ccf::common::DataFrame::GetDataSum ( ) const

Compute the data sum of all pixels.

◆ GetDataType()

ifw::fnd::datatype::DataType ifw::ccf::common::DataFrame::GetDataType ( ) const

Get the type of the image pixels currently stored in the object. The types defined by the FITS specification is used.

◆ GetDepth()

int32_t ifw::ccf::common::DataFrame::GetDepth ( ) const

Get the number of frames if a three dimensional image is contained in the object.

◆ GetExpNbSubFrames()

int64_t ifw::ccf::common::DataFrame::GetExpNbSubFrames ( ) const

Expected number of sub-frames if the data of a frame is received in sub-frames (blocks).

◆ GetFrameId()

const std::string & ifw::ccf::common::DataFrame::GetFrameId ( ) const

Return the frame ID allocated.

◆ GetFrameQNb()

int16_t ifw::ccf::common::DataFrame::GetFrameQNb ( ) const

Return the frame queue number, when used in a queue.

◆ GetHandlingStartTime()

double ifw::ccf::common::DataFrame::GetHandlingStartTime ( ) const

Get the time for starting the handling of the frame.

◆ GetHandlingTime()

double ifw::ccf::common::DataFrame::GetHandlingTime ( ) const

Get handling time (duration for handling the frame in the given context).

◆ GetHeight()

int32_t ifw::ccf::common::DataFrame::GetHeight ( ) const

Get the height of the ROI applied by the camera.

◆ GetIntFrameCount()

int64_t ifw::ccf::common::DataFrame::GetIntFrameCount ( ) const

Internall frame counter, counting the frames receives since the last Start command (first frame == 1).

◆ GetOffsetX()

int32_t ifw::ccf::common::DataFrame::GetOffsetX ( ) const

Get horisontal offset of the ROI applied by the camera.

◆ GetOffsetY()

int32_t ifw::ccf::common::DataFrame::GetOffsetY ( ) const

Get vertical offset of the ROI applied by the camera.

◆ GetResolution()

int32_t ifw::ccf::common::DataFrame::GetResolution ( ) const

Get the resolution (bytes/pixel) of the image currently stored in the object.

◆ GetSubFrameCount()

int64_t ifw::ccf::common::DataFrame::GetSubFrameCount ( ) const

Number of a sub-frame if the data of a frame is received in sub-frames (blocks) (first sub-frame == 1).

◆ GetTime()

double ifw::ccf::common::DataFrame::GetTime ( ) const

Get the current time stamp stored in the object.

◆ GetWidth()

int32_t ifw::ccf::common::DataFrame::GetWidth ( ) const

Get the width of the ROI applied by the camera.

◆ HasMetadata()

template<class TYPE >
bool ifw::ccf::common::DataFrame::HasMetadata ( const std::string & name,
TYPE & value ) const
inline

Get a parameter value from the configuration.

◆ operator=()

DataFrame & ifw::ccf::common::DataFrame::operator= ( const DataFrame & source)

◆ RemoveMetaData()

void ifw::ccf::common::DataFrame::RemoveMetaData ( const std::string & name)

Remove a given metadata parameter from the object.

◆ Reset()

void ifw::ccf::common::DataFrame::Reset ( )

◆ ResetDataSize()

void ifw::ccf::common::DataFrame::ResetDataSize ( )

Reset the size of the image. This indicates that no image is stored in the object.

◆ SetCompleted()

void ifw::ccf::common::DataFrame::SetCompleted ( )

Mark the frame as completed.

◆ SetConsumerCount()

void ifw::ccf::common::DataFrame::SetConsumerCount ( const uint8_t count)

Set the internal counter indicating how many consumers are expected to use the data. Used internally by CCF.

◆ SetHandlingStartTime()

void ifw::ccf::common::DataFrame::SetHandlingStartTime ( const double time)

Set the start time for handling handling the frame.

◆ Store()

void ifw::ccf::common::DataFrame::Store ( const void * buffer,
const uint32_t size,
const double time,
const int64_t cam_frame_count,
const int64_t int_frame_count,
const int64_t sub_frame_count,
const int64_t exp_nb_sub_frames,
const ifw::fnd::datatype::DataType data_type,
const int32_t offset_x,
const int32_t offset_y,
const int32_t width,
const int32_t height,
const int32_t depth = 1 )

Store an image frame (or sub-frame) in the object.

Parameters
bufferBuffer containing the data to be stored (copied) in the object.
sizeSize in bytes of the frame to store.
timeTimestamp for the image frame.
cam_frame_countFrame counter as received from the camera (entire frames, first=1).
int_frame_countInternal frame counter (may differ if frames skipped, first=1).
sub_frame_countSub-frame counter, if image split into multiple blocks (first = 1).
exp_nb_sub_framesExpected number of sub-frames (blocks) to be received.
data_typeData type.
offset_xOffset in X (first pixel=1).
offset_yOffset in Y (first pixel=1).
widthWidth of image in pixels.
heightHeight of image in pixels.
depthDepth of image if consisting of multiple layers.

◆ ToString()

std::string ifw::ccf::common::DataFrame::ToString ( const bool full = false) const

Generate a representative (short) string representation (summary) of the object.


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