#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 (args.Length() <= (I) || !args[I]->IsFunction()) \ return NanThrowTypeError("Argument " #I " must be a function"); \ Local VAR = Local::Cast(args[I]); #define SETUP_FUNCTION(TYP) \ NanScope(); \ TYP *self = ObjectWrap::Unwrap(args.This()); #define JSFUNC(NAME) \ static NAN_METHOD(NAME); #define JSTHROW_TYPE(ERR) \ NanThrowTypeError( ERR ); #define JSTHROW(ERR) \ NanThrowError( ERR ); #define INT_FROM_ARGS(NAME, IND) \ if (args[IND]->IsInt32()){ \ NAME = args[IND]->Uint32Value(); \ } #define DOUBLE_FROM_ARGS(NAME, IND) \ if (args[IND]->IsInt32()){ \ NAME = args[IND]->NumberValue(); \ } class OpenCV: public node::ObjectWrap{ public: static void Init(Handle target); static NAN_METHOD(ReadImage); }; #endif