Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
dai::ImgFrame Class Reference

#include <ImgFrame.hpp>

Inheritance diagram for dai::ImgFrame:
Inheritance graph
[legend]

Classes

struct  dependent_false
 

Public Types

using CameraSettings = RawImgFrame::CameraSettings
 
using Specs = RawImgFrame::Specs
 
using Type = RawImgFrame::Type
 

Public Member Functions

unsigned int getCategory () const
 
int getColorTemperature () const
 
template<typename... T>
void getCvFrame (T...)
 
std::chrono::microseconds getExposureTime () const
 
template<typename... T>
void getFrame (T...)
 
unsigned int getHeight () const
 
unsigned int getInstanceNum () const
 
int getLensPosition () const
 
float getLensPositionRaw () const
 
int getSensitivity () const
 
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestamp () const
 
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestamp (CameraExposureOffset offset) const
 
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestampDevice () const
 
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestampDevice (CameraExposureOffset offset) const
 
Type getType () const
 
unsigned int getWidth () const
 
 ImgFrame ()
 
 ImgFrame (std::shared_ptr< RawImgFrame > ptr)
 
ImgFramesetCategory (unsigned int category)
 
template<typename... T>
ImgFramesetFrame (T...)
 
ImgFramesetHeight (unsigned int height)
 
ImgFramesetInstanceNum (unsigned int instance)
 
ImgFramesetSequenceNum (int64_t seq)
 
ImgFramesetSize (std::tuple< unsigned int, unsigned int > size)
 
ImgFramesetSize (unsigned int width, unsigned int height)
 
ImgFramesetTimestamp (std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > timestamp)
 
ImgFramesetTimestampDevice (std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > timestamp)
 
ImgFramesetType (Type type)
 
ImgFramesetWidth (unsigned int width)
 
virtual ~ImgFrame ()=default
 
- Public Member Functions inherited from dai::Buffer
 Buffer ()
 Creates Buffer message. More...
 
 Buffer (std::shared_ptr< dai::RawBuffer > ptr)
 
std::vector< std::uint8_t > & getData () const
 Get non-owning reference to internal buffer. More...
 
int64_t getSequenceNum () const
 
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestamp () const
 
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestampDevice () const
 
void setData (const std::vector< std::uint8_t > &data)
 
void setData (std::vector< std::uint8_t > &&data)
 
BuffersetSequenceNum (int64_t sequenceNum)
 
BuffersetTimestamp (std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > timestamp)
 
BuffersetTimestampDevice (std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > timestamp)
 
virtual ~Buffer ()=default
 
- Public Member Functions inherited from dai::ADatatype
 ADatatype (std::shared_ptr< RawBuffer > r)
 
std::shared_ptr< RawBuffergetRaw () const
 
virtual ~ADatatype ()=default
 

Private Member Functions

std::shared_ptr< RawBufferserialize () const override
 

Private Attributes

RawImgFrameimg
 

Additional Inherited Members

- Protected Attributes inherited from dai::ADatatype
std::shared_ptr< RawBufferraw
 

Detailed Description

ImgFrame message. Carries image data and metadata.

Definition at line 25 of file ImgFrame.hpp.

Member Typedef Documentation

◆ CameraSettings

Definition at line 33 of file ImgFrame.hpp.

◆ Specs

Definition at line 32 of file ImgFrame.hpp.

◆ Type

Definition at line 31 of file ImgFrame.hpp.

Constructor & Destructor Documentation

◆ ImgFrame() [1/2]

dai::ImgFrame::ImgFrame ( )

Construct ImgFrame message. Timestamp is set to now

Definition at line 11 of file pipeline/datatype/ImgFrame.cpp.

◆ ImgFrame() [2/2]

dai::ImgFrame::ImgFrame ( std::shared_ptr< RawImgFrame ptr)
explicit

Definition at line 15 of file pipeline/datatype/ImgFrame.cpp.

◆ ~ImgFrame()

virtual dai::ImgFrame::~ImgFrame ( )
virtualdefault

Member Function Documentation

◆ getCategory()

unsigned int dai::ImgFrame::getCategory ( ) const

Retrieves image category

Definition at line 50 of file pipeline/datatype/ImgFrame.cpp.

◆ getColorTemperature()

int dai::ImgFrame::getColorTemperature ( ) const

Retrieves white-balance color temperature of the light source, in kelvins

Definition at line 68 of file pipeline/datatype/ImgFrame.cpp.

◆ getCvFrame()

template<typename... T>
cv::Mat dai::ImgFrame::getCvFrame ( T...  )
inline

Definition at line 222 of file ImgFrame.hpp.

◆ getExposureTime()

std::chrono::microseconds dai::ImgFrame::getExposureTime ( ) const

Retrieves exposure time

Definition at line 62 of file pipeline/datatype/ImgFrame.cpp.

◆ getFrame()

template<typename... T>
cv::Mat dai::ImgFrame::getFrame ( T...  )
inline

Definition at line 218 of file ImgFrame.hpp.

◆ getHeight()

unsigned int dai::ImgFrame::getHeight ( ) const

Retrieves image height in pixels

Definition at line 56 of file pipeline/datatype/ImgFrame.cpp.

◆ getInstanceNum()

unsigned int dai::ImgFrame::getInstanceNum ( ) const

Retrieves instance number

Definition at line 47 of file pipeline/datatype/ImgFrame.cpp.

