Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TextureMapping.cpp
1 /*
2 This file is part of the BIAS library (Basic ImageAlgorithmS).
3 
4 Copyright (C) 2003-2009 (see file CONTACT for details)
5 Multimediale Systeme der Informationsverarbeitung
6 Institut fuer Informatik
7 Christian-Albrechts-Universitaet Kiel
8 
9 
10 BIAS is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14 
15 BIAS is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU Lesser General Public License for more details.
19 
20 You should have received a copy of the GNU Lesser General Public License
21 along with BIAS; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24 
25 #include "Image/TextureMapping.hh"
26 #include "Image/TextureTransformDisparity.hh"
27 
28 using namespace BIAS;
29 using namespace std;
30 
31 
32 template <class InputStorageType, class OutputStorageType>
35 {
36  if (T_!=NULL) delete T_;
37 }
38 
39 template <class InputStorageType, class OutputStorageType>
42 {
44 }
45 
46 
47 template <class InputStorageType, class OutputStorageType>
50  T_(NULL)
51 {
52  (*this) = src;
53 }
54 
55 template <class InputStorageType, class OutputStorageType>
59 {
60  if (T_!=NULL) delete T_;
61  T_ = src.T_->Clone();
62  return *this;
63 }
64 
65 template <class InputStorageType, class OutputStorageType>
68  HomgPoint2D & source) const {
69  return T_->MapBackward(sink, source);
70 }
71 
72 template <class InputStorageType, class OutputStorageType>
74 GetJacobian_(const HomgPoint2D& sink, Matrix2x2<double>& Jacobian) const {
75  return T_->TextureJacobianBackward(sink, Jacobian);
76 }
77 
78 namespace BIAS{
79 // TODO FIXME win32 template instantiation problem (JW)
81 template class TextureMapping<float, float>;
84 
85 #if defined(BUILD_IMAGE_CHAR)
86 // TODO FIXME win32 template instantiation problem (JW)
88 template class TextureMapping<char, char>;
89 #endif
90 
91 #if defined(BUILD_IMAGE_USHORT)
93 #endif
94 
95 #if defined(BUILD_IMAGE_SHORT)
96 template class TextureMapping<short, short>;
97 #endif
98 
99 #if defined(BUILD_IMAGE_SHORT)&&defined(BUILD_IMAGE_USHORT)
101 #endif
102 
103 #if defined(BUILD_IMAGE_INT)
104 template class TextureMapping<int,int>;
105 #endif
106 
107 #if defined(BUILD_IMAGE_USHORT)
109 #endif
110 
111 #if defined(BUILD_IMAGE_USHORT) && defined(BUILD_IMAGE_INT)
113 #endif
114 
115 #if defined(BUILD_IMAGE_DOUBLE)
116 template class TextureMapping<double,double>;
117 #endif
118 }
class HomgPoint2D describes a point with 2 degrees of freedom in projective coordinates.
Definition: HomgPoint2D.hh:67
analytic properties of x-displacement
TextureTransform * T_
Textures for backward mapping: Run over sink and compute source.
virtual int GetSourceCoordinates_(const HomgPoint2D &sink, HomgPoint2D &source) const
Reimplementation for Pixel transformation, takes sink and computes coordinates in source...
TextureMapping< InputStorageType, OutputStorageType > & operator=(const TextureMapping &src)
required because of const members
virtual TextureTransform * Clone() const =0
virtual covariant copy constructor, caller must eventually destroy the created object ...
virtual int GetJacobian_(const HomgPoint2D &sink, Matrix2x2< double > &Jacobian) const
analytic jacobian
Maps source pixel to sink pixel given any TextureTransform.