[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libcvd-members] libcvd/cvd vision.h
From: |
Gerhard Reitmayr |
Subject: |
[libcvd-members] libcvd/cvd vision.h |
Date: |
Thu, 27 Jul 2006 11:14:58 +0000 |
CVSROOT: /cvsroot/libcvd
Module name: libcvd
Changes by: Gerhard Reitmayr <gerhard> 06/07/27 11:14:58
Modified files:
cvd : vision.h
Log message:
changed sample to work with multi component pixel types
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd/vision.h?cvsroot=libcvd&r1=1.17&r2=1.18
Patches:
Index: vision.h
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd/vision.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- vision.h 16 May 2006 13:31:47 -0000 1.17
+++ vision.h 27 Jul 2006 11:14:57 -0000 1.18
@@ -319,7 +319,11 @@
int ly = (int)y;
x -= lx;
y -= ly;
- result = static_cast<T>((1-y)*((1-x)*im[ly][lx] + x*im[ly][lx+1]) + y *
((1-x)*im[ly+1][lx] + x*im[ly+1][lx+1]));
+ for(unsigned int i = 0; i < Pixel::Component<T>::count; i++){
+ Pixel::Component<T>::get(result,i) = static_cast<typename
Pixel::Component<T>::type>(
+ (1-y)*((1-x)*Pixel::Component<S>::get(im[ly][lx],i) +
x*Pixel::Component<S>::get(im[ly][lx+1], i)) +
+ y * ((1-x)*Pixel::Component<S>::get(im[ly+1][lx],i) +
x*Pixel::Component<S>::get(im[ly+1][lx+1],i)));
+ }
}
inline void sample(const BasicImage<float>& im, double x, double y, float&
result)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libcvd-members] libcvd/cvd vision.h,
Gerhard Reitmayr <=