-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathColorTableAlgs.h
More file actions
30 lines (21 loc) · 879 Bytes
/
ColorTableAlgs.h
File metadata and controls
30 lines (21 loc) · 879 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 PIZZA_COLOR_ALGORITHMS
#define PIZZA_COLOR_ALGORITHMS
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <vector>
#include "Algs.h"
#include "BMP.h"
#include "Color.h"
int findClosestColorIndexFromTable(Color color, std::vector<Color> colorTable,
bool toGrayscale = 0);
void copyColorTableToVector(const Color *source,
std::vector<Color> &destination);
std::vector<Color> generate6BitColorTable(BMP &bmp);
std::vector<Color> sortColorsBySubcolor(std::vector<Color> &colors,
char subcolor);
char findBiggestRange(std::vector<Color> colors);
std::vector<Color> medianCut(std::vector<Color> colors, int depth,
int maxDepth = 6); // Default 64 colors
std::vector<Color> generate6BitColorTableMedianCut(BMP &bmp);
#endif