Skip to main content

VideoData

VideoData

#include <Video_Data.hpp>

Inherits from MediaData, ObserverData

Public Functions

Name
VideoData()
~VideoData() override
virtual MediaType getMediaType() const override
Get the media type of this instance.
virtual std::string GetFrameID(int frame_id) const override
int FindNearestSnapFrame(int frame_id) const
virtual int getFrameIndexFromNumber(int frame_id) override

Protected Functions

Name
virtual void doLoadMedia(std::string const & name) override
virtual void doLoadFrame(int frame_id) override

Additional inherited members

Public Types inherited from MediaData

Name
enum class MediaType { Video, Images, HDF5}
enum DisplayFormat { Gray, Color}
using MediaStorage::BitDepth BitDepth
using MediaStorage::ImageDataVariant DataStorage

Public Functions inherited from MediaData

Name
MediaData()
virtual ~MediaData()
std::string getFilename() const
void setFilename(std::string const & filename)
void setFormat(DisplayFormat format)
DisplayFormat getFormat() const
int getHeight() const
int getWidth() const
ImageSize getImageSize() const
void updateHeight(int height)
void updateWidth(int width)
int getTotalFrameCount() const
void setTotalFrameCount(int total_frame_count)
BitDepth getBitDepth() const
Get the current bit depth of the media data.
void setBitDepth(BitDepth depth)
Set the bit depth (can be used to override auto-detected depth).
bool is8Bit() const
Check if the media data is using 8-bit storage.
bool is32Bit() const
Check if the media data is using 32-bit float storage.
void LoadMedia(std::string const & name)
LoadMedia.
void LoadFrame(int frame_id)
LoadFrame.
std::vector< uint8_t > const & getRawData8(int frame_number)
Get raw data as uint8_t (for 8-bit data or converted from 32-bit).
std::vector< float > const & getRawData32(int frame_number)
Get raw data as float (for 32-bit data or converted from 8-bit).
std::vector< uint8_t > getProcessedData8(int frame_number)
Get processed data as uint8_t (for 8-bit data or converted from 32-bit).
std::vector< float > getProcessedData32(int frame_number)
Get processed data as float (for 32-bit data or converted from 8-bit).
DataStorage const & getRawDataVariant(int frame_number)
Get raw data as variant (native format).
DataStorage getProcessedDataVariant(int frame_number)
Get processed data as variant (native format).
std::vector< uint8_t > const & getRawData(int frame_number)
Legacy method - get raw data (defaults to 8-bit behavior for compatibility).
std::vector< uint8_t > getProcessedData(int frame_number)
Legacy method - get processed data (defaults to 8-bit behavior for compatibility).
void setRawData(MediaStorage::ImageData8 data)
Set raw data from uint8_t vector.
void setRawData(MediaStorage::ImageData32 data)
Set raw data from float vector (normalized to 0-255 range).
bool setImageProcessor(std::string const & processor_name)
Set the image processor backend (e.g., “opencv”, “simd”, etc.).
std::string getImageProcessorName() const
Get the current image processor backend name.
void addProcessingStep(std::string const & key, std::function< void(void *)> processor)
Add a processing step using the current processor.
void removeProcessingStep(std::string const & key)
Remove a processing step.
void clearProcessingSteps()
Clear all processing steps.
bool hasProcessingStep(std::string const & key) const
Check if a processing step exists.
size_t getProcessingStepCount() const
Get the number of processing steps.
void setTimeFrame(std::shared_ptr< TimeFrame > time_frame)
Set the time frame.
std::shared_ptr< TimeFrame > getTimeFrame() const

Public Classes inherited from ObserverData

Name
struct ObserverEntry
Entry in the observer map.

Public Types inherited from ObserverData

Name
using std::function< void()> ObserverCallback
Type alias for observer callback functions.
using int CallbackID
Type alias for callback identifiers.

Public Functions inherited from ObserverData

Name
ObserverData(std::string name =“UnnamedObservable”)
CallbackID addObserver(ObserverCallback callback, std::string name =“Anonymous”)
Register a new observer callback.
void notifyObservers()
Notify all registered observers.
void removeObserver(CallbackID id)
Remove a previously registered observer.

Public Functions Documentation

function VideoData

VideoData()

function ~VideoData

~VideoData() override

function getMediaType

inline virtual MediaType getMediaType() const override

Get the media type of this instance.

Return: The MediaType enum value

Reimplements: MediaData::getMediaType

function GetFrameID

virtual std::string GetFrameID(
    int frame_id
) const override

Reimplements: MediaData::GetFrameID

function FindNearestSnapFrame

int FindNearestSnapFrame(
    int frame_id
) const

Parameters:

  • frame_id

Return: Nearest keyframe to frame_id

When scrolling through large video files, it makes for much smoother scrolling for the slider to “snap” or seek only to key frames.

function getFrameIndexFromNumber

inline virtual int getFrameIndexFromNumber(
    int frame_id
) override

Reimplements: MediaData::getFrameIndexFromNumber

Protected Functions Documentation

function doLoadMedia

virtual void doLoadMedia(
    std::string const & name
) override

Reimplements: MediaData::doLoadMedia

function doLoadFrame

virtual void doLoadFrame(
    int frame_id
) override

Reimplements: MediaData::doLoadFrame


Updated on 2026-11-13 at 20:25:39 +0000