24 #include <Base/Common/BIASpragma.hh>
25 #if defined(WIN32) && defined(_MSC_VER)
26 # pragma warning (disable: 4661)
29 #include "DisplacementMapping.hh"
30 #include <Base/Geometry/HomgPoint2D.hh>
31 #include <Base/Image/ImageIO.hh>
35 template <
class InputStorageType,
class OutputStorageType>
43 template <
class InputStorageType,
class OutputStorageType>
49 template <
class InputStorageType,
class OutputStorageType>
53 SetDisplacementMap(dismap);
56 template <
class InputStorageType,
class OutputStorageType>
60 cout <<
"Displacement Map must have 3 Channels but has only "
65 cout <<
"Displacement map must be INTERLEAVED but is not" << endl;
73 template <
class InputStorageType,
class OutputStorageType>
77 BIASASSERT(sink[2]==1.0);
86 if(sink[0] >= dismap_.GetWidth() || sink[1] >= dismap_.GetHeight())
88 if(sink[0] < 0 || sink[1] < 0)
92 const float* Data = dismap_.GetImageData();
95 int index = (int)(3.0*(((
double)dismap_.GetHeight()-1.0-sink[1])*
96 (
double)dismap_.GetWidth()+sink[0]));
99 source[0] = Data[index];
100 source[1] = Data[index+1];
101 source[2] = Data[index+2];
112 #if defined(BUILD_IMAGE_CHAR)
117 #if defined(BUILD_IMAGE_USHORT)
121 #if defined(BUILD_IMAGE_SHORT)
125 #if defined(BUILD_IMAGE_SHORT)&&defined(BUILD_IMAGE_USHORT)
129 #if defined(BUILD_IMAGE_INT)
133 #if defined(BUILD_IMAGE_USHORT)
137 #if defined(BUILD_IMAGE_USHORT) && defined(BUILD_IMAGE_INT)
141 #if defined(BUILD_IMAGE_DOUBLE)
class HomgPoint2D describes a point with 2 degrees of freedom in projective coordinates.
bool IsInterleaved() const
Maps image src to image sink with displacement mapl generated by backwardmapping method.
unsigned int GetChannelCount() const
returns the number of Color channels, e.g.