-
Notifications
You must be signed in to change notification settings - Fork 0
/
Pizza.h
35 lines (31 loc) · 796 Bytes
/
Pizza.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
#ifndef PIZZA_PIZZA
#define PIZZA_PIZZA
#include "BMP.h"
#include "Color.h"
#include "DefaultColorTable.h"
#include "DefaultGrayscaleTable.h"
#include "PizzaHeader.h"
#include <fstream>
#include <string>
#include <vector>
class BMP;
class Pizza {
public:
PizzaHeader m_header;
std::vector<Color> m_colorTable;
uint8_t **m_pixels;
int m_width;
int m_height;
public:
Pizza(int width, int height, int colorTable = 0);
Pizza(std::string name);
Pizza(BMP &bmp, int colorTable = 0, int isDitheringEnabled = 0,
int algType = 0);
void loadFromFile(std::string name);
void saveToFile(std::string name);
int getWidth() { return m_width; }
int getHeight() { return m_height; }
Color getPixel(int x, int y) { return m_colorTable[m_pixels[x][y]]; };
~Pizza();
};
#endif