homog2d library
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
h2d::img::DrawParams Class Reference

Draw parameters, independent of back-end library. More...

#include <homog2d.hpp>

Collaboration diagram for h2d::img::DrawParams:
Collaboration graph
[legend]

Public Member Functions

Color color () const
 
cv::Scalar cvColor () const
 
 DrawParams ()
 
DrawParamsselectPoint ()
 
DrawParamssetAttrString (std::string attr)
 Add some specific SVG attributes (ignored for Opencv renderings) More...
 
DrawParamssetColor (uint8_t r, uint8_t g, uint8_t b)
 
DrawParamssetColor (Color col)
 
void setDefault ()
 
DrawParamssetFontSize (int value)
 Set font size for drawText() More...
 
DrawParamssetPointSize (uint8_t ps)
 
DrawParamssetPointStyle (PtStyle ps)
 
DrawParamssetThickness (uint8_t t)
 
DrawParamsshowAngles (bool b=true)
 Set or unset the drawing of angles of polylines. More...
 
DrawParamsshowIndex (bool b=true)
 Set or unset the drawing of points (useful only for Segment_ and Polyline_) More...
 
DrawParamsshowPoints (bool b=true)
 Set or unset the drawing of points (useful only for Segment_ and Polyline_) More...
 

Static Public Member Functions

static void resetDefault ()
 

Public Attributes

Dp_values _dpValues
 

Friends

template<typename T , typename U >
class h2d::base::LPBase
 
template<typename T , typename U >
class h2d::base::PolylineBase
 
template<typename T , typename U >
class h2d::base::SegVec
 
template<typename T >
class h2d::Circle_
 
template<typename T >
class h2d::Ellipse_
 
template<typename T >
class h2d::FRect_
 
std::ostream & operator<< (std::ostream &f, const DrawParams &dp)
 

Detailed Description

Draw parameters, independent of back-end library.

Constructor & Destructor Documentation

◆ DrawParams()

h2d::img::DrawParams::DrawParams ( )
inline
574  {
575  _dpValues = p_getDefault();
576  }
Dp_values _dpValues
Definition: homog2d.hpp:563

Member Function Documentation

◆ color()

Color h2d::img::DrawParams::color ( ) const
inline
655  {
656  return _dpValues._color;
657  }
Dp_values _dpValues
Definition: homog2d.hpp:563
Here is the caller graph for this function:

◆ cvColor()

cv::Scalar h2d::img::DrawParams::cvColor ( ) const
inline
661  {
662  return cv::Scalar( _dpValues._color.b, _dpValues._color.g, _dpValues._color.r );
663  }
Dp_values _dpValues
Definition: homog2d.hpp:563
Here is the caller graph for this function:

◆ resetDefault()

static void h2d::img::DrawParams::resetDefault ( )
inlinestatic
582  {
583  p_getDefault() = Dp_values();
584  }

◆ selectPoint()

DrawParams& h2d::img::DrawParams::selectPoint ( )
inline
616  {
617  _dpValues._enhancePoint = true;
618  return *this;
619  }
Dp_values _dpValues
Definition: homog2d.hpp:563
Here is the caller graph for this function:

◆ setAttrString()

DrawParams& h2d::img::DrawParams::setAttrString ( std::string  attr)
inline

Add some specific SVG attributes (ignored for Opencv renderings)

See also
getAttrString()
649  {
650  _dpValues._attrString = attr;
651  return *this;
652  }
Dp_values _dpValues
Definition: homog2d.hpp:563

◆ setColor() [1/2]

DrawParams& h2d::img::DrawParams::setColor ( uint8_t  r,
uint8_t  g,
uint8_t  b 
)
inline
606  {
607  _dpValues._color = Color{r,g,b};
608  return *this;
609  }
Dp_values _dpValues
Definition: homog2d.hpp:563
Here is the caller graph for this function:

◆ setColor() [2/2]

DrawParams& h2d::img::DrawParams::setColor ( Color  col)
inline
611  {
612  _dpValues._color = col;
613  return *this;
614  }
Dp_values _dpValues
Definition: homog2d.hpp:563

