-
Notifications
You must be signed in to change notification settings - Fork 3
/
colortable.h
41 lines (37 loc) · 1 KB
/
colortable.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
#ifndef COLORTABLE_H
#define COLORTABLE_H
#include <QString>
#include <QFile>
#include <QTextStream>
#include "stats.h"
#define UNDEFINED 0x00
#define WHITE 0x01
#define GREEN 0x02
#define BLUE 0x04
#define YELLOW 0x08
#define ORANGE 0x10
#define PINK 0x20
#define NAVY 0x40
class ColorTable
{
public:
enum Colors {Orange, Blue, Yellow, Green, White, Pink, Navy, Black};
ColorTable();
unsigned*** getTable() {return table; }
void read(QString filename);
void readOld(QString filename);
void writeNewFormat(QString filename);
int tableIndex(int high7, int mid7, int low7);
unsigned index(int y, int u, int v);
Stats** colorStats();
bool isEnabled() {return enabled;}
int getUpdatedColor(int y, int u, int v);
void setColor(int y, int u, int v, unsigned col);
void unSetColor(int y, int u, int v, unsigned col);
private:
static const int mainColors = 5;
int** colormap;
unsigned*** table;
bool enabled;
};
#endif // COLORTABLE_H