From 4188cb198bec8a83cfeb893608af2bd39d515449 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Mon, 30 Oct 2006 19:21:16 +0100 Subject: scale -> focal_length_35mm --- src/GipfelWidget.H | 4 ++-- src/GipfelWidget.cxx | 12 ++++++------ src/ImageMetaData.H | 6 +++--- src/ImageMetaData.cxx | 20 ++++++++++---------- src/gipfel.cxx | 26 +++++++++++++------------- 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/GipfelWidget.H b/src/GipfelWidget.H index 7bcd3c0..f4c2850 100644 --- a/src/GipfelWidget.H +++ b/src/GipfelWidget.H @@ -78,7 +78,7 @@ class GipfelWidget : public Fl_Widget { void set_tilt_angle(double a); - void set_scale(double s); + void set_focal_length_35mm(double s); void set_height_dist_ratio(double r); @@ -100,7 +100,7 @@ class GipfelWidget : public Fl_Widget { double get_tilt_angle(); - double get_scale(); + double get_focal_length_35mm(); double get_height_dist_ratio(); diff --git a/src/GipfelWidget.cxx b/src/GipfelWidget.cxx index a1982d5..f38b21c 100644 --- a/src/GipfelWidget.cxx +++ b/src/GipfelWidget.cxx @@ -114,7 +114,7 @@ GipfelWidget::load_image(char *file) { set_nick_angle(md->get_nick()); set_tilt_angle(md->get_tilt()); set_projection((Projection::Projection_t) md->get_projection_type()); - set_scale(md->get_focallength_sensor_ratio() * img->w()); + set_focal_length_35mm(md->get_focal_length_35mm()); delete md; @@ -144,7 +144,7 @@ GipfelWidget::save_image(char *file) { md->set_direction(get_center_angle()); md->set_nick(get_nick_angle()); md->set_tilt(get_tilt_angle()); - md->set_focallength_sensor_ratio(get_scale() / (double) img->w()); + md->set_focal_length_35mm(get_focal_length_35mm()); md->set_projection_type((int) get_projection()); ret = md->save_image(img_file, file); @@ -469,8 +469,8 @@ GipfelWidget::set_tilt_angle(double a) { } void -GipfelWidget::set_scale(double s) { - pan->set_scale(s); +GipfelWidget::set_focal_length_35mm(double s) { + pan->set_scale(s * (double) img->w() / 35.0); set_labels(pan->get_visible_mountains()); redraw(); } @@ -503,8 +503,8 @@ GipfelWidget::get_tilt_angle() { } double -GipfelWidget::get_scale() { - return pan->get_scale(); +GipfelWidget::get_focal_length_35mm() { + return pan->get_scale() * 35.0 / (double) img->w(); } double diff --git a/src/ImageMetaData.H b/src/ImageMetaData.H index 7116d98..48d5043 100644 --- a/src/ImageMetaData.H +++ b/src/ImageMetaData.H @@ -28,7 +28,7 @@ class ImageMetaData { double direction; double nick; double tilt; - double focallength_sensor_ratio; + double focal_length_35mm; double scale; int projection_type; @@ -48,7 +48,7 @@ class ImageMetaData { double get_direction(); double get_nick(); double get_tilt(); - double get_focallength_sensor_ratio(); + double get_focal_length_35mm(); int get_projection_type(); void set_longitude(double v); @@ -57,7 +57,7 @@ class ImageMetaData { void set_direction(double v); void set_nick(double v); void set_tilt(double v); - void set_focallength_sensor_ratio(double v); + void set_focal_length_35mm(double v); void set_projection_type(int v); }; #endif diff --git a/src/ImageMetaData.cxx b/src/ImageMetaData.cxx index d78493d..a5d3726 100644 --- a/src/ImageMetaData.cxx +++ b/src/ImageMetaData.cxx @@ -37,7 +37,7 @@ ImageMetaData::ImageMetaData() { direction = 0.0; nick = 0.0; tilt = 0.0; - focallength_sensor_ratio = 1.0; + focal_length_35mm = 35.0; scale = NAN; projection_type = 0; } @@ -49,7 +49,7 @@ ImageMetaData::load_image(char *name, int img_width) { ret = load_image_jpgcom(name); if (ret == 2) { // old format - focallength_sensor_ratio = scale / (double) img_width; + focal_length_35mm = scale * 35.0 / (double) img_width; } else if (ret == 1) { // get reasonable defaults from exif data ret = load_image_exif(name); } @@ -111,7 +111,7 @@ ImageMetaData::load_image_exif(char *name) { switch(id) { case EXIF_FOCAL_LENGTH_IN_35MM_FILM: - focallength_sensor_ratio = atof(val) / 35.0; + focal_length_35mm = atof(val); break; case EXIF_GPS_LONGITUDE: longitude = degminsecstr2double(val); @@ -137,7 +137,7 @@ ImageMetaData::load_image_exif(char *name) { #define GIPFEL_FORMAT_1 "gipfel: longitude %lf, latitude %lf, height %lf, direction %lf, nick %lf, tilt %lf, scale %lf, projection type %d" -#define GIPFEL_FORMAT_2 "gipfel: longitude %lf, latitude %lf, height %lf, direction %lf, nick %lf, tilt %lf, focallength_sensor_ratio %lf, projection type %d" +#define GIPFEL_FORMAT_2 "gipfel: longitude %lf, latitude %lf, height %lf, direction %lf, nick %lf, tilt %lf, focal_length_35mm %lf, projection type %d" int ImageMetaData::load_image_jpgcom(char *name) { @@ -167,7 +167,7 @@ ImageMetaData::load_image_jpgcom(char *name) { direction = dir; nick = ni; tilt = ti; - focallength_sensor_ratio = fr; + focal_length_35mm = fr; projection_type = pt; ret = 0; @@ -238,7 +238,7 @@ ImageMetaData::save_image_jpgcom(char *in_img, char *out_img) { direction, nick, tilt, - focallength_sensor_ratio, + focal_length_35mm, projection_type); // try to save gipfel data in JPEG comment section @@ -303,8 +303,8 @@ ImageMetaData::get_tilt() { } double -ImageMetaData::get_focallength_sensor_ratio() { - return focallength_sensor_ratio; +ImageMetaData::get_focal_length_35mm() { + return focal_length_35mm; } int @@ -343,8 +343,8 @@ ImageMetaData::set_tilt(double v) { } void -ImageMetaData::set_focallength_sensor_ratio(double v) { - focallength_sensor_ratio = v; +ImageMetaData::set_focal_length_35mm(double v) { + focal_length_35mm = v; } void diff --git a/src/gipfel.cxx b/src/gipfel.cxx index 13ef3e5..dc15d8e 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -58,7 +58,7 @@ char *data_file = DEFAULT_DATAFILE; GipfelWidget *gipf = NULL; Fl_Dial *s_center = NULL; -Fl_Slider *s_nick, *s_scale, *s_tilt, *s_height_dist, *s_track_width; +Fl_Slider *s_nick, *s_focal_length, *s_tilt, *s_height_dist, *s_track_width; Fl_Value_Input *i_view_lat, *i_view_long, *i_view_height; Fl_Box *b_viewpoint; Fl_Menu_Bar *mb; @@ -72,7 +72,7 @@ static int stitch(int stitch_w, int stitch_h, int type, const char *path, void set_values() { s_center->value(gipf->get_center_angle()); s_nick->value(gipf->get_nick_angle()); - s_scale->value(gipf->get_scale()); + s_focal_length->value(gipf->get_focal_length_35mm()); s_tilt->value(gipf->get_tilt_angle()); s_height_dist->value(gipf->get_height_dist_ratio()); i_view_lat->value(gipf->get_view_lat()); @@ -114,8 +114,8 @@ void save_cb() { } } -void scale_cb(Fl_Slider* o, void*) { - gipf->set_scale(o->value()); +void focal_length_cb(Fl_Slider* o, void*) { + gipf->set_focal_length_35mm(o->value()); } void angle_cb(Fl_Slider* o, void*) { @@ -245,15 +245,15 @@ create_control_window() { Fl_Box *west = new Fl_Box(0, 125, 40, 20, "West"); - s_scale = new Fl_Value_Slider(235, 60, 160, 15, "Scale"); - s_scale->type(1); - s_scale->box(FL_THIN_DOWN_BOX); - s_scale->labelsize(10); - s_scale->step(5.0); - s_scale->bounds(0.0, 10000.0); - s_scale->slider(FL_UP_BOX); - s_scale->callback((Fl_Callback*)scale_cb); - s_scale->align(FL_ALIGN_TOP); + s_focal_length = new Fl_Value_Slider(235, 60, 160, 15, "Focal Length In 35mm"); + s_focal_length->type(1); + s_focal_length->box(FL_THIN_DOWN_BOX); + s_focal_length->labelsize(10); + s_focal_length->step(0.01); + s_focal_length->bounds(1.0, 200.0); + s_focal_length->slider(FL_UP_BOX); + s_focal_length->callback((Fl_Callback*)focal_length_cb); + s_focal_length->align(FL_ALIGN_TOP); s_nick = new Fl_Value_Slider(235, 90, 160, 15, "Nick (deg.)"); s_nick->type(1); -- cgit v1.2.3