Skip to content

Commit 33976a9

Browse files
author
Michael Vines
authored
Merge pull request #439 from silklabs/fix-getData-elemsize
make getData() work if we have more than one channel
2 parents 6f62e4a + 9a2b3c3 commit 33976a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Matrix.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ NAN_METHOD(Matrix::GetData) {
317317
Nan::HandleScope scope;
318318

319319
Matrix *self = Nan::ObjectWrap::Unwrap<Matrix>(info.This());
320-
int size = self->mat.rows * self->mat.cols * self->mat.elemSize1();
320+
int size = self->mat.rows * self->mat.cols * self->mat.elemSize();
321321
Local<Object> buf = Nan::NewBuffer(size).ToLocalChecked();
322322
uchar* data = (uchar*) Buffer::Data(buf);
323323
// if there is padding after each row, clone first to get rid of it

0 commit comments

Comments
 (0)