allow thickness and color args for ellipse

This commit is contained in:
Contra 2012-11-13 09:27:29 -07:00 committed by Peter Braden
parent fa6e6b4da1
commit c50cdf35a4

View File

@ -415,13 +415,22 @@ Matrix::Ellipse(const v8::Arguments& args){
int y = args[1]->Uint32Value(); int y = args[1]->Uint32Value();
int width = args[2]->Uint32Value(); int width = args[2]->Uint32Value();
int height = args[3]->Uint32Value(); int height = args[3]->Uint32Value();
uint color = args[4]->Uint32Value(); cv::Scalar color(0, 0, 255);
cv::ellipse(self->mat, cv::Point(x, y), cv::Size(width, height), 0, 0, 360, if(args[4]->IsArray()) {
cv::Scalar( (color >> 16) & 0xff , (color >> 8) & 0xff, color & 0xff ), 4, 8, 0); Local<Object> objColor = args[4]->ToObject();
return scope.Close(v8::Null()); color = setColor(objColor);
} }
int thickness = 1;
if(args[5]->IntegerValue())
thickness = args[5]->IntegerValue();
cv::ellipse(self->mat, cv::Point(x, y), cv::Size(width, height), 0, 0, 360, color, thickness, 8, 0);
return scope.Close(v8::Null());
}
Handle<Value> Handle<Value>
Matrix::Rectangle(const Arguments& args) { Matrix::Rectangle(const Arguments& args) {