summaryrefslogtreecommitdiff
path: root/rotord/src/cvimage.cpp
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2014-02-07 13:24:00 +0000
committerTim Redfern <tim@eclectronics.org>2014-02-07 13:24:00 +0000
commit22fd121880876005d312827a6a35c9f41c292bb2 (patch)
treef7527a3ae626b8a5915da2a0a91e20a7958593cd /rotord/src/cvimage.cpp
parent775dc6bcc5f5c23319bb92315140c154a79fe6f8 (diff)
curiouser and curiouser
Diffstat (limited to 'rotord/src/cvimage.cpp')
-rw-r--r--rotord/src/cvimage.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/rotord/src/cvimage.cpp b/rotord/src/cvimage.cpp
index 21e4e2f..b255848 100644
--- a/rotord/src/cvimage.cpp
+++ b/rotord/src/cvimage.cpp
@@ -176,11 +176,13 @@ namespace Rotor {
}
Image & Image::operator=(const Image &other) {
//can be optimised? was trying to use other.data.clone()
- setup(other.w,other.h);
- //for (int i=0;i<h*w*3;i++) {
- // rgb.data[i]=other.rgb.data[i];
- //}
- memcpy(rgb.data,other.rgb.data,h*w*3); //saves ~2.4 ms copying a 640x360 image
+ if (setup(other.w,other.h)){
+ //for (int i=0;i<h*w*3;i++) {
+ // rgb.data[i]=other.rgb.data[i];
+ //}
+ memcpy(rgb.data,other.rgb.data,h*w*3); //saves ~2.4 ms copying a 640x360 image
+
+ }
return *this;
}
//channel rearrangement
@@ -245,6 +247,6 @@ namespace Rotor {
cv::resize(rgb,mip,cv::Size(nw,nh),0,0,cv::INTER_AREA );
mipmaps[level]=mip;
return mipmaps[level];
-
+
}
}