Round values when creating image from rankings
This commit is contained in:
parent
c9ec105664
commit
afa27fc555
1 changed files with 2 additions and 1 deletions
|
@ -15,6 +15,7 @@
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
#include <sys/sysinfo.h>
|
#include <sys/sysinfo.h>
|
||||||
|
|
||||||
|
@ -419,7 +420,7 @@ namespace internal {
|
||||||
&& "New image::Bl size too small (values' size is not a multiple of width)");
|
&& "New image::Bl size too small (values' size is not a multiple of width)");
|
||||||
|
|
||||||
for(unsigned int i = 0; i < values.size(); ++i) {
|
for(unsigned int i = 0; i < values.size(); ++i) {
|
||||||
grImage.getData()[i] = ((float)((int)(values[i]) - min) / (float)max) * 255.0F;
|
grImage.getData()[i] = std::round(((float)((int)(values[i]) - min) / (float)max) * 255.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
return grImage;
|
return grImage;
|
||||||
|
|
Loading…
Reference in a new issue