From c80577f039c29ae6269d9d04a3bcd5e87c933ed5 Mon Sep 17 00:00:00 2001 From: Ollie Relph Date: Thu, 20 Oct 2016 11:19:45 +0100 Subject: [PATCH] Add support for lineType and offset for drawContours --- src/Matrix.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Matrix.cc b/src/Matrix.cc index faff68d..a70c125 100755 --- a/src/Matrix.cc +++ b/src/Matrix.cc @@ -1486,7 +1486,16 @@ NAN_METHOD(Matrix::DrawContour) { } int thickness = info.Length() < 4 ? 1 : info[3]->NumberValue(); - cv::drawContours(self->mat, cont->contours, pos, color, thickness); + int lineType = info.Length() < 5 ? 8 : info[4]->NumberValue(); + int maxLevel = 0; + + cv::Point offset; + if (info.Length() == 6) { + Local _offset = Local::Cast(info[5]); + offset = cv::Point(_offset->Get(0)->ToNumber()->Value(), _offset->Get(1)->ToNumber()->Value()); + } + + cv::drawContours(self->mat, cont->contours, pos, color, thickness, lineType, cv::noArray(), maxLevel, offset); return; }