Skip to content

Commit 8450cfa

Browse files
committed
Moved up method within class.
1 parent 0f482b7 commit 8450cfa

2 files changed

Lines changed: 21 additions & 21 deletions

File tree

ReadMagicCard/DrawingHelper.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,6 @@ DrawingHelper::~DrawingHelper()
1919
delete converter;
2020
}
2121

22-
Mat DrawingHelper::DrawLine(const Mat image, Point point1, Point point2, Colour colour, int borderThickness) {
23-
24-
//Create a working RGB image so the border lines are colour even if the image isn't.
25-
Mat outImage = converter->ToColourImage(image);
26-
Scalar sColour = converter->ToScalarColour(colour);
27-
28-
line(outImage, point1, point2, sColour, borderThickness, DEFAULT_BORDER_THICKNESS);
29-
30-
return outImage;
31-
}
32-
33-
Mat DrawingHelper::DrawLine(const Mat image, TrendLine line, Colour colour, int borderThickness) {
34-
35-
vector<Point2d> points = line.GetEndPoints(0, image.cols);
36-
Mat outImage = DrawLine(image, points[0], points[1], colour, borderThickness);
37-
38-
return outImage;
39-
}
40-
4122
Mat DrawingHelper::DrawLimits(const Mat image, const Contour contourLimit, const RotatedRect rotatedRectangleLimit, const Rect straightRectangleLimit)
4223
{
4324
//Create a working RGB image so the border lines are colour even if the image isn't.
@@ -61,6 +42,25 @@ Mat DrawingHelper::DrawLimits(const Mat image, const Contour contourLimit, const
6142
return workingImage;
6243
}
6344

45+
Mat DrawingHelper::DrawLine(const Mat image, Point point1, Point point2, Colour colour, int borderThickness) {
46+
47+
//Create a working RGB image so the border lines are colour even if the image isn't.
48+
Mat outImage = converter->ToColourImage(image);
49+
Scalar sColour = converter->ToScalarColour(colour);
50+
51+
line(outImage, point1, point2, sColour, borderThickness, DEFAULT_BORDER_THICKNESS);
52+
53+
return outImage;
54+
}
55+
56+
Mat DrawingHelper::DrawLine(const Mat image, TrendLine line, Colour colour, int borderThickness) {
57+
58+
vector<Point2d> points = line.GetEndPoints(0, image.cols);
59+
Mat outImage = DrawLine(image, points[0], points[1], colour, borderThickness);
60+
61+
return outImage;
62+
}
63+
6464
Mat DrawingHelper::DrawRectangle(const Mat image, const RotatedRect rectangle, Colour colour) {
6565

6666
Mat workingImage = converter->ToColourImage(image);

ReadMagicCard/DrawingHelper.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ class DrawingHelper
1515
//The line type (8-connected line, aka "solid") of borders drawn on images for debugging.
1616
static const int DEFAULT_BORDER_LINE_TYPE;
1717

18+
//Draws the specified limits on an image.
19+
cv::Mat DrawLimits(const cv::Mat image, const Contour contourLimit = Contour(), const cv::RotatedRect rotatedRectangleLimit = cv::RotatedRect(), const cv::Rect straightRectangleLimit = cv::Rect());
1820
//Draws a line between two points on an image.
1921
cv::Mat DrawLine(const cv::Mat image, cv::Point point1, cv::Point point2, Colour colour = Orange, int borderThickness = DEFAULT_BORDER_THICKNESS);
2022
//Draws a line on an image.
2123
cv::Mat DrawLine(const cv::Mat image, TrendLine line, Colour colour = Orange, int borderThickness = DEFAULT_BORDER_THICKNESS);
22-
//Draws the specified limits on an image.
23-
cv::Mat DrawLimits(const cv::Mat image, const Contour contourLimit = Contour(), const cv::RotatedRect rotatedRectangleLimit = cv::RotatedRect(), const cv::Rect straightRectangleLimit = cv::Rect());
2424
//Draws a rectangle on an image.
2525
cv::Mat DrawRectangle(const cv::Mat image, const cv::RotatedRect rectangle, Colour colour = DarkBlue);
2626
//Draws a rectangle on an image.

0 commit comments

Comments
 (0)