diff options
| author | Comment <tim@gray.(none)> | 2013-12-08 10:55:03 +0000 |
|---|---|---|
| committer | Comment <tim@gray.(none)> | 2013-12-08 10:55:03 +0000 |
| commit | 1d05d2380bb4f1fd265aef55744f432af38b08aa (patch) | |
| tree | 89c1c15497149951d4b99938ad932abde42eae14 /rotord/src/cvimage.cpp | |
| parent | e04516069c71a5a1e32e6a5fbf0eb5b86dcfc5a2 (diff) | |
switched signals to double and random to uint16
Diffstat (limited to 'rotord/src/cvimage.cpp')
| -rw-r--r-- | rotord/src/cvimage.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/rotord/src/cvimage.cpp b/rotord/src/cvimage.cpp index 7aae63e..21e4e2f 100644 --- a/rotord/src/cvimage.cpp +++ b/rotord/src/cvimage.cpp @@ -191,47 +191,47 @@ namespace Rotor { //scalar operations allocate a new image. //maybe this could not be the case if the data is owned by this image? //need to look into auto_ptr - Image & Image::operator*=(const float &amount) { + Image & Image::operator*=(const double &amount) { //cerr<<"amount: "<<amount<<endl; //rgb*=amount; - uint8_t amt=(uint8_t)(amount*255.0f); + uint8_t amt=(uint8_t)(amount*255.0); for (int i=0;i<h*w*3;i++) { rgb.data[i]=pixels.multiply[rgb.data[i]][amt]; } //again this is faster return *this; } - Image & Image::operator+=(const float &amount) { - rgb+=(amount*255.0f); + Image & Image::operator+=(const double &amount) { + rgb+=(amount*255.0); return *this; } - Image & Image::operator-=(const float &amount) { - rgb-=(amount*255.0f); + Image & Image::operator-=(const double &amount) { + rgb-=(amount*255.0); return *this; } - Image & Image::operator/=(const float &amount) { + Image & Image::operator/=(const double &amount) { rgb/=amount; return *this; } - Image * Image::operator*(const float &amount) { + Image * Image::operator*(const double &amount) { //LEAK!! even if the image is deleted!! opencv?? Image *other=new Image(w,h); other->rgb=rgb*amount; return other; } - Image * Image::operator+(const float &amount) { - uint8_t amt=(uint8_t)(amount*255.0f); + Image * Image::operator+(const double &amount) { + uint8_t amt=(uint8_t)(amount*255.0); Image *other=new Image(w,h); other->rgb=rgb+amt; return other; } - Image * Image::operator-(const float &amount) { - uint8_t amt=(uint8_t)(amount*255.0f); + Image * Image::operator-(const double &amount) { + uint8_t amt=(uint8_t)(amount*255.0); Image *other=new Image(w,h); other->rgb=rgb-amt; return other; } - Image * Image::operator/(const float &amount) { + Image * Image::operator/(const double &amount) { Image *other=new Image(w,h); other->rgb=rgb/amount; return other; |
