Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
BackwardMappingLUTStructs.hh
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 
26 #ifndef __BackwardMappingLUTStructs_hh__
27 #define __BackwardMappingLUTStructs_hh__
28 
29 namespace BIAS {
30 
31  /** @enum InterpolationMethod
32  @brief accuracy for resampling
33 
34  Trilinear averages different pyramid levels based on a local isotropic
35  sampling frequency
36  Anisotropic is the most expensive and uses the local jacobian for
37  anti-aliasing, while preserving texture direction which need
38  no smoothing */
46  };
47 
48  /** @class BWM_LUT_Entry_Nearest
49  @brief base class for storing precomputed look-up information
50  in BackwardMapping */
52  public:
53  /// boolean showing if the pixel can be correctly mapped
54  bool mapped;
55  /// nearest x,y-position in the source image, written as an index
56  int index;
57  };
58 
59  /** @class BWM_LUT_Entry_Bilinear
60  @brief base class for storing precomputed lookup information for bilinear
61  interpolation in BackwardMapping */
63  public:
64  /// boolean showing if the pixel can be correctly mapped
65  bool mapped;
66 
67  //-------PIXEL INDEXES AND THEIR WEIGHTS-------
68  /// PIXEL X-
69  /// --
70  /// weight for (1-dx)*(1-dy)
71  float xy_weight;
72  //index of pixel (floor(x), floor(y)) in the picture
73  int index_0_0;
74 
75  /// PIXEL --
76  /// X-
77  /// weight for (1-dx)*dy
78  float xY_weight;
79  //index of pixel (floor(x), floor(y+1)) in the picture
80  int index_0_1;
81 
82  /// PIXEL -X
83  /// --
84  /// weight for dx*(1-dy)
85  float Xy_weight;
86  //index of pixel (floor(x+1), floor(y)) in the picture
87  int index_1_0;
88 
89  /// PIXEL --
90  /// -X
91  /// weight for dx*dy
92  float XY_weight;
93  //index of pixel (floor(x+1), floor(y+1)) in the picture
94  int index_1_1;
95  //---------------------------------------------
96  /** Returns the content of object into serialized mem.
97  * \attention it is assumed that access to mem is valid.
98  **/
99  float* SerializedOut(float* pointerToHeadOfOutputMem);
100 
101  /** Retrieves the content of object from serialized mem.
102  * \attention it is assumed that access to mem is valid.
103  **/
104  const float* SerializedIn(const float* pointerToHeadOfInputMem);
105  /** Returns the number of fields that are contained in the
106  * serialized output.
107  **/
108  static int GetSerializedSize();
109  };
110 
111  /** @class BWM_LUT_Entry_Trilinear
112  @brief base class for storing precomputed lookup information for
113  trilinear interpolation in BackwardMapping */
115  public:
116  /// boolean showing if the pixel can be correctly mapped
117  bool mapped;
118 
119  /// pyr_diff_inv + pyr_diff = 1
121  /// lower pyramid-level-index
123 
124  /// pyr_level + pyr_diff = exact pyramid-level of the pixel
125  float pyr_diff;
126  /// higher pyramid-level-index
128 
129  /// pixel values on both lower and higher pyramid levels
132 
133  /** Returns the content of object into serialized mem.
134  * \attention it is assumed that access to mem is valid.
135  **/
136  float* SerializedOut(float* pointerToHeadOfOutputMem);
137 
138  /** Retrieves the content of object from serialized mem.
139  * \attention it is assumed that access to mem is valid.
140  **/
141  const float* SerializedIn(const float* pointerToHeadOfInputMem);
142  /** Returns the number of fields that are contained in the
143  * serialized output.
144  **/
145  static int GetSerializedSize();
146  };
147 
148  /** @class BWM_LUT_Entry_Anisotropic
149  @brief base class for storing precomputed lookup information for
150  anisotropic interpolation in BackwardMapping
151  @attention NOT IMPLEMENTED */
153  public:
154  //range
155  //NOT IMPLEMENTED
156  };
157 
158  /** @class BWM_LUT_Entry_Bicubic
159  @brief base class for storing precomputed lookup information for
160  bicubic interpolation in BackwardMapping
161  @attention NOT IMPLEMENTED */
163  public:
164  //range
165  //NOT IMPLEMENTED
166  };
167 
168 
169 
170 } // namespace
171 
172 
173 #endif
float xy_weight
PIXEL X- weight for (1-dx)*(1-dy)
int index
nearest x,y-position in the source image, written as an index
InterpolationMethod
accuracy for resampling
int index_1_1
BWM_LUT_Entry_Bilinear stage_1
float xY_weight
PIXEL – X- weight for (1-dx)*dy.
float XY_weight
PIXEL – -X weight for dx*dy.
int index_0_0
const float * SerializedIn(const float *pointerToHeadOfInputMem)
Retrieves the content of object from serialized mem.
base class for storing precomputed lookup information for trilinear interpolation in BackwardMapping ...
BWM_LUT_Entry_Bilinear stage_0
pixel values on both lower and higher pyramid levels
base class for storing precomputed look-up information in BackwardMapping
float pyr_diff_inv
pyr_diff_inv + pyr_diff = 1
float * SerializedOut(float *pointerToHeadOfOutputMem)
Returns the content of object into serialized mem.
int index_0_1
bool mapped
boolean showing if the pixel can be correctly mapped
int pyr_level_high
higher pyramid-level-index
float pyr_diff
pyr_level + pyr_diff = exact pyramid-level of the pixel
bool mapped
boolean showing if the pixel can be correctly mapped
base class for storing precomputed lookup information for anisotropic interpolation in BackwardMappin...
base class for storing precomputed lookup information for bilinear interpolation in BackwardMapping ...
const float * SerializedIn(const float *pointerToHeadOfInputMem)
Retrieves the content of object from serialized mem.
static int GetSerializedSize()
Returns the number of fields that are contained in the serialized output.
int index_1_0
int pyr_level_low
lower pyramid-level-index
base class for storing precomputed lookup information for bicubic interpolation in BackwardMapping ...
float * SerializedOut(float *pointerToHeadOfOutputMem)
Returns the content of object into serialized mem.
float Xy_weight
PIXEL -X weight for dx*(1-dy)
bool mapped
boolean showing if the pixel can be correctly mapped
static int GetSerializedSize()
Returns the number of fields that are contained in the serialized output.