You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
724 B
32 lines
724 B
4 days ago
|
#include <fmt/core.h>
|
||
|
#include <filesystem>
|
||
|
#include "panel.hpp"
|
||
|
#include "color.hpp"
|
||
|
#include "render.hpp"
|
||
|
#include "dbc.hpp"
|
||
|
#include <SFML/Graphics/Image.hpp>
|
||
|
|
||
|
using namespace fmt;
|
||
|
using namespace std;
|
||
|
|
||
|
int main(int argc, char *argv[]) {
|
||
|
dbc::check(argc == 2, "USAGE: img2ansi <image_file>");
|
||
|
|
||
|
string image_file(argv[1]);
|
||
|
|
||
|
println("LOADING IMAGE: {}", image_file);
|
||
|
|
||
|
// load the image from argv
|
||
|
sf::Image image;
|
||
|
image.loadFromFile(image_file);
|
||
|
|
||
|
// create a grid panel to hold the cells
|
||
|
// divide the image into cells
|
||
|
// for each cell:
|
||
|
// get the color
|
||
|
// calculate value
|
||
|
// find character that's closest
|
||
|
// write to panel/canvas with ftxui
|
||
|
// display in sfml window with renderer
|
||
|
}
|