summaryrefslogtreecommitdiff
path: root/src/GipfelWidget.cxx
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-12-18 18:26:41 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-12-18 18:26:41 +0100
commitfaf5dff31fcbafb5cfa8575b85ffaf2408ff5d39 (patch)
treefa0ccd1aadedca0dd9d6d4711e7deccee6bc5a7e /src/GipfelWidget.cxx
parenta432b9670a3df4ddadc6979601c37204aab927cd (diff)
make bilinear resampling optional
Diffstat (limited to 'src/GipfelWidget.cxx')
-rw-r--r--src/GipfelWidget.cxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/GipfelWidget.cxx b/src/GipfelWidget.cxx
index 5f75693..837a5fb 100644
--- a/src/GipfelWidget.cxx
+++ b/src/GipfelWidget.cxx
@@ -667,8 +667,8 @@ GipfelWidget::handle(int event) {
}
int
-GipfelWidget::get_pixel(double a_alph, double a_nick,
- uchar *r, uchar *g, uchar *b) {
+GipfelWidget::get_pixel(GipfelWidget::sample_mode_t m,
+ double a_alph, double a_nick, uchar *r, uchar *g, uchar *b) {
double px, py;
if (img == NULL) {
@@ -679,8 +679,13 @@ GipfelWidget::get_pixel(double a_alph, double a_nick,
return 1;
}
- return get_pixel_bilinear(img, px + ((double) img->w()) / 2.0,
- py + ((double) img->h()) / 2.0, r, g, b);
+ if (m == GipfelWidget::BILINEAR) {
+ return get_pixel_bilinear(img, px + ((double) img->w()) / 2.0,
+ py + ((double) img->h()) / 2.0, r, g, b);
+ } else {
+ return get_pixel_nearest(img, px + ((double) img->w()) / 2.0,
+ py + ((double) img->h()) / 2.0, r, g, b);
+ }
}
int