-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanimation.h
53 lines (45 loc) · 1.04 KB
/
animation.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**
* @file animation.h
*
* Defintion for a class that encapsulates creating animated images from a
* set of PNG object frames.
*
* @author Aria Buckles
* @date Fall 2011
*/
#ifndef _ANIMATION_H_
#define _ANIMATION_H_
#include <string>
#include <vector>
#include "cs221util/PNG.h"
using namespace std;
using namespace cs221util;
/**
* Animation class---used to create animated images from a sequence of PNG
* objects as frames of the animation.
*
* @author Aria Buckles
* @date Fall 2011
*/
class animation
{
public:
/**
* Adds a frame to the animation.
*
* @param img The image to be added.
*/
void addFrame(const PNG &img);
/**
* Writes the animation to the file name specified.
*
* @param filename The name of the file to be written to.
*/
PNG write(const std::string &filename);
private:
std::vector<PNG> frames;
template <typename T> string to_string(const T &value);
string getString(int i, int padToSameLengthAs);
bool exists(const string &path);
};
#endif