#ifndef IOMANIP_H_ #define IOMANIP_H_ #include namespace sc { namespace io { bool should_color(const std::ostream& out); bool isatty_ostream(const std::ostream& out); std::ostream& hide_cursor(std::ostream& out); std::ostream& show_cursor(std::ostream& out); std::ostream& clear_screen(std::ostream& out); std::ostream& reset(std::ostream& out); std::ostream& bold(std::ostream& out); std::ostream& italic(std::ostream& out); std::ostream& underline(std::ostream& out); std::ostream& overline(std::ostream& out); std::ostream& strikethru(std::ostream& out); std::ostream& blinkslow(std::ostream& out); std::ostream& blinkfast(std::ostream& out); std::ostream& reverse(std::ostream& out); std::ostream& blackf(std::ostream& out); std::ostream& redf(std::ostream& out); std::ostream& greenf(std::ostream& out); std::ostream& yellowf(std::ostream& out); std::ostream& bluef(std::ostream& out); std::ostream& magentaf(std::ostream& out); std::ostream& cyanf(std::ostream& out); std::ostream& whitef(std::ostream& out); std::ostream& defaultf(std::ostream& out); std::ostream& blackb(std::ostream& out); std::ostream& redb(std::ostream& out); std::ostream& greenb(std::ostream& out); std::ostream& yellowb(std::ostream& out); std::ostream& blueb(std::ostream& out); std::ostream& magentab(std::ostream& out); std::ostream& cyanb(std::ostream& out); std::ostream& whiteb(std::ostream& out); std::ostream& defaultb(std::ostream& out); struct grayf { int _val; grayf(int val); }; struct grayb { int _val; grayb(int val); }; struct rgbf { int _r; // 0 .. 5 int _g; // 0 .. 5 int _b; // 0 .. 5 rgbf(int r, int g, int b); }; struct rgbb { int _r; // 0 .. 5 int _g; // 0 .. 5 int _b; // 0 .. 5 rgbb(int r, int g, int b); }; std::ostream& operator<<(std::ostream& out, const grayf& obj); std::ostream& operator<<(std::ostream& out, const grayb& obj); std::ostream& operator<<(std::ostream& out, const rgbf& obj); std::ostream& operator<<(std::ostream& out, const rgbb& obj); struct trgb { double _r; // 0.0 .. 1.0 double _g; // 0.0 .. 1.0 double _b; // 0.0 .. 1.0 trgb(double r, double g, double b); operator rgbf(); }; const trgb black {0.0, 0.0, 0.0}; const trgb red {1.0, 0.0, 0.0}; const trgb green {0.0, 1.0, 0.0}; const trgb yellow {1.0, 1.0, 0.0}; const trgb blue {0.0, 0.0, 1.0}; const trgb magenta {1.0, 0.0, 1.0}; const trgb cyan {0.0, 1.0, 1.0}; const trgb white {1.0, 1.0, 1.0}; struct truecolorf { int _r; // 0 .. 255 int _g; // 0 .. 255 int _b; // 0 .. 255 truecolorf(int r, int g, int b); }; struct truecolorb { int _r; // 0 .. 255 int _g; // 0 .. 255 int _b; // 0 .. 255 truecolorb(int r, int g, int b); }; std::ostream& operator<<(std::ostream& out, const truecolorf& obj); std::ostream& operator<<(std::ostream& out, const truecolorb& obj); } } #endif // IOMANIP_H_