Commit c684da35 authored by Konstantin Matskevich's avatar Konstantin Matskevich

drawing

parent 92c8b94b
...@@ -507,11 +507,11 @@ CV_EXPORTS_W void randn(InputOutputArray dst, InputArray mean, InputArray stddev ...@@ -507,11 +507,11 @@ CV_EXPORTS_W void randn(InputOutputArray dst, InputArray mean, InputArray stddev
CV_EXPORTS_W void randShuffle(InputOutputArray dst, double iterFactor = 1., RNG* rng = 0); CV_EXPORTS_W void randShuffle(InputOutputArray dst, double iterFactor = 1., RNG* rng = 0);
//! draws the line segment (pt1, pt2) in the image //! draws the line segment (pt1, pt2) in the image
CV_EXPORTS_W void line(CV_IN_OUT Mat& img, Point pt1, Point pt2, const Scalar& color, CV_EXPORTS_W void line(CV_IN_OUT InputOutputArray img, Point pt1, Point pt2, const Scalar& color,
int thickness = 1, int lineType = LINE_8, int shift = 0); int thickness = 1, int lineType = LINE_8, int shift = 0);
//! draws the rectangle outline or a solid rectangle with the opposite corners pt1 and pt2 in the image //! draws the rectangle outline or a solid rectangle with the opposite corners pt1 and pt2 in the image
CV_EXPORTS_W void rectangle(CV_IN_OUT Mat& img, Point pt1, Point pt2, CV_EXPORTS_W void rectangle(CV_IN_OUT InputOutputArray img, Point pt1, Point pt2,
const Scalar& color, int thickness = 1, const Scalar& color, int thickness = 1,
int lineType = LINE_8, int shift = 0); int lineType = LINE_8, int shift = 0);
...@@ -521,18 +521,18 @@ CV_EXPORTS void rectangle(CV_IN_OUT Mat& img, Rect rec, ...@@ -521,18 +521,18 @@ CV_EXPORTS void rectangle(CV_IN_OUT Mat& img, Rect rec,
int lineType = LINE_8, int shift = 0); int lineType = LINE_8, int shift = 0);
//! draws the circle outline or a solid circle in the image //! draws the circle outline or a solid circle in the image
CV_EXPORTS_W void circle(CV_IN_OUT Mat& img, Point center, int radius, CV_EXPORTS_W void circle(CV_IN_OUT InputOutputArray img, Point center, int radius,
const Scalar& color, int thickness = 1, const Scalar& color, int thickness = 1,
int lineType = LINE_8, int shift = 0); int lineType = LINE_8, int shift = 0);
//! draws an elliptic arc, ellipse sector or a rotated ellipse in the image //! draws an elliptic arc, ellipse sector or a rotated ellipse in the image
CV_EXPORTS_W void ellipse(CV_IN_OUT Mat& img, Point center, Size axes, CV_EXPORTS_W void ellipse(CV_IN_OUT InputOutputArray img, Point center, Size axes,
double angle, double startAngle, double endAngle, double angle, double startAngle, double endAngle,
const Scalar& color, int thickness = 1, const Scalar& color, int thickness = 1,
int lineType = LINE_8, int shift = 0); int lineType = LINE_8, int shift = 0);
//! draws a rotated ellipse in the image //! draws a rotated ellipse in the image
CV_EXPORTS_W void ellipse(CV_IN_OUT Mat& img, const RotatedRect& box, const Scalar& color, CV_EXPORTS_W void ellipse(CV_IN_OUT InputOutputArray img, const RotatedRect& box, const Scalar& color,
int thickness = 1, int lineType = LINE_8); int thickness = 1, int lineType = LINE_8);
//! draws a filled convex polygon in the image //! draws a filled convex polygon in the image
...@@ -582,7 +582,7 @@ CV_EXPORTS_W void ellipse2Poly( Point center, Size axes, int angle, ...@@ -582,7 +582,7 @@ CV_EXPORTS_W void ellipse2Poly( Point center, Size axes, int angle,
CV_OUT std::vector<Point>& pts ); CV_OUT std::vector<Point>& pts );
//! renders text string in the image //! renders text string in the image
CV_EXPORTS_W void putText( Mat& img, const String& text, Point org, CV_EXPORTS_W void putText( InputOutputArray img, const String& text, Point org,
int fontFace, double fontScale, Scalar color, int fontFace, double fontScale, Scalar color,
int thickness = 1, int lineType = LINE_8, int thickness = 1, int lineType = LINE_8,
bool bottomLeftOrigin = false ); bool bottomLeftOrigin = false );
......
...@@ -1568,9 +1568,11 @@ PolyLine( Mat& img, const Point* v, int count, bool is_closed, ...@@ -1568,9 +1568,11 @@ PolyLine( Mat& img, const Point* v, int count, bool is_closed,
* External functions * * External functions *
\****************************************************************************************/ \****************************************************************************************/
void line( Mat& img, Point pt1, Point pt2, const Scalar& color, void line( InputOutputArray _img, Point pt1, Point pt2, const Scalar& color,
int thickness, int line_type, int shift ) int thickness, int line_type, int shift )
{ {
Mat img = _img.getMat();
if( line_type == CV_AA && img.depth() != CV_8U ) if( line_type == CV_AA && img.depth() != CV_8U )
line_type = 8; line_type = 8;
...@@ -1582,10 +1584,12 @@ void line( Mat& img, Point pt1, Point pt2, const Scalar& color, ...@@ -1582,10 +1584,12 @@ void line( Mat& img, Point pt1, Point pt2, const Scalar& color,
ThickLine( img, pt1, pt2, buf, thickness, line_type, 3, shift ); ThickLine( img, pt1, pt2, buf, thickness, line_type, 3, shift );
} }
void rectangle( Mat& img, Point pt1, Point pt2, void rectangle( InputOutputArray _img, Point pt1, Point pt2,
const Scalar& color, int thickness, const Scalar& color, int thickness,
int lineType, int shift ) int lineType, int shift )
{ {
Mat img = _img.getMat();
if( lineType == CV_AA && img.depth() != CV_8U ) if( lineType == CV_AA && img.depth() != CV_8U )
lineType = 8; lineType = 8;
...@@ -1622,9 +1626,11 @@ void rectangle( Mat& img, Rect rec, ...@@ -1622,9 +1626,11 @@ void rectangle( Mat& img, Rect rec,
} }
void circle( Mat& img, Point center, int radius, void circle( InputOutputArray _img, Point center, int radius,
const Scalar& color, int thickness, int line_type, int shift ) const Scalar& color, int thickness, int line_type, int shift )
{ {
Mat img = _img.getMat();
if( line_type == CV_AA && img.depth() != CV_8U ) if( line_type == CV_AA && img.depth() != CV_8U )
line_type = 8; line_type = 8;
...@@ -1647,10 +1653,12 @@ void circle( Mat& img, Point center, int radius, ...@@ -1647,10 +1653,12 @@ void circle( Mat& img, Point center, int radius,
} }
void ellipse( Mat& img, Point center, Size axes, void ellipse( InputOutputArray _img, Point center, Size axes,
double angle, double start_angle, double end_angle, double angle, double start_angle, double end_angle,
const Scalar& color, int thickness, int line_type, int shift ) const Scalar& color, int thickness, int line_type, int shift )
{ {
Mat img = _img.getMat();
if( line_type == CV_AA && img.depth() != CV_8U ) if( line_type == CV_AA && img.depth() != CV_8U )
line_type = 8; line_type = 8;
...@@ -1672,9 +1680,11 @@ void ellipse( Mat& img, Point center, Size axes, ...@@ -1672,9 +1680,11 @@ void ellipse( Mat& img, Point center, Size axes,
_end_angle, buf, thickness, line_type ); _end_angle, buf, thickness, line_type );
} }
void ellipse(Mat& img, const RotatedRect& box, const Scalar& color, void ellipse(InputOutputArray _img, const RotatedRect& box, const Scalar& color,
int thickness, int lineType) int thickness, int lineType)
{ {
Mat img = _img.getMat();
if( lineType == CV_AA && img.depth() != CV_8U ) if( lineType == CV_AA && img.depth() != CV_8U )
lineType = 8; lineType = 8;
...@@ -1918,11 +1928,12 @@ static const int* getFontData(int fontFace) ...@@ -1918,11 +1928,12 @@ static const int* getFontData(int fontFace)
} }
void putText( Mat& img, const String& text, Point org, void putText( InputOutputArray _img, const String& text, Point org,
int fontFace, double fontScale, Scalar color, int fontFace, double fontScale, Scalar color,
int thickness, int line_type, bool bottomLeftOrigin ) int thickness, int line_type, bool bottomLeftOrigin )
{ {
Mat img = _img.getMat();
const int* ascii = getFontData(fontFace); const int* ascii = getFontData(fontFace);
double buf[4]; double buf[4];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment