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