Orbiter 2022
Combinatorial Objects
draw_bitmap_control.cpp
Go to the documentation of this file.
1/*
2 * draw_bitmap_control.cpp
3 *
4 * Created on: Mar 18, 2021
5 * Author: betten
6 */
7
8
9
10
11#include "foundations.h"
12
13using namespace std;
14
15
16namespace orbiter {
17namespace layer1_foundations {
18namespace graphics {
19
21{
23 //std::string input_csv_file_name;
24
26 //std::string secondary_input_csv_file_name;
27
28
30 M = NULL;
31 M2 = NULL;
32 m = 0;
33 n = 0;
34
36 part_width = 4;
37 //std::string part_row;
38 //std::string part_col;
39
41 box_width = 10;
43 bit_depth = 8;
44
45}
46
48{
49
50}
51
52
54 int argc, std::string *argv,
55 int verbose_level)
56{
57 int i;
58 int f_v = (verbose_level >= 1);
60
61 if (f_v) {
62 cout << "draw_bitmap_control::read_arguments" << endl;
63 }
64 for (i = 0; i < argc; i++) {
65
66 if (ST.stringcmp(argv[i], "-input_csv_file") == 0) {
68 input_csv_file_name.assign(argv[++i]);
69 if (f_v) {
70 cout << "-input_csv_file " << input_csv_file_name << endl;
71 }
72 }
73 else if (ST.stringcmp(argv[i], "-secondary_input_csv_file") == 0) {
75 secondary_input_csv_file_name.assign(argv[++i]);
76 if (f_v) {
77 cout << "-secondary_input_csv_file " << secondary_input_csv_file_name << endl;
78 }
79 }
80 else if (ST.stringcmp(argv[i], "-partition") == 0) {
82 part_width = ST.strtoi(argv[++i]);
83 part_row.assign(argv[++i]);
84 part_col.assign(argv[++i]);
85 //Orbiter->Int_vec.scan(part_row, Row_parts, nb_row_parts);
86 //Orbiter->Int_vec.scan(part_col, Col_parts, nb_col_parts);
87 if (f_v) {
88 cout << "-partition " << part_width << " " << part_row << " " << part_col << endl;
89 }
90 }
91 else if (ST.stringcmp(argv[i], "-box_width") == 0) {
93 box_width = ST.strtoi(argv[++i]);
94 if (f_v) {
95 cout << "-box_width " << box_width << endl;
96 }
97 }
98 else if (ST.stringcmp(argv[i], "-bit_depth") == 0) {
99 bit_depth = ST.strtoi(argv[++i]);
100 if (f_v) {
101 cout << "-bit_depth " << bit_depth << endl;
102 }
103 }
104 else if (ST.stringcmp(argv[i], "-invert_colors") == 0) {
106 if (f_v) {
107 cout << "-invert_colors " << endl;
108 }
109 }
110 else if (ST.stringcmp(argv[i], "-end") == 0) {
111 cout << "-end" << endl;
112 break;
113 }
114 else {
115 cout << "draw_bitmap_control::read_arguments "
116 "unrecognized option " << argv[i] << endl;
117 exit(1);
118 }
119
120 }
121 if (f_v) {
122 cout << "draw_bitmap_control::read_arguments done" << endl;
123 }
124 return i + 1;
125}
126
127
129{
130 if (f_input_csv_file) {
131 cout << "-input_csv_file " << input_csv_file_name << endl;
132 }
134 cout << "-secondary_input_csv_file " << secondary_input_csv_file_name << endl;
135 }
136 if (f_partition) {
137 cout << "-partition " << part_width << " " << part_row << " " << part_col << endl;
138 }
139 if (f_box_width) {
140 cout << "-box_width " << box_width << endl;
141 }
142 if (bit_depth) {
143 cout << "-bit_depth " << bit_depth << endl;
144 }
145 if (f_invert_colors) {
146 cout << "-invert_colors " << endl;
147 }
148}
149
150
151
152}}}
153
154
functions related to strings and character arrays
int read_arguments(int argc, std::string *argv, int verbose_level)
#define TRUE
Definition: foundations.h:231
#define FALSE
Definition: foundations.h:234
the orbiter library for the classification of combinatorial objects