-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathImage.h
51 lines (44 loc) · 1.06 KB
/
Image.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
#ifndef IMAGE_H
#define IMAGE_H
#include"stdafx.h"
#include<iostream>
namespace img {
enum class FileExtension{
PNG,
JPG,
JPEG,
BMP
};
typedef struct Data {
std::string name;
sf::Texture img;
sf::Vector2u imgSize;
}Data;
class ImageFile : public Data {
private:
Data data;
sf::Sprite sprite;
sf::Vector2f point;
std::vector<Data> imgVec;
public:
ImageFile();
ImageFile(sf::Vector2f point);
ImageFile(std::string fileName, FileExtension fileEx, float x, float y);
ImageFile(std::string fileName, FileExtension fileEx, float x, float y, sf::RenderTarget* target);
~ImageFile();
void addImage(std::string fileName, FileExtension fileEx);
void clearImgVec();
void setSprite();
void setPoint(sf::Vector2f point);
sf::Vector2f getPoint();
std::string getImgName();
Data getData();
std::vector<Data> getImgVec();
sf::Sprite getSprite();
sf::Vector2u getImgSize();
void read(std::string fileName,FileExtension fileEx);
void draw(sf::RenderTarget* target);
void drawAll(sf::RenderTarget* target);
};
}
#endif //IMAGE_H