-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathYUVPixelSet.h
More file actions
30 lines (26 loc) · 817 Bytes
/
YUVPixelSet.h
File metadata and controls
30 lines (26 loc) · 817 Bytes
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
#ifndef YUVPIXELSET_H_INCLUDED
#define YUVPIXELSET_H_INCLUDED
#include <vector>
#include "YUVPixel.h"
using namespace std;
//TODO: Make destructor
namespace Compression{
class YUVPixelSet{
public:
YUVPixelSet(int width, int height):width(width), height(height){
image.reserve(width*height);
}
void addPixel(YUVPixel px){
image.push_back(px);
}
YUVPixel* getPixel(int ind){return &(image[ind]);}
YUVPixel* getPixel(int x, int y){return &(image[x * width + y]);}
int getHeight(){return height;}
int getWidth(){return width;}
int getSize(){return height * width;}
private:
vector<YUVPixel> image;
int width, height;
};
}
#endif