◆ setDefault()

void h2d::img::DrawParams::setDefault ( )
inline
578  {
579  p_getDefault() = this->_dpValues;
580  }
Dp_values _dpValues
Definition: homog2d.hpp:563

◆ setFontSize()

DrawParams& h2d::img::DrawParams::setFontSize ( int  value)
inline

Set font size for drawText()

628  {
629  assert( value > 1 );
630  _dpValues._fontSize = value;
631  return *this;
632  }
Dp_values _dpValues
Definition: homog2d.hpp:563

◆ setPointSize()

DrawParams& h2d::img::DrawParams::setPointSize ( uint8_t  ps)
inline
593  {
594  if( ps%2 == 0 )
595  HOMOG2D_THROW_ERROR_1( "odd number required" );
596  _dpValues._pointSize = ps;
597  _dpValues._ptDelta = ps;
598  return *this;
599  }
#define HOMOG2D_THROW_ERROR_1(msg)
Error throw wrapper macro.
Definition: homog2d.hpp:181
Dp_values _dpValues
Definition: homog2d.hpp:563
Here is the caller graph for this function:

◆ setPointStyle()

DrawParams& h2d::img::DrawParams::setPointStyle ( PtStyle  ps)
inline
586  {
587  if( (int)ps > (int)PtStyle::Dot )
588  throw std::runtime_error( "Error: invalid value for point style");
589  _dpValues._ptStyle = ps;
590  return *this;
591  }
Dp_values _dpValues
Definition: homog2d.hpp:563
Here is the caller graph for this function:

◆ setThickness()

DrawParams& h2d::img::DrawParams::setThickness ( uint8_t  t)
inline
601  {
602  _dpValues._lineThickness = t;
603  return *this;
604  }
Dp_values _dpValues
Definition: homog2d.hpp:563
Here is the caller graph for this function:

◆ showAngles()

DrawParams& h2d::img::DrawParams::showAngles ( bool  b = true)
inline

Set or unset the drawing of angles of polylines.

641  {
642  _dpValues._showAngles = b;
643  return *this;
644  }
Dp_values _dpValues
Definition: homog2d.hpp:563

◆ showIndex()

DrawParams& h2d::img::DrawParams::showIndex ( bool  b = true)
inline

Set or unset the drawing of points (useful only for Segment_ and Polyline_)

635  {
636  _dpValues._showIndex = b;
637  return *this;
638  }
Dp_values _dpValues
Definition: homog2d.hpp:563
Here is the caller graph for this function:

◆ showPoints()

DrawParams& h2d::img::DrawParams::showPoints ( bool  b = true)
inline

Set or unset the drawing of points (useful only for Segment_ and Polyline_)

622  {
623  _dpValues._showPoints = b;
624  return *this;
625  }
Dp_values _dpValues
Definition: homog2d.hpp:563
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ h2d::base::LPBase

template<typename T , typename U >
friend class h2d::base::LPBase
friend

◆ h2d::base::PolylineBase

template<typename T , typename U >
friend class h2d::base::PolylineBase
friend

◆ h2d::base::SegVec

template<typename T , typename U >
friend class h2d::base::SegVec
friend

◆ h2d::Circle_

template<typename T >
friend class h2d::Circle_
friend

◆ h2d::Ellipse_

template<typename T >
friend class h2d::Ellipse_
friend

◆ h2d::FRect_

template<typename T >
friend class h2d::FRect_
friend

◆ operator<<

std::ostream& operator<< ( std::ostream &  f,
const DrawParams dp 
)
friend
551  {
552  f << "-" << dp._dpValues._color
553  << "\n-line width=" << dp._dpValues._lineThickness
554  << "\n-pointSize=" << dp._dpValues._pointSize
555  << "\n-showPoints=" << dp._dpValues._showPoints
556  << "\n-fontSize=" << dp._dpValues._fontSize
557  << '\n';
558  return f;
559  }

Member Data Documentation

◆ _dpValues

Dp_values h2d::img::DrawParams::_dpValues

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