d2::align::_align(): Limit skipping of the alignment process based on
[Ale.git] / ui / ui_log.h
blob2a487018bf97f6ceea55516866350c1a54b212c2
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
21 #ifndef __ui_log_h__
22 #define __ui_log_h__
24 #include "ui.h"
27 * Logging user interface.
30 class ui_log : public ui {
31 private:
32 void printf(const char *format, ...) {
34 fprintf(ui_stream, "ale: %u: ", (unsigned int) time(NULL));
36 va_list ap;
37 va_start(ap, format);
38 vfprintf(ui_stream, format, ap);
39 va_end(ap);
41 if (format[strlen(format) - 1] != '\n')
42 fprintf(ui_stream, "\n");
45 void update() {
48 public:
49 ui_log() {
50 ui_stream = stdout;
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);
71 void set_offset(d2::trans_single);
72 void start_multi_alignment_element(d2::trans_multi &);
73 void set_offset(d2::trans_single, int marker);
75 void gs_mo(ale_pos gs_mo) {
76 printf("Global search minimum overlap is %f pixels\n", (double) gs_mo);
79 void loading_file() {
80 printf("Loading file.\n");
83 void exposure_1() {
84 printf("Exposure pass 1.\n");
87 void exposure_2() {
88 printf("Exposure pass 2.\n");
91 void prematching() {
92 printf("Prematching.\n");
95 void postmatching() {
96 printf("Postmatching.\n");
99 void constructing_lod_clusters(ale_pos lod) {
100 printf("Constructing LOD cluster (%f)\n", (double) lod);
103 void global_alignment(ale_pos perturb, ale_pos lod) {
104 status.perturb_size = perturb;
105 printf("Global alignment (perturb=%f, lod=%f).\n", (double) perturb, (double) lod);
108 void aligning(ale_pos perturb, ale_pos lod) {
109 perturb_timers[perturb].start();
110 status.perturb_size = perturb;
111 printf("Aligning (perturb=%f, lod=%f).\n", (double) perturb, (double) lod);
114 void following() {
115 printf("Applying initial-final following logic.\n");
118 void set_orender_current(int num) {
119 printf("Preparing to render output (index %d)\n", num);
123 void set_arender_current() {
124 printf("Preparing to render alignment reference image.\n");
127 void rendering() {
128 printf("Rendering.\n");
131 void writing_output(int num) {
132 printf("Writing output (index %d)\n", num);
135 void ip_frame_start(unsigned int num) {
136 printf("Starting Irani-Peleg frame %d.\n", num);
139 void ip_frame_simulate_start() {
140 printf("Simulating frame.");
143 void ip_frame_correct_start() {
144 printf("Correcting frame.\n");
147 void ip_write() {
148 printf("Writing.\n");
151 void ip_step_done() {
152 printf("Finished pass.");
155 void ip_done() {
156 printf("Irani-Peleg done.\n");
159 void original_frame_start(const char *name) {
160 printf("Starting original frame (%s)\n", name);
163 void original_frame_done() {
164 printf("Finished original frame\n");
167 void supplemental_frame_start(const char *name) {
168 printf("Starting supplemental frame (%s)\n", name);
171 void supplemental_frame_done() {
172 printf("Supplemental frame done.\n");
175 void alignment_perturbation_level(ale_pos perturb, ale_pos lod) {
176 perturb_timers[status.perturb_size].stop();
177 status.perturb_size = perturb;
178 perturb_timers[perturb].start();
179 printf("Perturbation set to %g; LOD set to %g.\n", (double) perturb, (double) lod);
182 void alignment_match_ok() {
183 printf("Alignment match OK.\n");
186 void alignment_no_match() {
187 printf("Alignment failed to match.\n");
190 void cache(double usage, double max) {
191 printf("Cache usage is %.1f%% of %.0fMB.\n", 100 * usage / max, max);
194 void cache_status(unsigned int i) {
195 printf("Cache is full.\n");
198 void log_message(const char *message) {
199 printf(message);
204 #endif