forked from scientificRat/MultimediaProject1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImage.h
More file actions
55 lines (35 loc) · 1.06 KB
/
Image.h
File metadata and controls
55 lines (35 loc) · 1.06 KB
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
54
55
#ifndef ImageMat_H
#define ImageMat_H
#include <cstdint>
#include <string>
//This is a final class, no virtual funcs
class ImageMat {
public:
typedef std::uint8_t Byte;
enum Type {
BGR, YUV, YIQ, YCbCr, HSI, Gray
};
private:
uint32_t channels;
uint32_t width;
uint32_t height;
Type type;
Byte *rawData;
void doCopy(const ImageMat &ImageMat);
ImageMat();
public:
static ImageMat createFromBMP(const std::string &inputFileURI);
ImageMat(uint32_t width, uint32_t height, uint32_t channels, Type type = BGR);
ImageMat(const ImageMat &ImageMat);
ImageMat &operator=(const ImageMat &ImageMat);
ImageMat(ImageMat &&ImageMat);
ImageMat &operator=(ImageMat &&ImageMat);
void saveToBMP(const std::string &outputFileURI);
uint32_t getChannels() const { return channels; }
uint32_t getWidth() const { return width; }
uint32_t getHeight() const { return height; }
Type getType() const { return type; }
Byte *getRawData() const { return rawData; }
~ImageMat();
};
#endif //ImageMat_H