#ifndef __NODE_OPENCV_H__ #define __NODE_OPENCV_H__ #include #include #include #include #include #include #include #include #include using namespace v8; using namespace node; #define REQ_FUN_ARG(I, VAR) \ if (info.Length() <= (I) || !info[I]->IsFunction()) \ return Nan::ThrowTypeError("Argument " #I " must be a function"); \ Local VAR = Local::Cast(info[I]); #define SETUP_FUNCTION(TYP) \ Nan::HandleScope scope; \ TYP *self = Nan::ObjectWrap::Unwrap(info.This()); #define JSFUNC(NAME) \ static NAN_METHOD(NAME); #define JSTHROW_TYPE(ERR) \ Nan::ThrowTypeError( ERR ); #define JSTHROW(ERR) \ Nan::ThrowError( ERR ); #define INT_FROM_ARGS(NAME, IND) \ if (info[IND]->IsInt32()){ \ NAME = info[IND]->Uint32Value(); \ } #define DOUBLE_FROM_ARGS(NAME, IND) \ if (info[IND]->IsInt32()){ \ NAME = info[IND]->NumberValue(); \ } class OpenCV: public Nan::ObjectWrap { public: static void Init(Local target); static NAN_METHOD(ReadImage); }; #endif