Companion  1.0.0
Companion is an object recognition framework written with OpenCV.
Public Member Functions | List of all members
Companion::Draw::Line Class Reference

#include <Line.h>

Inheritance diagram for Companion::Draw::Line:
Inheritance graph
[legend]
Collaboration diagram for Companion::Draw::Line:
Collaboration graph
[legend]

Public Member Functions

 Line (cv::Point start, cv::Point end, cv::Scalar color=cv::Scalar(0.0, 255.0, 0.0, 255.0), int thickness=4)
 
virtual void Draw (cv::Mat image)
 
virtual void Ratio (int cWidth, int cHeight, int nWidth, int nHeight)
 
virtual cv::Rect CutArea ()
 
virtual int OriginX ()
 
virtual int OriginY ()
 
virtual void MoveOrigin (int x, int y)
 
virtual void Color (const cv::Scalar &color)
 
virtual const cv::Scalar & Color () const
 
virtual void Thickness (int thickness)
 
virtual int Thickness () const
 
const cv::Point & Start () const
 
void Start (const cv::Point &start)
 
const cv::Point & End () const
 
void End (const cv::Point &end)
 

Detailed Description

Class implementation for a drawable line.

Author
Andreas Sekulski, Dimitri Kotlovsky

Constructor & Destructor Documentation

◆ Line()

Companion::Draw::Line::Line ( cv::Point  start,
cv::Point  end,
cv::Scalar  color = cv::Scalar(0.0, 255.0, 0.0, 255.0),
int  thickness = 4 
)

Constructor to create a drawable line.

Parameters
startStarting position of the line.
endEnding position of the line.
colorColor of the line.
thicknessThickness of the line.

Member Function Documentation

◆ Color() [1/2]

void Companion::Draw::Line::Color ( const cv::Scalar &  color)
virtual

Set line color.

Parameters
colorLine color to set.

Implements Companion::Draw::Drawable.

◆ Color() [2/2]

const cv::Scalar & Companion::Draw::Line::Color ( ) const
virtual

Get the color of the line.

Returns
Line color.

Implements Companion::Draw::Drawable.

◆ CutArea()

cv::Rect Companion::Draw::Line::CutArea ( )
virtual

Get cut area around this line.

Returns
Cut area around this line as a cv::Rect.

Implements Companion::Draw::Drawable.

◆ Draw()

void Companion::Draw::Line::Draw ( cv::Mat  image)
virtual

Draw this line to the given image.

Parameters
imageImage on which to draw the object.

Implements Companion::Draw::Drawable.

◆ End() [1/2]

const cv::Point & Companion::Draw::Line::End ( ) const

Get endpoint of this line.

Returns
Endpoint of this line.

◆ End() [2/2]

void Companion::Draw::Line::End ( const cv::Point &  end)

Set a given endpoint for this line.

Parameters
endEndpoint to set for this line.

◆ MoveOrigin()

void Companion::Draw::Line::MoveOrigin ( int  x,
int  y 
)
virtual

Move the line's origin.

Parameters
xRelative distance to move the origin on the x axis.
yRelative distance to move the origin on the y axis.

Implements Companion::Draw::Drawable.

◆ OriginX()

int Companion::Draw::Line::OriginX ( )
virtual

Obtain the origin's x coordinate.

Returns
X coordinate of the line's origin.

Implements Companion::Draw::Drawable.

◆ OriginY()

int Companion::Draw::Line::OriginY ( )
virtual

Obtain the origin's y coordinate.

Returns
Y coordinate of the line's origin.

Implements Companion::Draw::Drawable.

◆ Ratio()

void Companion::Draw::Line::Ratio ( int  cWidth,
int  cHeight,
int  nWidth,
int  nHeight 
)
virtual

Scale this line from the current image size to a new image size.

Parameters
cWidthCurrent image width.
cHeightCurrent image height.
nWidthNew image width.
nHeightNew image height.

Implements Companion::Draw::Drawable.

◆ Start() [1/2]

const cv::Point & Companion::Draw::Line::Start ( ) const

Get starting point of this line.

Returns
Starting point of this line.

◆ Start() [2/2]

void Companion::Draw::Line::Start ( const cv::Point &  start)

Set a given starting point for this line.

Parameters
startStarting point to set for this line.

◆ Thickness() [1/2]

void Companion::Draw::Line::Thickness ( int  thickness)
virtual

Set thickness of the line.

Parameters
thicknessLine thickness.

Implements Companion::Draw::Drawable.

◆ Thickness() [2/2]

int Companion::Draw::Line::Thickness ( ) const
virtual

Get thickness of this line, if 0 no line will be drawn.

Returns
Line thickness.

Implements Companion::Draw::Drawable.


The documentation for this class was generated from the following files: