Skip to content
Browse files

PyrDown / PyrUp

  • Loading branch information...
1 parent 11db468 commit daca1a14cb6d37c70b6cce2ff7447c415da3c298 @peterbraden committed Mar 5, 2013
Showing with 20 additions and 0 deletions.
  1. +1 −0 smoke/smoketest.js
  2. +17 −0 src/Matrix.cc
  3. +2 −0 src/Matrix.h
View
1 smoke/smoketest.js
@@ -2,6 +2,7 @@ var cv = require('../lib/opencv')
var win = new cv.NamedWindow("foo");
cv.readImage('./examples/stuff.png', function(e, im){
+ im.pyrDown();
win.show(im);
setTimeout(function(){
win.destroy();
View
17 src/Matrix.cc
@@ -45,6 +45,8 @@ Matrix::Init(Handle<Object> target) {
NODE_SET_PROTOTYPE_METHOD(constructor, "line", Line);
NODE_SET_PROTOTYPE_METHOD(constructor, "save", Save);
NODE_SET_PROTOTYPE_METHOD(constructor, "resize", Resize);
+ NODE_SET_PROTOTYPE_METHOD(constructor, "pyrDown", PyrDown);
+ NODE_SET_PROTOTYPE_METHOD(constructor, "pyrUp", PyrUp);
NODE_SET_PROTOTYPE_METHOD(constructor, "channels", Channels);
NODE_SET_PROTOTYPE_METHOD(constructor, "convertGrayscale", ConvertGrayscale);
@@ -857,6 +859,21 @@ Matrix::Resize(const v8::Arguments& args){
return scope.Close(Undefined());
}
+Handle<Value>
+Matrix::PyrDown(const v8::Arguments& args){
+ SETUP_FUNCTION(Matrix)
+
+ cv::pyrDown(self->mat, self->mat);
+ return scope.Close(v8::Undefined());
+}
+
+Handle<Value>
+Matrix::PyrUp(const v8::Arguments& args){
+ SETUP_FUNCTION(Matrix)
+
+ cv::pyrUp(self->mat, self->mat);
+ return scope.Close(v8::Undefined());
+}
Handle<Value>
Matrix::inRange(const v8::Arguments& args) {
View
2 src/Matrix.h
@@ -41,6 +41,8 @@ class Matrix: public node::ObjectWrap {
JSFUNC(ToBufferAsync)
JSFUNC(Resize)
+ JSFUNC(PyrDown)
+ JSFUNC(PyrUp)
JSFUNC(ConvertGrayscale)
JSFUNC(ConvertHSVscale)

0 comments on commit daca1a1

Please sign in to comment.
Something went wrong with that request. Please try again.