summaryrefslogtreecommitdiff
path: root/rotord/src/cvimage.cpp
diff options
context:
space:
mode:
authorComment <tim@gray.(none)>2013-10-07 06:19:14 -0700
committerComment <tim@gray.(none)>2013-10-07 06:19:14 -0700
commitba2831c3a456e860761978cb848f38d825b4c128 (patch)
tree7ced990051d059fae90fd55cea40ef3f3cbdb333 /rotord/src/cvimage.cpp
parent3252e78c0a43613e2a48d39a8dec74ffaf5ee100 (diff)
refacoring
Diffstat (limited to 'rotord/src/cvimage.cpp')
-rw-r--r--rotord/src/cvimage.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/rotord/src/cvimage.cpp b/rotord/src/cvimage.cpp
index 0bf30a6..74a21dd 100644
--- a/rotord/src/cvimage.cpp
+++ b/rotord/src/cvimage.cpp
@@ -200,4 +200,15 @@ namespace Rotor {
other->rgb=rgb/amount;
return other;
}
+ cv::Mat& Image::get_mipmap(int level){
+ if (mipmaps.find(level)!=mipmaps.end()) return mipmaps[level];
+ //levels start at 1
+ int nw=max(1.0,w/pow(2,level));
+ int nh=max(1.0,h/pow(2,level));
+ cv::Mat mip;;
+ cv::resize(rgb,mip,cv::Size(nw,nh),0,0,cv::INTER_AREA );
+ mipmaps[level]=mip;
+ return mipmaps[level];
+
+ }
}