Visual Servoing Platform version 3.5.0
vpImageDraw.h
1/****************************************************************************
2 *
3 * ViSP, open source Visual Servoing Platform software.
4 * Copyright (C) 2005 - 2019 by Inria. All rights reserved.
5 *
6 * This software is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 * See the file LICENSE.txt at the root directory of this source
11 * distribution for additional information about the GNU GPL.
12 *
13 * For using ViSP with software that can not be combined with the GNU
14 * GPL, please contact Inria about acquiring a ViSP Professional
15 * Edition License.
16 *
17 * See http://visp.inria.fr for more information.
18 *
19 * This software was developed at:
20 * Inria Rennes - Bretagne Atlantique
21 * Campus Universitaire de Beaulieu
22 * 35042 Rennes Cedex
23 * France
24 *
25 * If you have questions regarding the use of this file, please contact
26 * Inria at visp@inria.fr
27 *
28 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
29 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
30 *
31 * Description:
32 * Drawing functions.
33 *
34 *****************************************************************************/
35
36#ifndef _vpImageDraw_h_
37#define _vpImageDraw_h_
38
45#include <visp3/core/vpImage.h>
46#include <visp3/core/vpColor.h>
47#include <visp3/core/vpMath.h>
48#include <visp3/core/vpRect.h>
49#include <visp3/core/vpCameraParameters.h>
50
58class VISP_EXPORT vpImageDraw
59{
60public:
61 static void drawArrow(vpImage<unsigned char> &I, const vpImagePoint &ip1, const vpImagePoint &ip2, unsigned char color,
62 unsigned int w = 4, unsigned int h = 2, unsigned int thickness = 1);
63 static void drawArrow(vpImage<vpRGBa> &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color,
64 unsigned int w = 4, unsigned int h = 2, unsigned int thickness = 1);
65
66 static void drawCircle(vpImage<unsigned char> &I, const vpImagePoint &center, unsigned int radius,
67 unsigned char color, unsigned int thickness = 1);
68 static void drawCircle(vpImage<vpRGBa> &I, const vpImagePoint &center, unsigned int radius,
69 const vpColor &color, unsigned int thickness = 1);
70
71 static void drawCross(vpImage<unsigned char> &I, const vpImagePoint &ip, unsigned int size, unsigned char color,
72 unsigned int thickness = 1);
73 static void drawCross(vpImage<vpRGBa> &I, const vpImagePoint &ip, unsigned int size, const vpColor &color,
74 unsigned int thickness = 1);
75
76 static void drawDottedLine(vpImage<unsigned char> &I, const vpImagePoint &ip1, const vpImagePoint &ip2, unsigned char color,
77 unsigned int thickness = 1);
78 static void drawDottedLine(vpImage<vpRGBa> &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color,
79 unsigned int thickness = 1);
80
81 static void drawEllipse(vpImage<unsigned char> &I, const vpImagePoint &center, double coef1,
82 double coef2, double coef3, bool use_normalized_centered_moments, unsigned char color,
83 double smallalpha = 0, double highalpha = 2 * M_PI, unsigned int thickness = 1);
84 static void drawEllipse(vpImage<vpRGBa> &I, const vpImagePoint &center, double coef1,
85 double coef2, double coef3, bool use_normalized_centered_moments, const vpColor &color,
86 double smallalpha = 0, double highalpha = 2 * M_PI, unsigned int thickness = 1);
87
88 static void drawFrame(vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo,
89 const vpCameraParameters &cam, double size, unsigned char color,
90 unsigned int thickness = 1, const vpImagePoint &offset = vpImagePoint(0, 0));
91 static void drawFrame(vpImage<vpRGBa> &I, const vpHomogeneousMatrix &cMo,
92 const vpCameraParameters &cam, double size, const vpColor &color = vpColor::none,
93 unsigned int thickness = 1, const vpImagePoint &offset = vpImagePoint(0, 0));
94
95 static void drawLine(vpImage<unsigned char> &I, const vpImagePoint &ip1, const vpImagePoint &ip2, unsigned char color,
96 unsigned int thickness = 1);
97 static void drawLine(vpImage<vpRGBa> &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color,
98 unsigned int thickness = 1);
99
100 static void drawPoint(vpImage<unsigned char> &I, const vpImagePoint &ip, unsigned char color, unsigned int thickness = 1);
101 static void drawPoint(vpImage<vpRGBa> &I, const vpImagePoint &ip, const vpColor &color, unsigned int thickness = 1);
102
103 static void drawPolygon(vpImage<unsigned char> &I, const std::vector<vpImagePoint> &vip,
104 unsigned char color, unsigned int thickness = 1, bool closed = true);
105 static void drawPolygon(vpImage<vpRGBa> &I, const std::vector<vpImagePoint> &vip,
106 const vpColor &color, unsigned int thickness = 1, bool closed = true);
107
108 static void drawRectangle(vpImage<unsigned char> &I, const vpRect &rectangle, unsigned char color,
109 bool fill = false, unsigned int thickness = 1);
110 static void drawRectangle(vpImage<vpRGBa> &I, const vpRect &rectangle, const vpColor &color,
111 bool fill = false, unsigned int thickness = 1);
112};
113
114#endif
Generic class defining intrinsic camera parameters.
Class to define RGB colors available for display functionnalities.
Definition: vpColor.h:158
static const vpColor none
Definition: vpColor.h:229
Implementation of an homogeneous matrix and operations on such kind of matrices.
Drawing functions for image.
Definition: vpImageDraw.h:59
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition: vpImagePoint.h:88
Defines a rectangle in the plane.
Definition: vpRect.h:80