summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-03-26 20:22:36 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-03-26 20:22:36 +0100
commit3d4e62d3c9781649ef5ea01825fd5c686e63379c (patch)
treed1b2c148f480d0104c056781c49b234ff547e14e /src
parenteb72978eb28008f677145dbeb1b3090ed47a5b19 (diff)
style
Diffstat (limited to 'src')
-rw-r--r--src/Hill.H5
-rw-r--r--src/ImageMetaData.H1
-rw-r--r--src/OutputImage.cxx17
-rw-r--r--src/ProjectionCylindrical.H1
-rw-r--r--src/ProjectionRectilinear.H1
-rw-r--r--src/Stitch.H5
-rw-r--r--src/Stitch.cxx6
-rw-r--r--src/TIFFOutputImage.cxx1
-rw-r--r--src/gipfel.cxx33
9 files changed, 26 insertions, 44 deletions
diff --git a/src/Hill.H b/src/Hill.H
index da680f8..225e507 100644
--- a/src/Hill.H
+++ b/src/Hill.H
@@ -7,12 +7,9 @@
#ifndef HILL_H
#define HILL_H
-
class Hill;
class Hill {
- private:
-
public:
typedef enum {
DUPLICATE = 0x01,
@@ -38,7 +35,6 @@ class Hill {
~Hill();
};
-
class Hills {
private:
int num, cap;
@@ -63,4 +59,5 @@ class Hills {
int get_num() const;
Hill *get(int n) const;
};
+
#endif
diff --git a/src/ImageMetaData.H b/src/ImageMetaData.H
index 5265f90..109652d 100644
--- a/src/ImageMetaData.H
+++ b/src/ImageMetaData.H
@@ -61,4 +61,5 @@ class ImageMetaData {
void projection_type(int v) {_projection_type = v;};
void distortion_params(double k0, double k1, double x0);
};
+
#endif
diff --git a/src/OutputImage.cxx b/src/OutputImage.cxx
index 04ee471..dd14fc6 100644
--- a/src/OutputImage.cxx
+++ b/src/OutputImage.cxx
@@ -1,5 +1,5 @@
//
-// Copyright 2006 Johannes Hofmann <Johannes.Hofmann@gmx.de>
+// Copyright 2006-2009 Johannes Hofmann <Johannes.Hofmann@gmx.de>
//
// This software may be used and distributed according to the terms
// of the GNU General Public License, incorporated herein by reference.
@@ -27,28 +27,25 @@ OutputImage::init(int w1, int h1) {
int
OutputImage::set_pixel(int x, int r, int g, int b) {
- if (!initialized || x < 0 || x >= W) {
+ if (!initialized || x < 0 || x >= W)
return 1;
- } else {
+ else
return set_pixel_internal(x, r, g, b);
- }
}
int
OutputImage::next_line() {
- if (!initialized || line++ >= H) {
+ if (!initialized || line++ >= H)
return 1;
- } else {
+ else
return next_line_internal();
- }
}
int
OutputImage::done() {
- if (!initialized) {
+ if (!initialized)
return 1;
- } else {
+ else
next_line();
return done_internal();
- }
}
diff --git a/src/ProjectionCylindrical.H b/src/ProjectionCylindrical.H
index ff576ec..41bad29 100644
--- a/src/ProjectionCylindrical.H
+++ b/src/ProjectionCylindrical.H
@@ -28,4 +28,5 @@ class ProjectionCylindrical : public ProjectionLSQ {
#undef ARGS
};
+
#endif
diff --git a/src/ProjectionRectilinear.H b/src/ProjectionRectilinear.H
index be7b48e..2d799e3 100644
--- a/src/ProjectionRectilinear.H
+++ b/src/ProjectionRectilinear.H
@@ -34,4 +34,5 @@ class ProjectionRectilinear : public ProjectionLSQ {
#undef ARGS
};
+
#endif
diff --git a/src/Stitch.H b/src/Stitch.H
index 4a92091..20087ab 100644
--- a/src/Stitch.H
+++ b/src/Stitch.H
@@ -12,8 +12,6 @@
#define MAX_PICS 256
-
-
class Stitch {
private:
GipfelWidget *gipf[MAX_PICS];
@@ -22,13 +20,10 @@ class Stitch {
public:
Stitch();
-
~Stitch();
int load_image(char *file);
-
OutputImage * set_output(OutputImage *img);
-
int resample(GipfelWidget::sample_mode_t m,
int w, int h, double view_start, double view_end);
};
diff --git a/src/Stitch.cxx b/src/Stitch.cxx
index e69a28e..8a1b429 100644
--- a/src/Stitch.cxx
+++ b/src/Stitch.cxx
@@ -23,7 +23,7 @@ static double pi_d = asin(1.0) * 2.0;
static double deg2rad = pi_d / 180.0;
Stitch::Stitch() {
- for (int i=0; i<MAX_PICS; i++)
+ for (int i = 0; i < MAX_PICS; i++)
gipf[i] = NULL;
merged_image = NULL;
@@ -31,7 +31,7 @@ Stitch::Stitch() {
}
Stitch::~Stitch() {
- for (int i=0; i<MAX_PICS; i++)
+ for (int i = 0; i < MAX_PICS; i++)
if (gipf[i])
delete gipf[i];
else
@@ -40,7 +40,7 @@ Stitch::~Stitch() {
int
Stitch::load_image(char *file) {
- for (int i=0; i<MAX_PICS; i++) {
+ for (int i = 0; i < MAX_PICS; i++) {
if (gipf[i] == NULL) {
gipf[i] = new GipfelWidget(0, 0, 800, 600);
if (gipf[i]->load_image(file) != 0) {
diff --git a/src/TIFFOutputImage.cxx b/src/TIFFOutputImage.cxx
index 2b0a30d..e9f6a2b 100644
--- a/src/TIFFOutputImage.cxx
+++ b/src/TIFFOutputImage.cxx
@@ -95,4 +95,3 @@ TIFFOutputImage::done_internal() {
return 0;
}
-
diff --git a/src/gipfel.cxx b/src/gipfel.cxx
index 02ab690..e6d9f49 100644
--- a/src/gipfel.cxx
+++ b/src/gipfel.cxx
@@ -208,15 +208,13 @@ void save_distortion_cb(Fl_Widget *, void *) {
prof_name = fl_input("Save Distortion Profile (k0=%f, k1=%f, x0=%f)",
buf, k0, k1, x0);
- if (prof_name == NULL) {
+ if (prof_name == NULL)
return;
- }
if (gipf->save_distortion_params(prof_name, 0) != 0) {
if (fl_choice("A profile with this name exists.\n",
- "Cancel", "Overwrite", NULL) == 1) {
+ "Cancel", "Overwrite", NULL) == 1)
gipf->save_distortion_params(prof_name, 1);
- }
}
set_values();
}
@@ -229,15 +227,13 @@ void load_distortion_cb(Fl_Widget *, void *) {
gipf->get_distortion_profile_name(buf, sizeof(buf));
prof_name = fl_input("Load Distortion Profile", buf);
- if (prof_name == NULL) {
+ if (prof_name == NULL)
return;
- }
- if (gipf->load_distortion_params(prof_name) != 0) {
+ if (gipf->load_distortion_params(prof_name) != 0)
fl_alert("Could not load profile %s.", prof_name);
- } else {
+ else
set_values();
- }
}
void distortion_cb(Fl_Value_Input*, void*) {
@@ -494,9 +490,8 @@ int main(int argc, char** argv) {
stitch_flag++;
if (optarg && strcmp(optarg, ":")) {
stitch_from = atof(optarg);
- if (strchr(optarg, ',')) {
+ if (strchr(optarg, ','))
stitch_to = atof(strchr(optarg, ',') + 1);
- }
}
break;
case 'u':
@@ -508,9 +503,8 @@ int main(int argc, char** argv) {
if (c) {
dist_k1 = atof(strchr(optarg, ',') + 1);
c = strchr(c + 1, ',');
- if (c) {
+ if (c)
dist_x0 = atof(strchr(optarg, ',') + 1);
- }
}
}
break;
@@ -591,9 +585,8 @@ int main(int argc, char** argv) {
control_win->label(img_file);
}
- if (distortion_flag) {
+ if (distortion_flag)
gipf->set_distortion_params(dist_k0, dist_k1, dist_x0);
- }
Fl::screen_xywh(sx, sy, sw, sh);
view_win->size(std::min(gipf->w(), sw), std::min(gipf->h(), sh));
@@ -612,12 +605,11 @@ int main(int argc, char** argv) {
view_win->show(1, argv);
control_win->show(1, argv);
- if (view_point) {
+ if (view_point)
gipf->set_viewpoint(view_point);
- } else if (img_file &&
- (isnan(gipf->get_view_lat()) || isnan(gipf->get_view_long()))) {
+ else if (img_file &&
+ (isnan(gipf->get_view_lat()) || isnan(gipf->get_view_long())))
viewpoint_cb(NULL, NULL);
- }
return Fl::run();
}
@@ -631,9 +623,8 @@ stitch(GipfelWidget::sample_mode_t m, int b_16,
Fl_Scroll *scroll;
Stitch *st = new Stitch();
- for (int i=0; i<argc; i++) {
+ for (int i = 0; i < argc; i++)
st->load_image(argv[i]);
- }
if (type & STITCH_JPEG) {