summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-06-25 23:59:12 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-06-25 23:59:12 +0200
commit98c1c1890e91962876e53c026f5f3c502562d8b0 (patch)
treeca9df3ea8bd51783078f5f897e0ffb24f885e8a8
parent5e188fda3b5d539b299a7c7ce63f98264fa8c229 (diff)
correct height width ratio
-rw-r--r--src/Stitch.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Stitch.cxx b/src/Stitch.cxx
index ae3158d..6bd29d2 100644
--- a/src/Stitch.cxx
+++ b/src/Stitch.cxx
@@ -28,6 +28,8 @@
#include "Stitch.H"
+static double pi_d = asin(1.0) * 2.0;
+
Stitch::Stitch() {
for (int i=0; i<MAX_PICS; i++) {
gipf[i] = NULL;
@@ -67,9 +69,10 @@ Stitch::resample(DataImage *img,
double step_view = (view_end - view_start) / img->w();
char r, g, b;
int y_off = img->h() / 2;
+ double radius = (double) img->w() / (view_end -view_start);
for (int y=0; y<img->h(); y++) {
- double a_nick = atan(((double)(y_off - y)/(double)img->h()));
+ double a_nick = atan((double)(y_off - y)/radius);
for (int x=0; x<img->w(); x++) {
double a_view;