diff --git a/src/Matrix.cc b/src/Matrix.cc index ff8297f..06ff203 100755 --- a/src/Matrix.cc +++ b/src/Matrix.cc @@ -1984,8 +1984,9 @@ NAN_METHOD(Matrix::PutText) { } double scale = args.Length() < 6 ? 1 : args[5]->NumberValue(); + double thickness = args.Length() < 7 ? 1 : args[6]->NumberValue(); - cv::putText(self->mat, text, cv::Point(x, y), constFont, scale, color, 2); + cv::putText(self->mat, text, cv::Point(x, y), constFont, scale, color, thickness); NanReturnUndefined(); } diff --git a/test/unit.js b/test/unit.js index 5bb051f..3c8a8ee 100755 --- a/test/unit.js +++ b/test/unit.js @@ -252,8 +252,9 @@ test("fonts", function(t) { return Math.round(Math.random() * 255); }; - cv.readImage('./examples/files/coin1.jpg', function(e, im){ + cv.readImage("./examples/files/coin1.jpg", function(e, im){ var y = 0; + var scale = 1; ([ "HERSEY_SIMPLEX", @@ -266,11 +267,11 @@ test("fonts", function(t) { "HERSEY_SCRIPT_COMPLEX", "HERSEY_SCRIPT_SIMPLEX" ]).forEach(function(font) { - im.putText("Some text", 0, y += 20, font, [rnd(), rnd(), rnd()]); + im.putText("Some text", 0, y += 20, font, [rnd(), rnd(), rnd()], 2, scale++); }); - t.ok(im, "image is ok") - //im.save("./examples/tmp/coin1-with-text.jpg"); + t.ok(im, "image is ok"); + im.save("./examples/tmp/coin1-with-text.jpg"); t.end(); }); })