Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::TemporalVolumeLoader Class Referenceabstract

Abstract interface for lazily loading the individual time steps (frames) of a TemporalVolume. More...

#include <inviwo/core/datastructures/volume/temporalvolume.h>

+ Inheritance diagram for inviwo::TemporalVolumeLoader:

Public Member Functions

virtual std::shared_ptr< Volume > load (size_t index, std::shared_ptr< Volume > reuse, std::stop_token stop) const =0
 
TemporalVolumeLoader & operator= (const TemporalVolumeLoader &)=default
 
TemporalVolumeLoader & operator= (TemporalVolumeLoader &&)=default
 
virtual VolumeConfig prototype () const =0
 
virtual size_t size () const =0
 Total number of frames.
 
 TemporalVolumeLoader (const TemporalVolumeLoader &)=default
 
 TemporalVolumeLoader (TemporalVolumeLoader &&)=default
 
virtual Seconds time (size_t index) const =0
 

Detailed Description

Abstract interface for lazily loading the individual time steps (frames) of a TemporalVolume.

A TemporalVolumeLoader decouples the storage format from the time axis and cache management of TemporalVolume. Implementations are responsible only for loading a single frame by index and for providing the time axis and a metadata-only prototype VolumeConfig.

Note
Implementations of load() must be thread-safe since it may be called concurrently from a background thread pool. prototype() must be cheap and must not load any voxel data.
See also
TemporalVolume

Member Function Documentation

◆ load()

virtual std::shared_ptr< Volume > inviwo::TemporalVolumeLoader::load ( size_t index,
std::shared_ptr< Volume > reuse,
std::stop_token stop ) const
pure virtual

Load the volume at the given index. May be called from a background thread, hence implementations must be re-entrant and thread-safe.

Parameters
reusean optional volume whose storage may be reused to avoid reallocation. It may be null and must be ignored if its format or dimensions do not match the frame.
stopcancellation token. Implementations should poll stop.stop_requested() at natural checkpoints and return nullptr as soon as a stop is requested. A partially written reuse volume is discarded by the caller.
Returns
the loaded volume, or nullptr if the load was cancelled.

Implemented in inviwo::ProceduralLoader, inviwo::FileSequenceLoader, and inviwo::hdf5::HDF5TemporalVolumeLoader.

◆ prototype()

virtual VolumeConfig inviwo::TemporalVolumeLoader::prototype ( ) const
pure virtual

A prototype VolumeConfig describing dimensions, format, basis, dataMap, and axes — but no voxel data. Used by downstream consumers that need metadata without triggering a load.

Implemented in inviwo::ProceduralLoader, inviwo::FileSequenceLoader, and inviwo::hdf5::HDF5TemporalVolumeLoader.

◆ size()

virtual size_t inviwo::TemporalVolumeLoader::size ( ) const
pure virtual

◆ time()

virtual Seconds inviwo::TemporalVolumeLoader::time ( size_t index) const
pure virtual

Physical time value for frame index. The values are expected to be sorted in ascending order.

Implemented in inviwo::ProceduralLoader, inviwo::FileSequenceLoader, and inviwo::hdf5::HDF5TemporalVolumeLoader.


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