diff options
| author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2006-12-18 22:11:00 +0100 |
|---|---|---|
| committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2006-12-18 22:11:00 +0100 |
| commit | 4b2dc2ab9526ccca3cc6a0a7d85e9236b7ed3582 (patch) | |
| tree | 210946ecf21d42100bcf9ded155f63a11462a7e7 /src/gipfel.cxx | |
| parent | 7872b3cd1f6d1ee55f9b5fc772fe5463bd3c647e (diff) | |
add distortion profile handling
Diffstat (limited to 'src/gipfel.cxx')
| -rw-r--r-- | src/gipfel.cxx | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/gipfel.cxx b/src/gipfel.cxx index ba62ff6..a54cdd1 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -164,6 +164,43 @@ void comp_cb(Fl_Widget *, void *) { set_values(); } +void save_distortion_cb(Fl_Widget *, void *) { + char buf[1024]; + const char * prof_name; + double k0, k1; + + gipf->get_distortion_params(&k0, &k1); + gipf->get_distortion_profile_name(buf, sizeof(buf)); + prof_name = fl_input("Save Distortion Profile (k0=%f, k1=%f)", + buf, k0, k1); + + if (prof_name == NULL) { + return; + } + + gipf->save_distortion_params(prof_name); + set_values(); +} + +void load_distortion_cb(Fl_Widget *, void *) { + char buf[1024]; + const char * prof_name; + + gipf->get_distortion_profile_name(buf, sizeof(buf)); + prof_name = fl_input("Load Distortion Profile", buf); + + if (prof_name == NULL) { + return; + } + + if (gipf->load_distortion_params(prof_name) != 0) { + fl_alert("Could not load profile %s.", prof_name); + } else { + set_values(); + } +} + + void about_cb() { fl_message("gipfel -- and you know what you see.\n" "Version %s\n\n" @@ -185,6 +222,9 @@ void fill_menubar(Fl_Menu_Bar* mb) { mb->add("&Projection/Panoramic Projection", 0, (Fl_Callback *)proj_cb, (void *)1, FL_MENU_RADIO); + mb->add("&Distortion/Load Profile", 0, (Fl_Callback *)load_distortion_cb); + mb->add("&Distortion/Save Profile", 0, (Fl_Callback *)save_distortion_cb); + mb->add("&Option/Show Hidden", 0, (Fl_Callback *) hidden_cb, (void *)0, FL_MENU_TOGGLE); |
