d2/image_rw: Migrate clamp to image map, and migrate nn calculation to Libale.
[Ale.git] / ui / input.cc
blob2a7e659aae967b7a8e3d538f4ead122cdef2731a
1 // Copyright 2006 David Hilvert <dhilvert@auricle.dyndns.org>,
2 // <dhilvert@ugcs.caltech.edu>
4 /* This file is part of the Anti-Lamenessing Engine.
6 The Anti-Lamenessing Engine is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 The Anti-Lamenessing Engine is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with the Anti-Lamenessing Engine; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include "input.h"
24 * See input.h for details on these variables.
26 std::stack<input::environment *> input::environment::environment_stack;
27 std::set<input::environment *> input::environment::environment_set;
29 int input::global_options = 1;
31 input::environment *input::genv = NULL;
34 * List of options that can be used as nonglobals.
37 const char *input::supported_nonglobal_option_table[] = {
38 "mc",
39 "threads",
40 "per-cpu",
41 "perturb-upper",
42 "ev",
43 "gs-mo",
44 "black",
45 "md",
46 "ma-cert",
47 "mi",
48 NULL
51 const char *input::focus_prefixes[] = {
52 "ci=",
53 "fr=",
54 "ht=",
55 "vt=",
56 "sy=",
57 "ey=",
58 "sx=",
59 "ex=",
60 "sd=",
61 "ed=",
62 "ap=",
63 "sc=",
64 "sr=",
65 "fs=",
66 NULL
70 * Entries in this table are:
72 * name, map_name, map_value, arg_count, multi
74 * The table must be terminated with name of NULL.
77 input::simple_option input::simple_option_table[] = {
79 { "8bpc", "bpc" },
80 { "16bpc", "bpc" },
82 { "plain", "format" },
83 { "raw", "format" },
84 { "auto", "format" },
86 { "align-all", "align" },
87 { "align-green", "align" },
88 { "align-sum", "align" },
90 { "translation", "transformation" },
91 { "euclidean", "transformation" },
92 { "projective", "transformation" },
94 { "identity", "transformation-default" },
95 { "follow", "transformation-default" },
97 { "perturb-output", "perturb" },
98 { "perturb-source", "perturb" },
100 { "fail-optimal", "fail" },
101 { "fail-default", "fail" },
103 { "profile" },
105 { "extend" },
106 { "no-extend", "extend", "0" },
108 { "mc", NULL, NULL, 1 },
110 { "cache", NULL, NULL, 1 },
111 { "resident", NULL, NULL, 1 },
113 { "ev", NULL, NULL, 1 },
114 { "black", NULL, NULL, 1 },
116 { "threads", NULL, NULL, 1 },
117 { "per-cpu", NULL, NULL, 1 },
119 { "oc" },
120 { "no-oc", "oc", "0" },
122 { "multi", NULL, NULL, 1 },
123 { "track-none", "track", "none" },
124 { "track-primary", "track", "primary" },
125 { "track-point", "track", "point", 2 },
127 { "gs", NULL, NULL, 1 },
128 { "gs-mo", NULL, NULL, 1 },
130 { "md", NULL, NULL, 1 },
131 { "ma-cert", NULL, NULL, 1 },
132 { "mi", NULL, NULL, 1 },
134 { "focus", "error" },
136 { "3ddp", NULL, NULL, 10, 1 },
137 { "3dvp", NULL, NULL, 10, 1 },
139 { "3dv", NULL, NULL, 2, 1 },
140 { "3dd", NULL, NULL, 2, 1 },
142 { "view-angle", NULL, NULL, 1 },
144 { "cpf-load", NULL, NULL, 1 },
146 { "accel", NULL, NULL, 1 },
148 { "ui", NULL, NULL, 1 },
150 { "3d-fmr", NULL, NULL, 1 },
152 { "3d-dmr", NULL, NULL, 1 },
154 { "et", NULL, NULL, 1 },
156 { "st", NULL, NULL, 1 },
158 { "di-lower", NULL, NULL, 1 },
160 { "rc", NULL, NULL, 1 },
162 { "do-try", NULL, NULL, 1 },
163 { "di-upper", NULL, NULL, 1 },
165 { "fc", NULL, NULL, 1 },
167 { "ecm", NULL, NULL, 1 },
168 { "acm", NULL, NULL, 1 },
170 { "def-nn", NULL, NULL, 1 },
172 { "fx", NULL, NULL, 1 },
174 { "tcem", NULL, NULL, 1 },
176 { "oui", NULL, NULL, 1 },
178 { "pa", NULL, NULL, 1 },
180 { "pc", NULL, NULL, 1 },
182 { "cw" },
183 { "no-cw", "cw", "0" },
185 { "wm", NULL, NULL, 3 },
187 { "fl", NULL, NULL, 3 },
189 { "wmx", NULL, NULL, 3 },
191 { "flshow", NULL, NULL, 1 },
193 { "3dpx", NULL, NULL, 6 },
195 { "ex", NULL, NULL, 6, 1 },
196 { "crop", NULL, NULL, 6, 1 },
197 { "fex", NULL, NULL, 6, 1 },
198 { "fcrop", NULL, NULL, 6, 1 },
199 { "exshow" },
201 { "wt", NULL, NULL, 1 },
202 { "3d-chain", NULL, NULL, 1 },
203 { "dchain", NULL, NULL, 1 },
204 { "achain", NULL, NULL, 1 },
205 { "afilter", NULL, NULL, 1 },
206 { "ochain", NULL, NULL, 2 },
208 { "visp", NULL, NULL, 5 },
209 { "cx", NULL, NULL, 1 },
210 { "no-cx", "cx", "0" },
212 { "ip", NULL, NULL, 0 },
214 { "bayer", NULL, NULL, 1 },
216 { "lpsf", NULL, NULL, 1 },
217 { "nlpsf", NULL, NULL, 1 },
218 { "psf-match", NULL, NULL, 6 },
220 { "device", NULL, NULL, 1 },
222 { "usm", NULL, NULL, 1 },
224 { "ipr", NULL, NULL, 1 },
226 { "cpp-err-median", "cpp-err", "median" },
227 { "cpp-err-mean", "cpp-err", "mean" },
229 { "vp-adjust" },
230 { "vp-noadjust", "vp-adjust", "0" },
232 { "vo-adjust" },
233 { "vo-noadjust", "vo-adjust", "0" },
235 { "ip-mean", "ip-statistic", "mean" },
236 { "ip-median", "ip-statistic", "median" },
238 { "ip-wl", "ip-wl", "1", 1 },
239 { "ip-nowl", "ip-wl", "0" },
241 { "ips", NULL, NULL, 1 },
243 { "ipc", NULL, NULL, 2 },
245 { "exp-extend" },
246 { "exp-noextend", "exp-extend", "0" },
248 { "exp-register" },
249 { "exp-noregister", "exp-register", "0" },
250 { "exp-meta-only", "exp-register", "2" },
252 { "drizzle-only" },
254 { "subspace-traverse" },
256 { "3d-filter" },
257 { "3d-nofilter", "3d-filter", "0" },
259 { "occ-norm" },
260 { "occ-nonorm", "occ-norm", "0" },
262 { "inc" },
263 { "no-inc", "inc", "0" },
265 { "exp-mult", NULL, NULL, 3 },
267 { "visp-scale", NULL, NULL, 1 },
269 { "scale", NULL, NULL, 1 },
271 { "metric", NULL, NULL, 1 },
273 { "threshold", NULL, NULL, 1 },
275 { "drizzle-diam", NULL, NULL, 1 },
277 { "perturb-upper", NULL, NULL, 1 },
278 { "perturb-lower", NULL, NULL, 1 },
280 { "stepsize", NULL, NULL, 1 },
282 { "va-upper", NULL, NULL, 1 },
283 { "cpp-upper", NULL, NULL, 1 },
284 { "cpp-lower", NULL, NULL, 1 },
285 { "hf-enhance", NULL, NULL, 1 },
286 { "rot-upper", NULL, NULL, 1 },
288 { "bda-mult", NULL, NULL, 1 },
289 { "bda-rate", NULL, NULL, 1 },
291 { "lod-preferred", NULL, NULL, 1 },
292 { "min-dimension", NULL, NULL, 1 },
294 { "model-load", NULL, NULL, 1 },
295 { "model-save", NULL, NULL, 1 },
296 { "trans-load", NULL, NULL, 1 },
297 { "trans-save", NULL, NULL, 1 },
298 { "3d-trans-load", NULL, NULL, 1 },
299 { "3d-trans-save", NULL, NULL, 1 },
302 * End of table.
305 { NULL }