34 #include <boost/rational.hpp> 36 using boost::rational_cast;
50 return globalDefaultGrid;
75 , quantiser_(quantisation_to_use)
85 : origin_(referencePoint)
86 , raster_(__ensure_nonzero(frames_per_second.duration()))
90 : origin_(referencePoint)
91 , raster_(__ensure_nonzero(frame_duration))
174 TimeVar timePoint = gt + origin_;
175 timePoint += gridOffset *
Offset(raster_);
182 LUMIERA_ERROR_DEFINE (UNKNOWN_GRID,
"referring to an undefined grid or scale in value quantisation");
a mutable time value, behaving like a plain number, allowing copy and re-accessing ...
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 ...
Common functions for handling of time values.
Framerate specified as frames per second.
int64_t lumiera_quantise_frames(gavl_time_t time, gavl_time_t origin, gavl_time_t grid)
Quantise the given time into a fixed grid, relative to the origin.
virtual ~Grid()
this is an Interface
Implementation namespace for support and library code.
QuTime(TimeValue raw, Symbol gridID)
build a quantised time value, referring the time grid by-name.
Lumiera's internal time value datatype.
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.
PQuant getDefaultGridFallback()
TimeValue gridLocal(TimeValue const &) const
transform into the local time scale grid aligned.
boost::rational< int64_t > FSecs
rational representation of fractional seconds
gavl_time_t lumiera_quantise_time(gavl_time_t time, gavl_time_t origin, gavl_time_t grid)
Similar to lumiera_quantise_frames, but returns a grid aligned relative time.
FrameCnt gridPoint(TimeValue const &) const
grid quantisation (alignment).
gavl_time_t lumiera_time_of_gridpoint(int64_t nr, gavl_time_t origin, gavl_time_t grid)
Calculate time of a grid point (frame start)
Support library to represent grid-aligned time specifications This is part of Lumiera's time and time...
Library functions to support the formation of grid-aligned time values.
Offset measures a distance in time.
TimeValue timeOf(FrameCnt gridPoint) const
calculate time value of a grid interval (frame) start point
Duration is the internal Lumiera time metric.
int64_t FrameCnt
relative framecount or frame number.
a family of time value like entities and their relationships.
basic constant internal time value.
Simple stand-alone Quantiser implementation based on a constant sized gird.
#define LUMIERA_ERROR_DEFINE(err, msg)
Definition and initialisation of an error constant.