From be92fe5e65d0081be1e32ce6635ccaa155b71d55 Mon Sep 17 00:00:00 2001 From: Peter Braden Date: Tue, 5 Feb 2013 14:24:05 -0800 Subject: [PATCH] Strip trailing spaces in matrix.cc re #29 --- src/Matrix.cc | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/Matrix.cc b/src/Matrix.cc index 0eab50d..7016748 100755 --- a/src/Matrix.cc +++ b/src/Matrix.cc @@ -58,7 +58,7 @@ Matrix::Init(Handle target) { NODE_SET_PROTOTYPE_METHOD(constructor, "findContours", FindContours); NODE_SET_PROTOTYPE_METHOD(constructor, "drawContour", DrawContour); NODE_SET_PROTOTYPE_METHOD(constructor, "drawAllContours", DrawAllContours); - + NODE_SET_PROTOTYPE_METHOD(constructor, "goodFeaturesToTrack", GoodFeaturesToTrack); NODE_SET_PROTOTYPE_METHOD(constructor, "houghLinesP", HoughLinesP); @@ -104,7 +104,7 @@ Matrix::Matrix(): ObjectWrap() { Matrix::Matrix(int w, int h): ObjectWrap() { - mat = cv::Mat(w, h, CV_32FC3); + mat = cv::Mat(w, h, CV_32FC3); //TODO:Parametrizar esto //mat = cv::Mat(h, w, CV_8UC3); } @@ -162,7 +162,7 @@ Matrix::Get(const Arguments& args){ } -Handle +Handle Matrix::Set(const Arguments& args){ SETUP_FUNCTION(Matrix) @@ -199,7 +199,7 @@ Matrix::Set(const Arguments& args){ } -Handle +Handle Matrix::Size(const Arguments& args){ SETUP_FUNCTION(Matrix) @@ -210,7 +210,7 @@ Matrix::Size(const Arguments& args){ return scope.Close(arr); } -Handle +Handle Matrix::Row(const Arguments& args){ SETUP_FUNCTION(Matrix) @@ -227,7 +227,7 @@ Matrix::Row(const Arguments& args){ } -Handle +Handle Matrix::PixelRow(const Arguments& args){ SETUP_FUNCTION(Matrix) @@ -246,7 +246,7 @@ Handle return scope.Close(arr); } -Handle +Handle Matrix::Col(const Arguments& args){ SETUP_FUNCTION(Matrix) @@ -262,7 +262,7 @@ Matrix::Col(const Arguments& args){ } -Handle +Handle Matrix::PixelCol(const Arguments& args){ SETUP_FUNCTION(Matrix) @@ -280,21 +280,21 @@ Matrix::PixelCol(const Arguments& args){ return scope.Close(arr); } -Handle +Handle Matrix::Width(const Arguments& args){ SETUP_FUNCTION(Matrix) return scope.Close(Number::New(self->mat.size().width)); } -Handle +Handle Matrix::Height(const Arguments& args){ SETUP_FUNCTION(Matrix) return scope.Close(Number::New(self->mat.size().height)); } -Handle +Handle Matrix::Channels(const Arguments& args){ SETUP_FUNCTION(Matrix) @@ -385,7 +385,7 @@ void AfterAsyncToBufferAsync(uv_work_t *req) { node::Buffer *buf = node::Buffer::New(baton->res.size()); uchar* data = (uchar*) Buffer::Data(buf); memcpy(data, &baton->res[0], baton->res.size()); - + v8::Local globalObj = v8::Context::GetCurrent()->Global(); v8::Local bufferConstructor = v8::Local::Cast(globalObj->Get(v8::String::New("Buffer"))); v8::Handle constructorArgs[3] = {buf->handle_, v8::Integer::New(baton->res.size()), v8::Integer::New(0)}; @@ -404,19 +404,19 @@ void AfterAsyncToBufferAsync(uv_work_t *req) { baton->cb.Dispose(); delete baton; - + // return 0; } -Handle +Handle Matrix::Ellipse(const v8::Arguments& args){ SETUP_FUNCTION(Matrix) int x = args[0]->Uint32Value(); int y = args[1]->Uint32Value(); int width = args[2]->Uint32Value(); - int height = args[3]->Uint32Value(); + int height = args[3]->Uint32Value(); cv::Scalar color(0, 0, 255); if(args[4]->IsArray()) { @@ -449,7 +449,7 @@ Matrix::Rectangle(const Arguments& args) { Local objColor = args[2]->ToObject(); color = setColor(objColor); } - + int x = xy->Get(0)->IntegerValue(); int y = xy->Get(1)->IntegerValue(); @@ -482,7 +482,7 @@ Matrix::Line(const Arguments& args) { Local objColor = args[2]->ToObject(); color = setColor(objColor); } - + int x1 = xy1->Get(0)->IntegerValue(); int y1 = xy1->Get(1)->IntegerValue(); @@ -514,7 +514,7 @@ Matrix::Save(const v8::Arguments& args){ } -Handle +Handle Matrix::Eye(const v8::Arguments& args){ HandleScope scope; @@ -612,7 +612,7 @@ Matrix::AddWeighted(const v8::Arguments& args) { int gamma = 0; cv::addWeighted(src1->mat, alpha, src2->mat, beta, gamma, self->mat); - + return scope.Close(v8::Null()); } @@ -717,14 +717,14 @@ Matrix::GoodFeaturesToTrack(const v8::Arguments& args) { Matrix *self = ObjectWrap::Unwrap(args.This()); std::vector corners; - + cv::Mat gray; cvtColor(self->mat, gray, CV_BGR2GRAY); equalizeHist(gray, gray); cv::goodFeaturesToTrack(gray, corners, 500, 0.01, 10); - + v8::Local arr = v8::Array::New(corners.size()); @@ -745,14 +745,14 @@ Matrix::HoughLinesP(const v8::Arguments& args) { Matrix *self = ObjectWrap::Unwrap(args.This()); std::vector lines; - + cv::Mat gray; equalizeHist(self->mat, gray); // cv::Canny(gray, gray, 50, 200, 3); cv::HoughLinesP(gray, lines, 1, CV_PI/180, 80, 30, 10); - + v8::Local arr = v8::Array::New(lines.size());