mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
- continued work migrating api to nan
This commit is contained in:
parent
8db4e0ed2d
commit
cd303829de
@ -21,8 +21,7 @@ BackgroundSubtractorWrap::Init(Handle<Object> target) {
|
|||||||
target->Set(String::NewSymbol("BackgroundSubtractor"), constructor->GetFunction());
|
target->Set(String::NewSymbol("BackgroundSubtractor"), constructor->GetFunction());
|
||||||
};
|
};
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(BackgroundSubtractorWrap::New() {
|
||||||
BackgroundSubtractorWrap::New(const Arguments &args) {
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
if (args.This()->InternalFieldCount() == 0)
|
if (args.This()->InternalFieldCount() == 0)
|
||||||
@ -37,8 +36,7 @@ BackgroundSubtractorWrap::New(const Arguments &args) {
|
|||||||
return args.This();
|
return args.This();
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(BackgroundSubtractorWrap::CreateMOG() {
|
||||||
BackgroundSubtractorWrap::CreateMOG(const Arguments &args) {
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
int history = 200;
|
int history = 200;
|
||||||
@ -63,8 +61,7 @@ BackgroundSubtractorWrap::CreateMOG(const Arguments &args) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
//Fetch foreground mask
|
//Fetch foreground mask
|
||||||
Handle<Value>
|
NAN_METHOD(BackgroundSubtractorWrap::ApplyMOG() {
|
||||||
BackgroundSubtractorWrap::ApplyMOG(const Arguments &args) {
|
|
||||||
|
|
||||||
SETUP_FUNCTION(BackgroundSubtractorWrap)
|
SETUP_FUNCTION(BackgroundSubtractorWrap)
|
||||||
|
|
||||||
|
|||||||
@ -27,8 +27,7 @@ TrackedObject::Init(Handle<Object> target) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(TrackedObject::New() {
|
||||||
TrackedObject::New(const Arguments &args) {
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
if (args.This()->InternalFieldCount() == 0){
|
if (args.This()->InternalFieldCount() == 0){
|
||||||
@ -120,8 +119,7 @@ TrackedObject::TrackedObject(cv::Mat image, cv::Rect rect, int chan){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(TrackedObject::Track(const v8::Arguments& args){
|
||||||
TrackedObject::Track(const v8::Arguments& args){
|
|
||||||
SETUP_FUNCTION(TrackedObject)
|
SETUP_FUNCTION(TrackedObject)
|
||||||
|
|
||||||
if (args.Length() != 1){
|
if (args.Length() != 1){
|
||||||
|
|||||||
@ -27,8 +27,7 @@ CascadeClassifierWrap::Init(Handle<Object> target) {
|
|||||||
target->Set(String::NewSymbol("CascadeClassifier"), constructor->GetFunction());
|
target->Set(String::NewSymbol("CascadeClassifier"), constructor->GetFunction());
|
||||||
};
|
};
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(CascadeClassifierWrap::New() {
|
||||||
CascadeClassifierWrap::New(const Arguments &args) {
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
if (args.This()->InternalFieldCount() == 0)
|
if (args.This()->InternalFieldCount() == 0)
|
||||||
@ -65,8 +64,7 @@ struct classifier_baton_t {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(CascadeClassifierWrap::DetectMultiScale){
|
||||||
CascadeClassifierWrap::DetectMultiScale(const v8::Arguments& args){
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
CascadeClassifierWrap *self = ObjectWrap::Unwrap<CascadeClassifierWrap>(args.This());
|
CascadeClassifierWrap *self = ObjectWrap::Unwrap<CascadeClassifierWrap>(args.This());
|
||||||
|
|||||||
@ -38,8 +38,7 @@ Contour::Init(Handle<Object> target) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(Contour::New() {
|
||||||
Contour::New(const Arguments &args) {
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
if (args.This()->InternalFieldCount() == 0)
|
if (args.This()->InternalFieldCount() == 0)
|
||||||
@ -57,8 +56,7 @@ Contour::Contour(): ObjectWrap() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(Contour::Point() {
|
||||||
Contour::Point(const Arguments &args) {
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
Contour *self = ObjectWrap::Unwrap<Contour>(args.This());
|
Contour *self = ObjectWrap::Unwrap<Contour>(args.This());
|
||||||
@ -77,8 +75,7 @@ Contour::Point(const Arguments &args) {
|
|||||||
// FIXME: this sould better be called "Length" as ``Contours`` is an Array like structure
|
// FIXME: this sould better be called "Length" as ``Contours`` is an Array like structure
|
||||||
// also, this would allow to use ``Size`` for the function returning the number of corners
|
// also, this would allow to use ``Size`` for the function returning the number of corners
|
||||||
// in the contour for better consistency with OpenCV.
|
// in the contour for better consistency with OpenCV.
|
||||||
Handle<Value>
|
NAN_METHOD(Contour::Size() {
|
||||||
Contour::Size(const Arguments &args) {
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
Contour *self = ObjectWrap::Unwrap<Contour>(args.This());
|
Contour *self = ObjectWrap::Unwrap<Contour>(args.This());
|
||||||
@ -86,8 +83,7 @@ Contour::Size(const Arguments &args) {
|
|||||||
return scope.Close(Number::New(self->contours.size()));
|
return scope.Close(Number::New(self->contours.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(Contour::CornerCount() {
|
||||||
Contour::CornerCount(const Arguments &args) {
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
Contour *self = ObjectWrap::Unwrap<Contour>(args.This());
|
Contour *self = ObjectWrap::Unwrap<Contour>(args.This());
|
||||||
@ -96,8 +92,7 @@ Contour::CornerCount(const Arguments &args) {
|
|||||||
return scope.Close(Number::New(self->contours[pos].size()));
|
return scope.Close(Number::New(self->contours[pos].size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(Contour::Area() {
|
||||||
Contour::Area(const Arguments &args) {
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
Contour *self = ObjectWrap::Unwrap<Contour>(args.This());
|
Contour *self = ObjectWrap::Unwrap<Contour>(args.This());
|
||||||
@ -108,8 +103,7 @@ Contour::Area(const Arguments &args) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(Contour::ArcLength() {
|
||||||
Contour::ArcLength(const Arguments &args) {
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
Contour *self = ObjectWrap::Unwrap<Contour>(args.This());
|
Contour *self = ObjectWrap::Unwrap<Contour>(args.This());
|
||||||
@ -120,8 +114,7 @@ Contour::ArcLength(const Arguments &args) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(Contour::ApproxPolyDP() {
|
||||||
Contour::ApproxPolyDP(const Arguments &args) {
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
Contour *self = ObjectWrap::Unwrap<Contour>(args.This());
|
Contour *self = ObjectWrap::Unwrap<Contour>(args.This());
|
||||||
@ -137,8 +130,7 @@ Contour::ApproxPolyDP(const Arguments &args) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(Contour::ConvexHull() {
|
||||||
Contour::ConvexHull(const Arguments &args) {
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
Contour *self = ObjectWrap::Unwrap<Contour>(args.This());
|
Contour *self = ObjectWrap::Unwrap<Contour>(args.This());
|
||||||
@ -154,8 +146,7 @@ Contour::ConvexHull(const Arguments &args) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(Contour::BoundingRect() {
|
||||||
Contour::BoundingRect(const Arguments &args) {
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
Contour *self = ObjectWrap::Unwrap<Contour>(args.This());
|
Contour *self = ObjectWrap::Unwrap<Contour>(args.This());
|
||||||
@ -173,8 +164,7 @@ Contour::BoundingRect(const Arguments &args) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(Contour::MinAreaRect() {
|
||||||
Contour::MinAreaRect(const Arguments &args) {
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
Contour *self = ObjectWrap::Unwrap<Contour>(args.This());
|
Contour *self = ObjectWrap::Unwrap<Contour>(args.This());
|
||||||
@ -212,8 +202,7 @@ Contour::MinAreaRect(const Arguments &args) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(Contour::IsConvex() {
|
||||||
Contour::IsConvex(const Arguments &args) {
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
Contour *self = ObjectWrap::Unwrap<Contour>(args.This());
|
Contour *self = ObjectWrap::Unwrap<Contour>(args.This());
|
||||||
@ -222,8 +211,7 @@ Contour::IsConvex(const Arguments &args) {
|
|||||||
return scope.Close(Boolean::New(isContourConvex(cv::Mat(self->contours[pos]))));
|
return scope.Close(Boolean::New(isContourConvex(cv::Mat(self->contours[pos]))));
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(Contour::Moments() {
|
||||||
Contour::Moments(const Arguments &args) {
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
Contour *self = ObjectWrap::Unwrap<Contour>(args.This());
|
Contour *self = ObjectWrap::Unwrap<Contour>(args.This());
|
||||||
|
|||||||
@ -53,8 +53,7 @@ FaceRecognizerWrap::Init(Handle<Object> target) {
|
|||||||
target->Set(String::NewSymbol("FaceRecognizer"), constructor->GetFunction());
|
target->Set(String::NewSymbol("FaceRecognizer"), constructor->GetFunction());
|
||||||
};
|
};
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(FaceRecognizerWrap::New() {
|
||||||
FaceRecognizerWrap::New(const Arguments &args) {
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
if (args.This()->InternalFieldCount() == 0)
|
if (args.This()->InternalFieldCount() == 0)
|
||||||
@ -68,8 +67,7 @@ FaceRecognizerWrap::New(const Arguments &args) {
|
|||||||
return args.This();
|
return args.This();
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(FaceRecognizerWrap::CreateLBPH() {
|
||||||
FaceRecognizerWrap::CreateLBPH(const Arguments &args) {
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
int radius = 1;
|
int radius = 1;
|
||||||
@ -95,8 +93,7 @@ FaceRecognizerWrap::CreateLBPH(const Arguments &args) {
|
|||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(FaceRecognizerWrap::CreateEigen() {
|
||||||
FaceRecognizerWrap::CreateEigen(const Arguments &args) {
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
int components = 0;
|
int components = 0;
|
||||||
@ -116,8 +113,7 @@ FaceRecognizerWrap::CreateEigen(const Arguments &args) {
|
|||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(FaceRecognizerWrap::CreateFisher() {
|
||||||
FaceRecognizerWrap::CreateFisher(const Arguments &args) {
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
int components = 0;
|
int components = 0;
|
||||||
@ -177,8 +173,7 @@ Handle<Value> UnwrapTrainingData(const Arguments& args, cv::vector<cv::Mat>* ima
|
|||||||
return v8::Undefined();
|
return v8::Undefined();
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(FaceRecognizerWrap::TrainSync(const Arguments& args){
|
||||||
FaceRecognizerWrap::TrainSync(const Arguments& args){
|
|
||||||
SETUP_FUNCTION(FaceRecognizerWrap)
|
SETUP_FUNCTION(FaceRecognizerWrap)
|
||||||
|
|
||||||
cv::vector<cv::Mat> images;
|
cv::vector<cv::Mat> images;
|
||||||
@ -194,8 +189,7 @@ FaceRecognizerWrap::TrainSync(const Arguments& args){
|
|||||||
return scope.Close(v8::Undefined());
|
return scope.Close(v8::Undefined());
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(FaceRecognizerWrap::UpdateSync(const Arguments& args){
|
||||||
FaceRecognizerWrap::UpdateSync(const Arguments& args){
|
|
||||||
SETUP_FUNCTION(FaceRecognizerWrap)
|
SETUP_FUNCTION(FaceRecognizerWrap)
|
||||||
|
|
||||||
|
|
||||||
@ -221,8 +215,7 @@ FaceRecognizerWrap::UpdateSync(const Arguments& args){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(FaceRecognizerWrap::PredictSync(const Arguments& args){
|
||||||
FaceRecognizerWrap::PredictSync(const Arguments& args){
|
|
||||||
SETUP_FUNCTION(FaceRecognizerWrap)
|
SETUP_FUNCTION(FaceRecognizerWrap)
|
||||||
|
|
||||||
cv::Mat im = fromMatrixOrFilename(args[0]);//TODO CHECK!
|
cv::Mat im = fromMatrixOrFilename(args[0]);//TODO CHECK!
|
||||||
@ -241,8 +234,7 @@ FaceRecognizerWrap::PredictSync(const Arguments& args){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(FaceRecognizerWrap::SaveSync(const Arguments& args){
|
||||||
FaceRecognizerWrap::SaveSync(const Arguments& args){
|
|
||||||
SETUP_FUNCTION(FaceRecognizerWrap)
|
SETUP_FUNCTION(FaceRecognizerWrap)
|
||||||
if (!args[0]->IsString()){
|
if (!args[0]->IsString()){
|
||||||
JSTHROW("Save takes a filename")
|
JSTHROW("Save takes a filename")
|
||||||
@ -252,8 +244,7 @@ FaceRecognizerWrap::SaveSync(const Arguments& args){
|
|||||||
return v8::Undefined();
|
return v8::Undefined();
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(FaceRecognizerWrap::LoadSync(const Arguments& args){
|
||||||
FaceRecognizerWrap::LoadSync(const Arguments& args){
|
|
||||||
SETUP_FUNCTION(FaceRecognizerWrap)
|
SETUP_FUNCTION(FaceRecognizerWrap)
|
||||||
if (!args[0]->IsString()){
|
if (!args[0]->IsString()){
|
||||||
JSTHROW("Load takes a filename")
|
JSTHROW("Load takes a filename")
|
||||||
@ -263,8 +254,7 @@ FaceRecognizerWrap::LoadSync(const Arguments& args){
|
|||||||
return v8::Undefined();
|
return v8::Undefined();
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(FaceRecognizerWrap::GetMat(const Arguments& args){
|
||||||
FaceRecognizerWrap::GetMat(const Arguments& args){
|
|
||||||
SETUP_FUNCTION(FaceRecognizerWrap)
|
SETUP_FUNCTION(FaceRecognizerWrap)
|
||||||
if (!args[0]->IsString()){
|
if (!args[0]->IsString()){
|
||||||
JSTHROW("getMat takes a key")
|
JSTHROW("getMat takes a key")
|
||||||
|
|||||||
@ -24,8 +24,7 @@ NamedWindow::Init(Handle<Object> target) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(NamedWindow::New() {
|
||||||
NamedWindow::New(const Arguments &args) {
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
if (args.This()->InternalFieldCount() == 0){
|
if (args.This()->InternalFieldCount() == 0){
|
||||||
@ -51,8 +50,7 @@ NamedWindow::NamedWindow(const std::string& name, int f){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(NamedWindow::Show(const v8::Arguments& args){
|
||||||
NamedWindow::Show(const v8::Arguments& args){
|
|
||||||
SETUP_FUNCTION(NamedWindow)
|
SETUP_FUNCTION(NamedWindow)
|
||||||
Matrix *im = ObjectWrap::Unwrap<Matrix>(args[0]->ToObject());
|
Matrix *im = ObjectWrap::Unwrap<Matrix>(args[0]->ToObject());
|
||||||
cv::imshow(self->winname, im->mat);
|
cv::imshow(self->winname, im->mat);
|
||||||
@ -60,16 +58,14 @@ NamedWindow::Show(const v8::Arguments& args){
|
|||||||
return scope.Close(args.Holder());
|
return scope.Close(args.Holder());
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(NamedWindow::Destroy(const v8::Arguments& args){
|
||||||
NamedWindow::Destroy(const v8::Arguments& args){
|
|
||||||
SETUP_FUNCTION(NamedWindow)
|
SETUP_FUNCTION(NamedWindow)
|
||||||
cv::destroyWindow(self->winname);
|
cv::destroyWindow(self->winname);
|
||||||
return scope.Close(args.Holder());
|
return scope.Close(args.Holder());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(NamedWindow::BlockingWaitKey(const v8::Arguments& args){
|
||||||
NamedWindow::BlockingWaitKey(const v8::Arguments& args){
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
//SETUP_FUNCTION(NamedWindow)
|
//SETUP_FUNCTION(NamedWindow)
|
||||||
int time = 0;
|
int time = 0;
|
||||||
|
|||||||
566
src/Matrix.cc
566
src/Matrix.cc
File diff suppressed because it is too large
Load Diff
@ -18,7 +18,7 @@ OpenCV::Init(Handle<Object> target) {
|
|||||||
|
|
||||||
|
|
||||||
Handle<Value>
|
Handle<Value>
|
||||||
OpenCV::ReadImage(const Arguments &args) {
|
OpenCV::ReadImage() {
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
try{
|
try{
|
||||||
|
|||||||
@ -22,11 +22,11 @@ using namespace node;
|
|||||||
|
|
||||||
|
|
||||||
#define SETUP_FUNCTION(TYP) \
|
#define SETUP_FUNCTION(TYP) \
|
||||||
HandleScope scope; \
|
NanScope(); \
|
||||||
TYP *self = ObjectWrap::Unwrap<TYP>(args.This());
|
TYP *self = ObjectWrap::Unwrap<TYP>(args.This());
|
||||||
|
|
||||||
#define JSFUNC(NAME) \
|
#define JSFUNC(NAME) \
|
||||||
NAN_METHOD(NAME);
|
static NAN_METHOD(NAME);
|
||||||
//static Handle<Value> NAME(const Arguments& args);
|
//static Handle<Value> NAME(const Arguments& args);
|
||||||
|
|
||||||
#define JSTHROW_TYPE(ERR) \
|
#define JSTHROW_TYPE(ERR) \
|
||||||
|
|||||||
12
src/Point.cc
12
src/Point.cc
@ -23,8 +23,7 @@ Point::Init(Handle<Object> target) {
|
|||||||
target->Set(String::NewSymbol("Point"), constructor->GetFunction());
|
target->Set(String::NewSymbol("Point"), constructor->GetFunction());
|
||||||
};
|
};
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(Point::New() {
|
||||||
Point::New(const Arguments &args) {
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
if (args.This()->InternalFieldCount() == 0)
|
if (args.This()->InternalFieldCount() == 0)
|
||||||
@ -38,15 +37,13 @@ Point::New(const Arguments &args) {
|
|||||||
return args.This();
|
return args.This();
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(Point::GetX(Local<String> prop, const AccessorInfo &info) {
|
||||||
Point::GetX(Local<String> prop, const AccessorInfo &info) {
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
Point *pt = ObjectWrap::Unwrap<Point>(info.This());
|
Point *pt = ObjectWrap::Unwrap<Point>(info.This());
|
||||||
return scope.Close(Number::New(pt->point.x));
|
return scope.Close(Number::New(pt->point.x));
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(Point::GetY(Local<String> prop, const AccessorInfo &info) {
|
||||||
Point::GetY(Local<String> prop, const AccessorInfo &info) {
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
Point *pt = ObjectWrap::Unwrap<Point>(info.This());
|
Point *pt = ObjectWrap::Unwrap<Point>(info.This());
|
||||||
return scope.Close(Number::New(pt->point.y));
|
return scope.Close(Number::New(pt->point.y));
|
||||||
@ -57,8 +54,7 @@ Point::RaiseImmutable(Local<String> property, Local<Value> value, const Accessor
|
|||||||
v8::ThrowException(v8::Exception::TypeError(v8::String::New("Point is immutable")));
|
v8::ThrowException(v8::Exception::TypeError(v8::String::New("Point is immutable")));
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(Point::Dot(const v8::Arguments& args){
|
||||||
Point::Dot(const v8::Arguments& args){
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
Point *p1 = ObjectWrap::Unwrap<Point>(args.This());
|
Point *p1 = ObjectWrap::Unwrap<Point>(args.This());
|
||||||
Point *p2 = ObjectWrap::Unwrap<Point>(args[0]->ToObject());
|
Point *p2 = ObjectWrap::Unwrap<Point>(args[0]->ToObject());
|
||||||
|
|||||||
@ -43,8 +43,7 @@ VideoCaptureWrap::Init(Handle<Object> target) {
|
|||||||
target->Set(String::NewSymbol("VideoCapture"), constructor->GetFunction());
|
target->Set(String::NewSymbol("VideoCapture"), constructor->GetFunction());
|
||||||
};
|
};
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(VideoCaptureWrap::New() {
|
||||||
VideoCaptureWrap::New(const Arguments &args) {
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
if (args.This()->InternalFieldCount() == 0)
|
if (args.This()->InternalFieldCount() == 0)
|
||||||
@ -85,8 +84,7 @@ VideoCaptureWrap::VideoCaptureWrap(const std::string& filename){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(VideoCaptureWrap::SetWidth(){
|
||||||
VideoCaptureWrap::SetWidth(const Arguments &args){
|
|
||||||
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
VideoCaptureWrap *v = ObjectWrap::Unwrap<VideoCaptureWrap>(args.This());
|
VideoCaptureWrap *v = ObjectWrap::Unwrap<VideoCaptureWrap>(args.This());
|
||||||
@ -102,8 +100,7 @@ VideoCaptureWrap::SetWidth(const Arguments &args){
|
|||||||
return scope.Close(Undefined());
|
return scope.Close(Undefined());
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(VideoCaptureWrap::SetHeight(){
|
||||||
VideoCaptureWrap::SetHeight(const Arguments &args){
|
|
||||||
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
VideoCaptureWrap *v = ObjectWrap::Unwrap<VideoCaptureWrap>(args.This());
|
VideoCaptureWrap *v = ObjectWrap::Unwrap<VideoCaptureWrap>(args.This());
|
||||||
@ -118,8 +115,7 @@ VideoCaptureWrap::SetHeight(const Arguments &args){
|
|||||||
return Undefined();
|
return Undefined();
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(VideoCaptureWrap::SetPosition(){
|
||||||
VideoCaptureWrap::SetPosition(const Arguments &args){
|
|
||||||
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
VideoCaptureWrap *v = ObjectWrap::Unwrap<VideoCaptureWrap>(args.This());
|
VideoCaptureWrap *v = ObjectWrap::Unwrap<VideoCaptureWrap>(args.This());
|
||||||
@ -134,8 +130,7 @@ VideoCaptureWrap::SetPosition(const Arguments &args){
|
|||||||
return Undefined();
|
return Undefined();
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(VideoCaptureWrap::Close(){
|
||||||
VideoCaptureWrap::Close(const Arguments &args){
|
|
||||||
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
VideoCaptureWrap *v = ObjectWrap::Unwrap<VideoCaptureWrap>(args.This());
|
VideoCaptureWrap *v = ObjectWrap::Unwrap<VideoCaptureWrap>(args.This());
|
||||||
@ -145,8 +140,7 @@ VideoCaptureWrap::Close(const Arguments &args){
|
|||||||
return Undefined();
|
return Undefined();
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(VideoCaptureWrap::Read() {
|
||||||
VideoCaptureWrap::Read(const Arguments &args) {
|
|
||||||
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
VideoCaptureWrap *v = ObjectWrap::Unwrap<VideoCaptureWrap>(args.This());
|
VideoCaptureWrap *v = ObjectWrap::Unwrap<VideoCaptureWrap>(args.This());
|
||||||
@ -197,8 +191,7 @@ void AfterAsyncRead(uv_work_t *req) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Handle<Value>
|
NAN_METHOD(VideoCaptureWrap::ReadSync() {
|
||||||
VideoCaptureWrap::ReadSync(const Arguments &args) {
|
|
||||||
|
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
VideoCaptureWrap *v = ObjectWrap::Unwrap<VideoCaptureWrap>(args.This());
|
VideoCaptureWrap *v = ObjectWrap::Unwrap<VideoCaptureWrap>(args.This());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user