-
Notifications
You must be signed in to change notification settings - Fork 2
/
args.hpp
58 lines (52 loc) · 1.55 KB
/
args.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef ARGS_HPP
#define ARGS_HPP
#include <optional>
#include <string>
#include <utility>
#include <vector>
#include "config.h"
struct Args
{
std::string input_filename; // - for stdin
std::string output_filename; // - for stdout
std::string font_name; // use fontconfig to find, freetype to open
float font_size; // font size requested, in points
std::optional<int> rows; // output rows
std::optional<int> cols; // output cols
unsigned char bg; // BG color value
bool invert; // invert colors
bool display; // display the image
enum class Color {NONE, ANSI4, ANSI8, ANSI24} color;
enum class Disp_char {HALF_BLOCK, SPACE, ASCII} disp_char;
enum class Force_file
{
detect, // detect filetype by header
pcx,
tga,
#ifdef SVG_FOUND
svg,
#endif
#ifdef XPM_FOUND
xpm,
#endif
#ifdef ZLIB_FOUND
mcmap,
pkmn_gen1,
pkmn_gen2,
#endif
aoc_2019_sif,
} force_file { Force_file::detect };
std::optional<std::pair<std::string, std::string>> convert_filename;
std::optional<unsigned int> image_no;
std::optional<unsigned int> frame_no;
bool get_image_count;
bool get_frame_count;
bool animate;
bool loop_animation;
float animation_frame_delay;
std::vector<std::string> extra_args;
std::string help_text;
};
[[nodiscard]] std::optional<Args> parse_args(int argc, char * argv[]);
int get_screen_cols();
#endif // ARGS_HPP