Frame

Frame

A single frame of a video stream. More…

#include <frametype.h>

Inherits from BaseDataType

Public Functions

Name
Frame()
Frame(const cv::Mat imgMat, const microseconds_t & t)
Frame(const cv::Mat & imgMat, const uint64_t & idx, const microseconds_t & t)
Frame(const uint64_t & idx)
cv::MatcopyMat() const
virtual ssize_tmemorySize() const override
Calculate the size of the data in memory.
virtual boolwriteToMemory(void * memory, ssize_t size =-1) const override
Write the data to a memory block.
virtual QByteArraytoBytes() const override
Serialize the data to a byte array.
FramefromMemory(const void * buffer, size_t size)

Public Attributes

Name
uint64_tindex
microseconds_ttime
cv::Matmat

Additional inherited members

Public Types inherited from BaseDataType

Name
enumTypeId { Unknown, ControlCommand, TableRow, Frame, FirmataControl, FirmataData, IntSignalBlock, FloatSignalBlock, Last}
The TypeId enum.

Public Functions inherited from BaseDataType

Name
QStringtypeIdToString(TypeId value)
QStringtypeIdToString(int value)
TypeIdtypeIdFromString(const QString & str)
virtual TypeIdtypeId() const =0

Detailed Description

struct Frame;

A single frame of a video stream.

Describes a single frame in a stream of frames that make up a complete video. Each frame is timestamped with the exact time of its acquisition.

Public Functions Documentation

function Frame

inline explicit Frame()

function Frame

inline explicit Frame(
    const cv::Mat imgMat,
    const microseconds_t & t
)

function Frame

inline explicit Frame(
    const cv::Mat & imgMat,
    const uint64_t & idx,
    const microseconds_t & t
)

function Frame

inline explicit Frame(
    const uint64_t & idx
)

function copyMat

inline cv::Mat copyMat() const

function memorySize

inline virtual ssize_t memorySize() const override

Calculate the size of the data in memory.

Reimplements: BaseDataType::memorySize

Quickly calculate the maximum size this data occupies in memory. This will be used to allocate appropriate shared memory blocks in advance. Return -1 if the size is unknown.

function writeToMemory

inline virtual bool writeToMemory(
    void * memory,
    ssize_t size =-1
) const override

Write the data to a memory block.

Reimplements: BaseDataType::writeToMemory

Write the data to a memory block. The required size of the block is given by the memorySize() method, but a larger size can be passed if needed.

Return true if the data was written successfully.

function toBytes

inline virtual QByteArray toBytes() const override

Serialize the data to a byte array.

Reimplements: BaseDataType::toBytes

Serialize the data to a byte array for local transmission.

function fromMemory

static inline Frame fromMemory(
    const void * buffer,
    size_t size
)

Public Attributes Documentation

variable index

uint64_t index;

variable time

microseconds_t time;

variable mat

cv::Mat mat;

Updated on 2024-11-06 at 17:10:28 +0000