79 virtual void setPixel(
int x,
int y,
size_t color) =0;
83 virtual size_t getWidth()
const = 0;
104 unsigned int width = 1,
105 TPenStyle penStyle = psSolid);
122 unsigned int width = 1 );
139 bool inferior =
true,
140 unsigned int width = 1 );
152 virtual void filledRectangle(
168 virtual void textOut(
192 virtual void selectTextFont(
const std::string &fontName );
200 virtual void drawImage(
223 virtual void drawImage(
237 virtual void drawCircle(
242 unsigned int width = 1 );
254 template <
class MATRIX2X2>
256 const MATRIX2X2 *cov2D,
259 double confIntervalStds = 2,
261 unsigned int width = 1,
262 int nEllipsePoints = 20
266 int x1=0,y1=0,x2=0,y2=0;
268 MATRIX2X2 eigVal,eigVec;
272 cov2D->eigenVectors(eigVec,eigVal);
274 eigVal = eigVal.array().sqrt().matrix();
276 M.multiply_ABt(eigVal, eigVec);
279 for (i=0,ang=0;i<nEllipsePoints;i++,ang+= (
M_2PI/(nEllipsePoints-1)))
281 double ccos = cos(ang);
282 double ssin = sin(ang);
284 x2 =
round( mean_x + confIntervalStds * (ccos * M(0,0) + ssin * M(1,0)) );
285 y2 =
round( mean_y + confIntervalStds * (ccos * M(0,1) + ssin * M(1,1)) );
295 std::cout <<
"Covariance matrix leading to error is:" << std::endl << *cov2D << std::endl; \
303 template <
class FEATURELIST>
306 for(
size_t i=0;i<list.size(); ++i )
308 const int x =
round( list.getFeatureX(i) );
309 const int y =
round( list.getFeatureY(i) );
321 template <
class FEATURELIST>
324 for(
size_t i=0;i<list.size(); ++i )
326 const int x =
round( list.getFeatureX(i) );
327 const int y =
round( list.getFeatureY(i) );
329 if( showIDs ) this->textOut(
x,
y,
format(
"%u", static_cast<unsigned int>(list.getFeatureID(i))),
TColor::red );
330 if (showResponse) this->textOut(
x,
y+10,
format(
"R:%u", static_cast<unsigned int>(list.getFeatureResponse(i))),
TColor::red );
331 if( ! list.isPointFeature(i) ) this->drawCircle(
x,
y, list.getScale(i),
TColor::red );
std::string m_selectedFont
The selected font name.
void drawFeatures(const FEATURELIST &list, const TColor &color=TColor::red, const bool showIDs=false, const bool showResponse=false)
Draws a set of marks (or scaled circles for features with scale) onto the image, given a generic cont...
#define MRPT_END_WITH_CLEAN_UP(stuff)
void ellipseGaussian(const MATRIX2X2 *cov2D, const double mean_x, const double mean_y, double confIntervalStds=2, const mrpt::utils::TColor &color=mrpt::utils::TColor(255, 255, 255), unsigned int width=1, int nEllipsePoints=20)
Draws an ellipse representing a given confidence interval of a 2D Gaussian distribution.
A class for storing images as grayscale or RGB bitmaps.
GLenum GLenum GLenum GLenum GLenum scale
const uint32_t * m_selectedFontBitmaps
Direct access to character bitmaps.
void drawFeaturesSimple(const FEATURELIST &list, const TColor &color=TColor::red, const int cross_size=5)
Draws a set of marks onto the image, given a generic container of entities having just "x" and "y" fi...
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
virtual ~CCanvas()
Dummy virtual destructor:
GLsizei const GLchar ** string
float cross(const mPointHull &O, const mPointHull &A, const mPointHull &B)
static TColor red
Predefined colors.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
int round(const T value)
Returns the closer integer (int) to x.
This virtual class defines the interface of any object accepting drawing primitives on it...
double getHeight(const TPolygon3D &p, const TPoint3D &c)
TPenStyle
Definition of pen styles.
unsigned __int32 uint32_t
GLuint GLuint GLsizei GLenum type