1+ #include < opencv2/core.hpp>
2+ #include " coreUtils.h"
3+ #include " NativeNodeUtils.h"
4+ #include " macros.h"
5+
6+ #ifndef __FF_Vec6_H__
7+ #define __FF_Vec6_H__
8+
9+ class Vec6 : public FF ::ObjectWrap<Vec6, cv::Vec6d> {
10+ public:
11+ static Nan::Persistent<v8::FunctionTemplate> constructor;
12+
13+ static const char * getClassName () {
14+ return " Vec6" ;
15+ }
16+
17+ static NAN_METHOD (New) {
18+ Vec6* self = new Vec6 ();
19+ self->Wrap (info.Holder ());
20+ info.GetReturnValue ().Set (info.Holder ());
21+ }
22+
23+ static void Init (v8::Local<v8::FunctionTemplate> ctor) {
24+ FF_PROTO_SET_MATRIX_OPERATIONS (ctor);
25+ }
26+
27+ FF_GETTER_CUSTOM (u, FF ::DoubleConverter, self[0 ]);
28+ FF_GETTER_CUSTOM (v, FF ::DoubleConverter, self[1 ]);
29+ FF_GETTER_CUSTOM (w, FF ::DoubleConverter, self[2 ]);
30+ FF_GETTER_CUSTOM (x, FF ::DoubleConverter, self[3 ]);
31+ FF_GETTER_CUSTOM (y, FF ::DoubleConverter, self[4 ]);
32+ FF_GETTER_CUSTOM (z, FF ::DoubleConverter, self[5 ]);
33+
34+ FF_INIT_VEC6_OPERATIONS ();
35+ static NAN_METHOD (Dot) {
36+ FF_OPERATOR_RET_SCALAR (&cv::Vec6d::dot, FF_APPLY_CLASS_FUNC , Vec6, " Dot" );
37+ }
38+ static NAN_METHOD (Norm) {
39+ info.GetReturnValue ().Set (Nan::New (cv::norm (Vec6::unwrapSelf (info))));
40+ }
41+
42+ static NAN_METHOD (At) {
43+ FF ::TryCatch tryCatch (" Vec6::At" );
44+ FF_ASSERT_INDEX_RANGE (info[0 ]->ToInt32 (Nan::GetCurrentContext ()).ToLocalChecked ()->Value (), 5 , " Vec6" );
45+ cv::Vec6d vecSelf = Vec6::unwrapSelf (info);
46+ info.GetReturnValue ().Set (vecSelf[info[0 ]->ToInt32 (Nan::GetCurrentContext ()).ToLocalChecked ()->Value ()]);
47+ }
48+ };
49+
50+ #endif
0 commit comments