47 size(
unsigned int in_width,
unsigned int in_height)
49 explicit size(cimg_library::CImg<unsigned int> img)
55 double scale = std::min(container.
width /
static_cast<double>(
width),
77 0x08, 0x12, 0x1c, 0x26, 0x30, 0x3a, 0x44, 0x4e, 0x58, 0x62, 0x6c, 0x76,
78 0x80, 0x8a, 0x94, 0x9e, 0xa8, 0xb2, 0xbc, 0xc6, 0xd0, 0xda, 0xe4, 0xee};
85int best_index(
int value,
const int STEPS[],
int count);
96 std::array<int, 3>
fgColor = std::array<int, 3>{0, 0, 0};
97 std::array<int, 3>
bgColor = std::array<int, 3>{0, 0, 0};
104 int codepoint,
int pattern);
119cimg_library::CImg<unsigned char>
load_rgb_CImg(
const char *
const &filename);
121void printTermColor(std::ostream& os,
const int &flags,
int r,
int g,
int b);
125void printImage(
const cimg_library::CImg<unsigned char> &image,
const int &flags);
Definition tiv_lib.cpp:61
constexpr int FLAG_TELETEXT
Definition tiv_lib.h:67
void printTermColor(std::ostream &os, const int &flags, int r, int g, int b)
Definition tiv_lib.cpp:397
CharData findCharData(GetPixelFunction get_pixel, int x0, int y0, const int &flags)
Find the best character and colors for a 4x8 part of the image at the given position.
Definition tiv_lib.cpp:271
constexpr int FLAG_BG
Definition tiv_lib.h:63
constexpr int COLOR_STEP_COUNT
Definition tiv_lib.h:71
CharData createCharData(GetPixelFunction get_pixel, int x0, int y0, int codepoint, int pattern)
Definition tiv_lib.cpp:233
std::function< unsigned long(int, int)> GetPixelFunction
Definition tiv_lib.h:81
constexpr int COLOR_STEPS[COLOR_STEP_COUNT]
Definition tiv_lib.h:72
void printCodepoint(std::ostream &os, int codepoint)
Definition tiv_lib.cpp:467
int clamp_byte(int value)
Definition tiv_lib.cpp:434
int best_index(int value, const int STEPS[], int count)
Definition tiv_lib.cpp:440
double sqr(double n)
Definition tiv_lib.cpp:438
constexpr int FLAG_24BIT
Definition tiv_lib.h:65
void printImage(const cimg_library::CImg< unsigned char > &image, const int &flags)
Definition tiv_lib.cpp:487
constexpr int FLAG_MODE_256
Definition tiv_lib.h:64
cimg_library::CImg< unsigned char > load_rgb_CImg(const char *const &filename)
Definition tiv_lib.cpp:453
std::pair< int, int > get_windows_size()
Definition tiv_lib.cpp:516
constexpr int GRAYSCALE_STEPS[GRAYSCALE_STEP_COUNT]
Definition tiv_lib.h:76
constexpr int GRAYSCALE_STEP_COUNT
Definition tiv_lib.h:75
constexpr int FLAG_NOOPT
Definition tiv_lib.h:66
constexpr int FLAG_FG
Definition tiv_lib.h:62
Struct to represent a character to be drawn.
Definition tiv_lib.h:95
int codePoint
Definition tiv_lib.h:98
std::array< int, 3 > fgColor
Definition tiv_lib.h:96
std::array< int, 3 > bgColor
Definition tiv_lib.h:97
size scaled(double scale)
Definition tiv_lib.h:53
size(unsigned int in_width, unsigned int in_height)
Definition tiv_lib.h:47
size fitted_within(size container)
Definition tiv_lib.h:54
unsigned int height
Definition tiv_lib.h:52
unsigned int width
Definition tiv_lib.h:51
size(cimg_library::CImg< unsigned int > img)
Definition tiv_lib.h:49