mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
Exposed a bunch of OpenCV type constants.
This commit is contained in:
parent
21afdcd787
commit
ede3feaf3d
@ -13,6 +13,7 @@
|
||||
, "src/HighGUI.cc"
|
||||
, "src/FaceRecognizer.cc"
|
||||
, "src/BackgroundSubtractor.cc"
|
||||
, "src/Constants.cc"
|
||||
]
|
||||
, 'libraries': [
|
||||
'<!@(pkg-config --libs opencv)'
|
||||
@ -47,4 +48,3 @@
|
||||
]
|
||||
}]
|
||||
}
|
||||
|
||||
|
||||
58
src/Constants.cc
Normal file
58
src/Constants.cc
Normal file
@ -0,0 +1,58 @@
|
||||
#include "OpenCV.h"
|
||||
#include "Constants.h"
|
||||
|
||||
#define CONST(C) inner->Set(String::NewSymbol(#C), Integer::New(C));
|
||||
|
||||
void
|
||||
Constants::Init(Handle<Object> target) {
|
||||
|
||||
Persistent<Object> inner = Persistent<Object>::New(Object::New());
|
||||
|
||||
CONST(CV_8U);
|
||||
CONST(CV_8S);
|
||||
CONST(CV_16U);
|
||||
CONST(CV_16S);
|
||||
CONST(CV_32S);
|
||||
CONST(CV_32F);
|
||||
CONST(CV_64F);
|
||||
CONST(CV_USRTYPE1);
|
||||
|
||||
CONST(CV_8UC1);
|
||||
CONST(CV_8UC2);
|
||||
CONST(CV_8UC3);
|
||||
CONST(CV_8UC4);
|
||||
|
||||
CONST(CV_8SC1);
|
||||
CONST(CV_8SC2);
|
||||
CONST(CV_8SC3);
|
||||
CONST(CV_8SC4);
|
||||
|
||||
CONST(CV_16UC1);
|
||||
CONST(CV_16UC2);
|
||||
CONST(CV_16UC3);
|
||||
CONST(CV_16UC4);
|
||||
|
||||
CONST(CV_16SC1);
|
||||
CONST(CV_16SC2);
|
||||
CONST(CV_16SC3);
|
||||
CONST(CV_16SC4);
|
||||
|
||||
CONST(CV_32SC1);
|
||||
CONST(CV_32SC2);
|
||||
CONST(CV_32SC3);
|
||||
CONST(CV_32SC4);
|
||||
|
||||
CONST(CV_32FC1);
|
||||
CONST(CV_32FC2);
|
||||
CONST(CV_32FC3);
|
||||
CONST(CV_32FC4);
|
||||
|
||||
CONST(CV_64FC1);
|
||||
CONST(CV_64FC2);
|
||||
CONST(CV_64FC3);
|
||||
CONST(CV_64FC4);
|
||||
|
||||
target->Set(String::NewSymbol("Constants"), inner);
|
||||
}
|
||||
|
||||
#undef CONST
|
||||
6
src/Constants.h
Normal file
6
src/Constants.h
Normal file
@ -0,0 +1,6 @@
|
||||
#include "OpenCV.h"
|
||||
|
||||
class Constants: public node::ObjectWrap {
|
||||
public:
|
||||
static void Init(Handle<Object> target);
|
||||
};
|
||||
@ -7,6 +7,7 @@
|
||||
#include "CamShift.h"
|
||||
#include "HighGUI.h"
|
||||
#include "FaceRecognizer.h"
|
||||
#include "Constants.h"
|
||||
|
||||
|
||||
extern "C" void
|
||||
@ -20,6 +21,8 @@ init(Handle<Object> target) {
|
||||
Contour::Init(target);
|
||||
TrackedObject::Init(target);
|
||||
NamedWindow::Init(target);
|
||||
Constants::Init(target);
|
||||
|
||||
|
||||
#if CV_MAJOR_VERSION >= 2 && CV_MINOR_VERSION >=4
|
||||
FaceRecognizerWrap::Init(target);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user