inLimbo
TUI Music Player that keeps you in Limbo.
 
Loading...
Searching...
No Matches
tiv Namespace Reference

Classes

struct  CharData
 Struct to represent a character to be drawn. More...
 
struct  size
 

Typedefs

typedef std::function< unsigned long(int, int)> GetPixelFunction
 

Functions

unsigned char get_channel (unsigned long rgb, int index)
 
CharData createCharData (GetPixelFunction get_pixel, int x0, int y0, int codepoint, int pattern)
 
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.
 
void printTermColor (std::ostream &os, const int &flags, int r, int g, int b)
 
int clamp_byte (int value)
 
double sqr (double n)
 
int best_index (int value, const int STEPS[], int count)
 
cimg_library::CImg< unsigned char > load_rgb_CImg (const char *const &filename)
 
void printCodepoint (std::ostream &os, int codepoint)
 
void printImage (const cimg_library::CImg< unsigned char > &image, const int &flags)
 
std::pair< int, int > get_windows_size ()
 

Variables

const int END_MARKER = 0
 
constexpr unsigned int BITMAPS []
 
constexpr int FLAG_FG = 1
 
constexpr int FLAG_BG = 2
 
constexpr int FLAG_MODE_256 = 4
 
constexpr int FLAG_24BIT = 8
 
constexpr int FLAG_NOOPT = 16
 
constexpr int FLAG_TELETEXT = 32
 
constexpr int COLOR_STEP_COUNT = 6
 
constexpr int COLOR_STEPS [COLOR_STEP_COUNT] = {0, 0x5f, 0x87, 0xaf, 0xd7, 0xff}
 
constexpr int GRAYSCALE_STEP_COUNT = 24
 
constexpr int GRAYSCALE_STEPS [GRAYSCALE_STEP_COUNT]
 

Typedef Documentation

◆ GetPixelFunction

typedef std::function<unsigned long(int, int)> tiv::GetPixelFunction

Function Documentation

◆ best_index()

int tiv::best_index ( int value,
const int STEPS[],
int count )

◆ clamp_byte()

int tiv::clamp_byte ( int value)

◆ createCharData()

CharData tiv::createCharData ( GetPixelFunction get_pixel,
int x0,
int y0,
int codepoint,
int pattern )

◆ findCharData()

CharData tiv::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.

Parameters
image
x0
y0
flags
Returns
CharData

◆ get_channel()

unsigned char tiv::get_channel ( unsigned long rgb,
int index )

◆ get_windows_size()

std::pair< int, int > tiv::get_windows_size ( )

◆ load_rgb_CImg()

cimg_library::CImg< unsigned char > tiv::load_rgb_CImg ( const char *const & filename)

◆ printCodepoint()

void tiv::printCodepoint ( std::ostream & os,
int codepoint )

◆ printImage()

void tiv::printImage ( const cimg_library::CImg< unsigned char > & image,
const int & flags )

◆ printTermColor()

void tiv::printTermColor ( std::ostream & os,
const int & flags,
int r,
int g,
int b )

◆ sqr()

double tiv::sqr ( double n)

Variable Documentation

◆ BITMAPS

unsigned int tiv::BITMAPS[]
constexpr

◆ COLOR_STEP_COUNT

int tiv::COLOR_STEP_COUNT = 6
constexpr

◆ COLOR_STEPS

int tiv::COLOR_STEPS[COLOR_STEP_COUNT] = {0, 0x5f, 0x87, 0xaf, 0xd7, 0xff}
constexpr

◆ END_MARKER

const int tiv::END_MARKER = 0

◆ FLAG_24BIT

int tiv::FLAG_24BIT = 8
constexpr

◆ FLAG_BG

int tiv::FLAG_BG = 2
constexpr

◆ FLAG_FG

int tiv::FLAG_FG = 1
constexpr

◆ FLAG_MODE_256

int tiv::FLAG_MODE_256 = 4
constexpr

◆ FLAG_NOOPT

int tiv::FLAG_NOOPT = 16
constexpr

◆ FLAG_TELETEXT

int tiv::FLAG_TELETEXT = 32
constexpr

◆ GRAYSCALE_STEP_COUNT

int tiv::GRAYSCALE_STEP_COUNT = 24
constexpr

◆ GRAYSCALE_STEPS

int tiv::GRAYSCALE_STEPS[GRAYSCALE_STEP_COUNT]
constexpr
Initial value:
= {
0x08, 0x12, 0x1c, 0x26, 0x30, 0x3a, 0x44, 0x4e, 0x58, 0x62, 0x6c, 0x76,
0x80, 0x8a, 0x94, 0x9e, 0xa8, 0xb2, 0xbc, 0xc6, 0xd0, 0xda, 0xe4, 0xee}