summaryrefslogtreecommitdiff
path: root/rotord/src/cvimage.h
diff options
context:
space:
mode:
Diffstat (limited to 'rotord/src/cvimage.h')
-rw-r--r--rotord/src/cvimage.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/rotord/src/cvimage.h b/rotord/src/cvimage.h
index feb7298..4921f78 100644
--- a/rotord/src/cvimage.h
+++ b/rotord/src/cvimage.h
@@ -93,12 +93,17 @@ namespace Rotor {
int getStride(){
return w*3;
}
+ bool clear(){
+ rgb.setTo(0);
+ };
bool setup(int _w,int _h){ //set up with internal data
- rgb.create(_h,_w,CV_8UC3);
- RGBdata=rgb.data; //can move to use the bare pointer eventually
- ownsRGBdata=false; //will not be necessary
- w=_w;
- h=_h;
+ if (w!=_w|h!=h){
+ rgb.create(_h,_w,CV_8UC3);
+ RGBdata=rgb.data; //can move to use the bare pointer eventually
+ ownsRGBdata=false; //will not be necessary
+ w=_w;
+ h=_h;
+ }
return true;
/*
if (w!=_w||h!=_h||!ownsRGBdata||!ownsAdata||!ownsZdata){