1 // Copyright 2004 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
27 * Logging user interface.
30 class ui_log
: public ui
{
32 void printf(const char *format
, ...) {
34 fprintf(ui_stream
, "ale: %u: ", (unsigned int) time(NULL
));
38 vfprintf(ui_stream
, format
, ap
);
41 if (format
[strlen(format
) - 1] != '\n')
42 fprintf(ui_stream
, "\n");
53 void exp_multiplier(double m0
, double m1
, double m2
) {
54 ui::exp_multiplier(m0
, m1
, m2
);
55 printf("Exposure multiplier: %g, %g, %g\n", m0
, m1
, m2
);
58 void set_steps(int count
) {
59 printf("%d steps to complete\n", count
);
62 void set_steps_completed(int count
) {
63 printf("%d steps completed\n", count
);
66 void set_match(double match
) {
67 printf("match %g / mismatch %g\n", (1 - match
), match
);
70 void set_offset(d2::transformation
);
72 void gs_mo(ale_pos gs_mo
) {
73 printf("Global search minimum overlap is %f pixels\n", gs_mo
);
77 printf("Loading file.\n");
81 printf("Exposure pass 1.\n");
85 printf("Exposure pass 2.\n");
89 printf("Prematching.\n");
93 printf("Postmatching.\n");
96 void constructing_lod_clusters(ale_pos lod
) {
97 printf("Constructing LOD cluster (%f)\n", lod
);
100 void global_alignment(ale_pos perturb
, ale_pos lod
) {
101 status
.perturb_size
= perturb
;
102 printf("Global alignment (perturb=%f, lod=%f).\n", perturb
, lod
);
105 void aligning(ale_pos perturb
, ale_pos lod
) {
106 perturb_timers
[perturb
].start();
107 status
.perturb_size
= perturb
;
108 printf("Aligning (perturb=%f, lod=%f).\n", perturb
, lod
);
112 printf("Applying initial-final following logic.\n");
115 void set_orender_current(int num
) {
116 printf("Preparing to render output (index %d)\n", num
);
120 void set_arender_current() {
121 printf("Preparing to render alignment reference image.\n");
125 printf("Rendering.\n");
128 void writing_output(int num
) {
129 printf("Writing output (index %d)\n", num
);
132 void ip_frame_start(unsigned int num
) {
133 printf("Starting Irani-Peleg frame %d.\n", num
);
136 void ip_frame_simulate_start() {
137 printf("Simulating frame.");
140 void ip_frame_correct_start() {
141 printf("Correcting frame.\n");
145 printf("Writing.\n");
148 void ip_step_done() {
149 printf("Finished pass.");
153 printf("Irani-Peleg done.\n");
156 void original_frame_start(const char *name
) {
157 printf("Starting original frame (%s)\n", name
);
160 void original_frame_done() {
161 printf("Finished original frame\n");
164 void supplemental_frame_start(const char *name
) {
165 printf("Starting supplemental frame (%s)\n", name
);
168 void supplemental_frame_done() {
169 printf("Supplemental frame done.\n");
172 void alignment_monte_carlo_parameter(ale_pos mc
) {
173 printf("Monte carlo parameter is %g\n", mc
);
176 void alignment_perturbation_level(ale_pos perturb
, ale_pos lod
) {
177 perturb_timers
[status
.perturb_size
].stop();
178 status
.perturb_size
= perturb
;
179 perturb_timers
[perturb
].start();
180 printf("Perturbation set to %g; LOD set to %g.\n", perturb
, lod
);
183 void alignment_match_ok() {
184 printf("Alignment match OK.\n");
187 void alignment_no_match() {
188 printf("Alignment failed to match.\n");
191 void cache(double usage
, double max
) {
192 printf("Cache usage is %.1f%% of %.0fMB.\n", 100 * usage
/ max
, max
);
195 void cache_status(unsigned int i
) {
196 printf("Cache is full.\n");
199 void log_message(const char *message
) {