Frame.h
Go to the documentation of this file.
1 /*************************************************************************
2 > File Name: Frame.h
3 > Project Name: CubbyFlow
4 > Author: Chan-Ho Chris Ohk
5 > Purpose: Representation of an animation frame.
6 > Created Time: 2017/04/19
7 > Copyright (c) 2018, Chan-Ho Chris Ohk
8 *************************************************************************/
9 #ifndef CUBBYFLOW_FRAME_H
10 #define CUBBYFLOW_FRAME_H
11 
12 namespace CubbyFlow
13 {
20  struct Frame final
21  {
23  int index = 0;
24 
26  double timeIntervalInSeconds = 1.0 / 60.0;
27 
29  Frame();
30 
32  Frame(int newIndex, double newTimeIntervalInSeconds);
33 
35  double TimeInSeconds() const;
36 
38  void Advance();
39 
42  void Advance(int delta);
43 
45  Frame& operator++();
46 
48  Frame operator++(int);
49  };
50 }
51 
52 #endif
Frame & operator++()
Advances single frame (prefix).
int index
Frame index.
Definition: Frame.h:23
void Advance()
Advances single frame.
Definition: pybind11Utils.h:24
double TimeInSeconds() const
Returns the elapsed time in seconds.
double timeIntervalInSeconds
Time interval in seconds between two adjacent frames.
Definition: Frame.h:26
Representation of an animation frame.
Definition: Frame.h:20
Frame()
Constructs Frame instance with 1/60 seconds time interval.