summaryrefslogtreecommitdiff
path: root/src/Stitch.cxx
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-06-25 13:02:31 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-06-25 13:02:31 +0200
commitbf376cf0a996b08c39f22d46ba68be4e7957777f (patch)
tree3ebf29fea7f8bd7183dabdbd7388dc264194f7c3 /src/Stitch.cxx
parentb8a44e5e78d6b9f9c045f1c4e9600e1b346e099c (diff)
first working version
Diffstat (limited to 'src/Stitch.cxx')
-rw-r--r--src/Stitch.cxx22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/Stitch.cxx b/src/Stitch.cxx
index ca63ed3..9080259 100644
--- a/src/Stitch.cxx
+++ b/src/Stitch.cxx
@@ -58,8 +58,26 @@ Stitch::load_image(char *file) {
int
Stitch::resample(DataImage *img,
- double view_start, double view_end,
- double nick_start, double nick_end) {
+ double view_start, double view_end) {
+ double step_view = (view_end - view_start) / img->w();
+ char r, g, b;
+ int y_off = img->h() / 2;
+ for (int x=0; x<img->w(); x++) {
+ for (int y=0; y<img->h(); y++) {
+ double a_view, a_nick;
+ a_view = x * step_view;
+ a_nick = (y_off - y) * step_view;
+
+ for (int i=0; i<MAX_PICS; i++) {
+ if (gipf[i] == NULL) {
+ break;
+ } else if (gipf[i]->get_pixel(a_view, a_nick, &r, &g, &b)==0) {
+ img->set_pixel(x, y, r, g, b);
+ break;
+ }
+ }
+ }
+ }
}