From 1d05d2380bb4f1fd265aef55744f432af38b08aa Mon Sep 17 00:00:00 2001 From: Comment Date: Sun, 8 Dec 2013 10:55:03 +0000 Subject: switched signals to double and random to uint16 --- rotord/src/cvimage.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'rotord/src/cvimage.h') 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]=ji?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; -- cgit v1.2.3