![]() |
Lumiera 0.pre.04
»edit your freedom«
|
#include "lib/time/quantiser.hpp"
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.
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. | |
| FixedFrameQuantiser (Duration const &frame_duration, TimeValue referencePoint=TimeValue(0)) | |
| FrameCnt | gridPoint (TimeValue const &) const override |
| grid quantisation (alignment). | |
| Offset | gridLocal (TimeValue const &) const override |
| transform into the local time scale grid aligned. | |
| TimeValue | timeOf (FrameCnt gridPoint) const override |
| calculate time value of a grid interval (frame) start point | |
| TimeValue | timeOf (FSecs, int=0) const override |
| calculate time coordinates of a time spec relative to this quantised time scale | |
Public Member Functions inherited from Quantiser | |
| template<class FMT > | |
| bool | supports () const |
| 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. | |
Public Member Functions inherited from Grid | |
| virtual | ~Grid () |
| this is an Interface | |
Static Private Member Functions | |
| static int64_t | grid_aligned (TimeValue const &, TimeValue const &) |
| Quantise the given time into a fixed grid, relative to the origin. | |
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. | |
Protected Member Functions inherited from Quantiser | |
| Quantiser () | |
Protected Attributes inherited from Quantiser | |
| format::Supported | supportedFormats_ |
| 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 131 of file quantiser.cpp.
| FixedFrameQuantiser | ( | Duration const & | frame_duration, |
| TimeValue | referencePoint = TimeValue(0) |
||
| ) |
Definition at line 136 of file quantiser.cpp.
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.
Implements Quantiser.
Definition at line 173 of file quantiser.cpp.
References FixedFrameQuantiser::grid_aligned(), FixedFrameQuantiser::origin_, and FixedFrameQuantiser::raster_.
Referenced by QuantiserBasics_test::coverQuantisationCornerCases(), and FixedFrameQuantiser::timeOf().
Here is the call graph for this function:
Here is the caller graph for this function:transform into the local time scale grid aligned.
The actual calculation first determines the number of the grid interval containing the given rawTime, followed by multiplying this interval number with the grid spacing.
Implements Quantiser.
Definition at line 192 of file quantiser.cpp.
References FixedFrameQuantiser::grid_aligned(), FixedFrameQuantiser::origin_, and FixedFrameQuantiser::raster_.
Referenced by QuantiserBasics_test::checkSimpleQuantisation(), QuantiserBasics_test::coverQuantisationCornerCases(), and QuantiserBasics_test::TestQuant::quant().
Here is the call graph for this function:
Here is the caller graph for this function:calculate time value of a grid interval (frame) start point
| gridPoint | index number of the grid point (0 is at origin) |
Implements Quantiser.
Definition at line 206 of file quantiser.cpp.
References FixedFrameQuantiser::gridPoint(), FixedFrameQuantiser::origin_, and FixedFrameQuantiser::raster_.
Referenced by QuantiserBasics_test::coverQuantisationCornerCases().
Here is the call graph for this function:
Here is the caller graph for this function:calculate time coordinates of a time spec relative to this quantised time scale
| gridTime | seconds relative to the origin of this scale |
| gridOffset | additional offset in grid intervals (frames) |
Implements Quantiser.
Definition at line 220 of file quantiser.cpp.
References FixedFrameQuantiser::origin_, and FixedFrameQuantiser::raster_.
Quantise the given time into a fixed grid, relative to the origin.
The time grid used for quantisation is comprised of equally spaced intervals, rooted at the given origin. The interval starting with the origin is numbered as zero. Each interval includes its lower bound, but excludes its upper bound.
| grid | spacing of the grid intervals, measured in TimeValue::Scale (µ-ticks) |
Definition at line 86 of file quantiser.cpp.
References util::floordiv().
Referenced by FixedFrameQuantiser::gridLocal(), and FixedFrameQuantiser::gridPoint().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 138 of file quantiser.hpp.
Referenced by FixedFrameQuantiser::gridLocal(), FixedFrameQuantiser::gridPoint(), FixedFrameQuantiser::timeOf(), and FixedFrameQuantiser::timeOf().
|
private |
Definition at line 139 of file quantiser.hpp.
Referenced by FixedFrameQuantiser::gridLocal(), FixedFrameQuantiser::gridPoint(), FixedFrameQuantiser::timeOf(), and FixedFrameQuantiser::timeOf().
Inheritance diagram for FixedFrameQuantiser:
Collaboration diagram for FixedFrameQuantiser: