@@ -31,12 +31,6 @@ THE SOFTWARE.
31
31
32
32
#include " Ogre.h"
33
33
34
- #if OGRE_DOUBLE_PRECISION == 1
35
- #define WITH_FLOAT_SUFFIX (x ) x
36
- #else
37
- #define WITH_FLOAT_SUFFIX (x ) x##f
38
- #endif
39
-
40
34
/* * Some functionality for comparing images */
41
35
42
36
/* Results of comparing two test images */
@@ -57,7 +51,6 @@ struct ComparisonResult
57
51
};
58
52
59
53
typedef std::vector<ComparisonResult> ComparisonResultVector;
60
- typedef Ogre::SharedPtr<ComparisonResultVector> ComparisonResultVectorPtr;
61
54
62
55
/* * Simple object for doing image comparison between two image sets */
63
56
class ImageValidator
@@ -115,7 +108,7 @@ class ImageValidator
115
108
116
109
out.incorrectPixels = 0 ;
117
110
Ogre::ColourValue disparity = Ogre::ColourValue (0 ,0 ,0 );
118
- Ogre::Real ssim = 0.0 ;
111
+ float ssim = 0.0 ;
119
112
120
113
int width = img1.getWidth ();
121
114
int height = img1.getHeight ();
@@ -189,8 +182,7 @@ class ImageValidator
189
182
if (out.incorrectPixels != 0 )
190
183
{
191
184
// average and clamp to [-1,1]
192
- out.ssim = std::max (WITH_FLOAT_SUFFIX (-1.0 ),
193
- std::min (WITH_FLOAT_SUFFIX (1.0 ), ssim/(width*height/WITH_FLOAT_SUFFIX (64 .))));
185
+ out.ssim = Ogre::Math::Clamp (ssim/(width*height/64 .f ), -1 .f , 1 .f );
194
186
195
187
// average the raw deviance value to get MSE
196
188
out.mseChannels = disparity / (width*height);
0 commit comments