-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanimationframe.h
42 lines (38 loc) · 1.08 KB
/
animationframe.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
#ifndef ANIMATIONFRAME_H
#define ANIMATIONFRAME_H
#include <QObject>
#include <QImage>
#include <QTableWidgetItem>
/**
* @brief The AnimationFrame class describes a single frame in an animation.
*/
class AnimationFrame : public QObject
{
Q_OBJECT
public:
explicit AnimationFrame(int width = 640, int height = 480, QObject *parent = nullptr);
explicit AnimationFrame(const AnimationFrame &frame, QObject *parent = nullptr);
AnimationFrame &operator =(const AnimationFrame &frame);
/**
* @brief getIsBlank
* @return true if the frame is blank, false otherwise.
*/
bool getIsBlank();
void resize(const QSize newSize);
/**
* @brief Call update after changes are made to the frame's underlying image
* in order to set its state to modified
*/
void update();
QImage image;
QTableWidgetItem tableWidget;
int getHeight() const;
int getWidth() const;
void clear();
bool saveTo(QString path, const char *format = nullptr);
private:
bool blank = true;
int height;
int width;
};
#endif // ANIMATIONFRAME_H