◆ getLensPosition()

int dai::ImgFrame::getLensPosition ( ) const

Retrieves lens position, range 0..255. Returns -1 if not available

Definition at line 71 of file pipeline/datatype/ImgFrame.cpp.

◆ getLensPositionRaw()

float dai::ImgFrame::getLensPositionRaw ( ) const

Retrieves lens position, range 0.0f..1.0f. Returns -1 if not available

Definition at line 75 of file pipeline/datatype/ImgFrame.cpp.

◆ getSensitivity()

int dai::ImgFrame::getSensitivity ( ) const

Retrieves sensitivity, as an ISO value

Definition at line 65 of file pipeline/datatype/ImgFrame.cpp.

◆ getTimestamp() [1/2]

std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > dai::Buffer::getTimestamp

Retrieves timestamp related to dai::Clock::now()

Definition at line 26 of file Buffer.cpp.

◆ getTimestamp() [2/2]

std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > dai::ImgFrame::getTimestamp ( CameraExposureOffset  offset) const

Retrieves image timestamp (at the specified offset of exposure) related to dai::Clock::now()

Definition at line 20 of file pipeline/datatype/ImgFrame.cpp.

◆ getTimestampDevice() [1/2]

std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > dai::Buffer::getTimestampDevice

Retrieves timestamp directly captured from device's monotonic clock, not synchronized to host time. Used mostly for debugging

Definition at line 30 of file Buffer.cpp.

◆ getTimestampDevice() [2/2]

std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > dai::ImgFrame::getTimestampDevice ( CameraExposureOffset  offset) const

Retrieves image timestamp (at the specified offset of exposure) directly captured from device's monotonic clock, not synchronized to host time. Used when monotonicity is required.

Definition at line 33 of file pipeline/datatype/ImgFrame.cpp.

◆ getType()

RawImgFrame::Type dai::ImgFrame::getType ( ) const

Retrieves image type

Definition at line 59 of file pipeline/datatype/ImgFrame.cpp.

◆ getWidth()

unsigned int dai::ImgFrame::getWidth ( ) const

Retrieves image width in pixels

Definition at line 53 of file pipeline/datatype/ImgFrame.cpp.

◆ serialize()

std::shared_ptr< RawBuffer > dai::ImgFrame::serialize ( ) const
overrideprivatevirtual

Reimplemented from dai::Buffer.

Definition at line 7 of file pipeline/datatype/ImgFrame.cpp.

◆ setCategory()

ImgFrame & dai::ImgFrame::setCategory ( unsigned int  category)
Parameters
categoryImage category

Definition at line 92 of file pipeline/datatype/ImgFrame.cpp.

◆ setFrame()

template<typename... T>
ImgFrame & dai::ImgFrame::setFrame ( T...  )
inline

Definition at line 213 of file ImgFrame.hpp.

◆ setHeight()

ImgFrame & dai::ImgFrame::setHeight ( unsigned int  height)

Specifies frame height

Parameters
heightframe height

Definition at line 105 of file pipeline/datatype/ImgFrame.cpp.

◆ setInstanceNum()

ImgFrame & dai::ImgFrame::setInstanceNum ( unsigned int  instance)

Instance number relates to the origin of the frame (which camera)

Parameters
instanceInstance number

Definition at line 88 of file pipeline/datatype/ImgFrame.cpp.

◆ setSequenceNum()

ImgFrame & dai::ImgFrame::setSequenceNum ( int64_t  seq)

Specifies sequence number

Parameters
seqSequence number

Definition at line 96 of file pipeline/datatype/ImgFrame.cpp.

◆ setSize() [1/2]

ImgFrame & dai::ImgFrame::setSize ( std::tuple< unsigned int, unsigned int >  size)

Specifies frame size

Parameters
sizeframe size

Definition at line 114 of file pipeline/datatype/ImgFrame.cpp.

◆ setSize() [2/2]

ImgFrame & dai::ImgFrame::setSize ( unsigned int  width,
unsigned int  height 
)

Specifies frame size

Parameters
heightframe height
widthframe width

Definition at line 109 of file pipeline/datatype/ImgFrame.cpp.

◆ setTimestamp()

ImgFrame & dai::ImgFrame::setTimestamp ( std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration >  timestamp)

Retrieves image timestamp related to dai::Clock::now()

Definition at line 80 of file pipeline/datatype/ImgFrame.cpp.

◆ setTimestampDevice()

ImgFrame & dai::ImgFrame::setTimestampDevice ( std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration >  timestamp)

Sets image timestamp related to dai::Clock::now()

Definition at line 84 of file pipeline/datatype/ImgFrame.cpp.

◆ setType()

ImgFrame & dai::ImgFrame::setType ( RawImgFrame::Type  type)

Specifies frame type, RGB, BGR, ...

Parameters
typeType of image

Definition at line 118 of file pipeline/datatype/ImgFrame.cpp.

◆ setWidth()

ImgFrame & dai::ImgFrame::setWidth ( unsigned int  width)

Specifies frame width

Parameters
widthframe width

Definition at line 99 of file pipeline/datatype/ImgFrame.cpp.

Member Data Documentation

◆ img

RawImgFrame& dai::ImgFrame::img
private

Definition at line 27 of file ImgFrame.hpp.


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


depthai
Author(s): Martin Peterlin
autogenerated on Sat Mar 22 2025 02:58:20