mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
Revert "Added Zeros, Ones constructors"
This reverts commit ee3ae4c1968b1acd54d389bac742c5c6d8e32ca3.
This commit is contained in:
parent
20efb8313b
commit
d4b9d0edff
@ -108,9 +108,7 @@ Matrix::Init(Handle<Object> target) {
|
||||
NODE_SET_PROTOTYPE_METHOD(constructor, "getPerspectiveTransform", GetPerspectiveTransform);
|
||||
NODE_SET_PROTOTYPE_METHOD(constructor, "warpPerspective", WarpPerspective);
|
||||
|
||||
NODE_SET_METHOD(constructor, "Zeros", Zeros);
|
||||
NODE_SET_METHOD(constructor, "Ones", Ones);
|
||||
NODE_SET_METHOD(constructor, "Eye", Eye);
|
||||
NODE_SET_METHOD(constructor, "Eye", Eye);
|
||||
|
||||
NODE_SET_PROTOTYPE_METHOD(constructor, "copyWithMask", CopyWithMask);
|
||||
NODE_SET_PROTOTYPE_METHOD(constructor, "setWithMask", SetWithMask);
|
||||
@ -822,37 +820,6 @@ void AfterSaveAsync(uv_work_t *req) {
|
||||
delete baton;
|
||||
}
|
||||
|
||||
Handle<Value>
|
||||
Matrix::Zeros(const v8::Arguments& args){
|
||||
HandleScope scope;
|
||||
|
||||
int w = args[0]->Uint32Value();
|
||||
int h = args[1]->Uint32Value();
|
||||
int type = (args.Length() > 2) ? args[2]->IntegerValue() : CV_64FC1;
|
||||
|
||||
Local<Object> im_h = Matrix::constructor->GetFunction()->NewInstance();
|
||||
Matrix *img = ObjectWrap::Unwrap<Matrix>(im_h);
|
||||
cv::Mat mat = cv::Mat::zeros(w, h, type);
|
||||
|
||||
img->mat = mat;
|
||||
return scope.Close(im_h);
|
||||
}
|
||||
|
||||
Handle<Value>
|
||||
Matrix::Ones(const v8::Arguments& args){
|
||||
HandleScope scope;
|
||||
|
||||
int w = args[0]->Uint32Value();
|
||||
int h = args[1]->Uint32Value();
|
||||
int type = (args.Length() > 2) ? args[2]->IntegerValue() : CV_64FC1;
|
||||
|
||||
Local<Object> im_h = Matrix::constructor->GetFunction()->NewInstance();
|
||||
Matrix *img = ObjectWrap::Unwrap<Matrix>(im_h);
|
||||
cv::Mat mat = cv::Mat::ones(w, h, type);
|
||||
|
||||
img->mat = mat;
|
||||
return scope.Close(im_h);
|
||||
}
|
||||
|
||||
Handle<Value>
|
||||
Matrix::Eye(const v8::Arguments& args){
|
||||
@ -860,16 +827,16 @@ Matrix::Eye(const v8::Arguments& args){
|
||||
|
||||
int w = args[0]->Uint32Value();
|
||||
int h = args[1]->Uint32Value();
|
||||
int type = (args.Length() > 2) ? args[2]->IntegerValue() : CV_64FC1;
|
||||
|
||||
Local<Object> im_h = Matrix::constructor->GetFunction()->NewInstance();
|
||||
Matrix *img = ObjectWrap::Unwrap<Matrix>(im_h);
|
||||
cv::Mat mat = cv::Mat::eye(w, h, type);
|
||||
cv::Mat mat = cv::Mat::eye(w, h, CV_64FC1);
|
||||
|
||||
img->mat = mat;
|
||||
return scope.Close(im_h);
|
||||
}
|
||||
|
||||
|
||||
Handle<Value>
|
||||
Matrix::ConvertGrayscale(const v8::Arguments& args) {
|
||||
HandleScope scope;
|
||||
|
||||
@ -14,8 +14,6 @@ class Matrix: public node::ObjectWrap {
|
||||
|
||||
static double DblGet(cv::Mat mat, int i, int j);
|
||||
|
||||
JSFUNC(Zeros) // factory
|
||||
JSFUNC(Ones) // factory
|
||||
JSFUNC(Eye) // factory
|
||||
|
||||
JSFUNC(Get) // at
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user