diff options
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; |
