summaryrefslogtreecommitdiff
path: root/rotord/src/cvimage.h
diff options
context:
space:
mode:
authorComment <tim@gray.(none)>2013-12-08 10:55:03 +0000
committerComment <tim@gray.(none)>2013-12-08 10:55:03 +0000
commit1d05d2380bb4f1fd265aef55744f432af38b08aa (patch)
tree89c1c15497149951d4b99938ad932abde42eae14 /rotord/src/cvimage.h
parente04516069c71a5a1e32e6a5fbf0eb5b86dcfc5a2 (diff)
switched signals to double and random to uint16
Diffstat (limited to 'rotord/src/cvimage.h')
-rw-r--r--rotord/src/cvimage.h22
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;