#include #include #include #include "testutils/framebuffers.h" #include "utils/formatters.h" // usage: paleteframebuffer int main(int argc, const char* argv[]) { if (argc < 2) { std::cerr << "usage: paleteframebuffer " << std::endl; exit(1); } std::string file {argv[1]}; uint16_t buffer[FRAMEBUFFER_NUM_PIXELS]; load_framebuffer_png(file, buffer); std::set colors; for (uint16_t& i : buffer) { colors.emplace(i); } std::vector colors_vector; for (const auto& c : colors) colors_vector.push_back(c); std::sort(colors_vector.begin(), colors_vector.end(), std::greater()); for (const auto color : colors_vector) { std::cout << hex(color) << std::endl; } return 0; }