Lumiera  0.pre.03
»edit your freedom«
FixedFrameQuantiser Class Reference

#include "lib/time/quantiser.hpp"

Description

Simple stand-alone Quantiser implementation based on a constant sized gird.

This is a self-contained quantiser implementation without any implicit referral to the Lumiera session. As such it is suited for simplified unit testing.

Warning
real Stage and Steam-Layer code should always fetch a quantiser from the Session, referring to a pre defined TimeGrid. Basically, the overall purpose of the time-quantisation framework is to enforce such a link to a distinct time scale and quantisation, so to prevent "wild and uncoordinated" rounding attempts.

Definition at line 135 of file quantiser.hpp.

Public Member Functions

 FixedFrameQuantiser (FrameRate const &frames_per_second, TimeValue referencePoint=TimeValue(0))
 Create a quantiser based on a fixed constant spaced grid, rooted at the reference point as origin of the scale. More...
 
 FixedFrameQuantiser (Duration const &frame_duration, TimeValue referencePoint=TimeValue(0))
 
TimeValue gridLocal (TimeValue const &) const
 transform into the local time scale grid aligned. More...
 
FrameCnt gridPoint (TimeValue const &) const
 grid quantisation (alignment). More...
 
TimeValue timeOf (FrameCnt gridPoint) const
 calculate time value of a grid interval (frame) start point More...
 
TimeValue timeOf (FSecs, int=0) const
 calculate time coordinates of a time spec relative to this quantised time scale More...
 
- Public Member Functions inherited from Quantiser
TimeValue materialise (TimeValue const &raw) const
 convenience shortcut: materialise a raw time value based on this grid or time axis, but returning a raw time value. More...
 
template<class FMT >
bool supports () const
 
- Public Member Functions inherited from Grid
virtual ~Grid ()
 this is an Interface
 

Private Attributes

Time origin_
 
Duration raster_
 

Additional Inherited Members

- Static Public Member Functions inherited from Quantiser
static PQuant retrieve (Symbol gridID)
 Access an existing grid definition or quantiser, known by the given symbolic ID. More...
 
- Protected Attributes inherited from Quantiser
format::Supported supportedFormats_
 

Constructor & Destructor Documentation

◆ FixedFrameQuantiser()

FixedFrameQuantiser ( FrameRate const &  frames_per_second,
TimeValue  referencePoint = TimeValue(0) 
)

Create a quantiser based on a fixed constant spaced grid, rooted at the reference point as origin of the scale.

Quantisation then means to determine the grid interval containing a given raw time value. Here, the grid interval number zero starts at the origin; each interval includes its lower bound and excludes its upper bound.

Definition at line 75 of file quantiser.cpp.

Member Function Documentation

◆ gridPoint()

FrameCnt gridPoint ( TimeValue const &  rawTime) const
virtual

grid quantisation (alignment).

Determine the next lower grid interval start point, using a simple constant spaced time grid defined by origin and framerate stored within this quantiser.

Warning
returned frame count might exceed the valid range when converting back into a TimeValue.
See also
lumiera_quantise_frames

Implements Quantiser.

Definition at line 117 of file quantiser.cpp.

References lumiera_quantise_frames().

Referenced by Quantiser::materialise().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gridLocal()

TimeValue gridLocal ( TimeValue const &  rawTime) const
virtual

transform into the local time scale grid aligned.

The actual calculation first determines the number of the grid interval containing the given rawTime, then followed by multiplying this interval number with the grid spacing.

Returns
time of the start point of the grid interval containing the rawTime, relative to the origin of the time scale used by this quantiser.
Warning
returned time values are limited by the valid range of lumiera::Time
See also
lumiera_quantise_time

Implements Quantiser.

Definition at line 136 of file quantiser.cpp.

References lumiera_quantise_time().

+ Here is the call graph for this function:

◆ timeOf() [1/2]

TimeValue timeOf ( FrameCnt  gridPoint) const
virtual

calculate time value of a grid interval (frame) start point

Returns
time point measured in Lumiera internal time
Warning
returned time values are limited by the valid range of lumiera::Time

Implements Quantiser.

Definition at line 148 of file quantiser.cpp.

References lumiera_time_of_gridpoint().

Referenced by Quantiser::materialise().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ timeOf() [2/2]

TimeValue timeOf ( FSecs  gridTime,
int  gridOffset = 0 
) const
virtual

calculate time coordinates of a time spec relative to this quantised time scale

Parameters
gridTimeseconds relative to the origin of this scale
gridOffsetadditional offset in grid intervals (frames)
Returns
time point measured in Lumiera internal time
Warning
returned time values are limited by the valid range of lumiera::Time

Implements Quantiser.

Definition at line 162 of file quantiser.cpp.

References LUMIERA_ERROR_DEFINE.

+ Inheritance diagram for FixedFrameQuantiser:
+ Collaboration diagram for FixedFrameQuantiser:

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