diff options
Diffstat (limited to 'rotord/src/cvimage.h')
| -rw-r--r-- | rotord/src/cvimage.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/rotord/src/cvimage.h b/rotord/src/cvimage.h index ee39edf..0a91715 100644 --- a/rotord/src/cvimage.h +++ b/rotord/src/cvimage.h @@ -40,18 +40,18 @@ namespace Rotor { max[i]=new uint8_t[256]; for (int j=0;j<256;j++){ add[i][j]=(uint8_t)std::min(i+j,0xFF); - multiply[i][j]=(uint8_t)(((float)i)*(((float)j)/255.0f)); + multiply[i][j]=(uint8_t)(((double)i)*(((double)j)/255.0)); overlay[i][j]=j<128?(uint8_t)((i*j)>>7):255-(((0xFF-i)*(0xFF-j))>>7); min[i][j]=j<i?j:i; max[i][j]=j>i?j:i; } } mono_weights=new uint8_t*[3]; - float weights[3]={0.2989, 0.5870, 0.1140}; + double weights[3]={0.2989, 0.5870, 0.1140}; for (int i=0;i<3;i++) { mono_weights[i]=new uint8_t[256]; for (int j=0;j<256;j++){ - mono_weights[i][j]=(uint8_t)(((float)j)*weights[i]); + mono_weights[i][j]=(uint8_t)(((double)j)*weights[i]); } } } @@ -221,14 +221,14 @@ namespace Rotor { Image & overlay(const Image &other); Image & min(const Image &other); Image & max(const Image &other); - Image & operator*=(const float &amount); - Image & operator+=(const float &amount); - Image & operator-=(const float &amount); - Image & operator/=(const float &amount); - Image * operator*(const float &amount); - Image * operator+(const float &amount); - Image * operator-(const float &amount); - Image * operator/(const float &amount); + Image & operator*=(const double &amount); + Image & operator+=(const double &amount); + Image & operator-=(const double &amount); + Image & operator/=(const double &amount); + Image * operator*(const double &amount); + Image * operator+(const double &amount); + Image * operator-(const double &amount); + Image * operator/(const double &amount); uint8_t *RGBdata; uint8_t *Adata; uint16_t *Zdata; |
