Skip to content

Commit

Permalink
Use VP_EXPLICIT instead of explicit keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
fspindle committed Jun 25, 2024
1 parent c254485 commit ac57ba9
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 31 deletions.
8 changes: 4 additions & 4 deletions modules/core/include/visp3/core/vpRGBa.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class VISP_EXPORT vpRGBa
\param v : Value to set.
*/
explicit inline vpRGBa(unsigned char v) : R(v), G(v), B(v), A(v) { }
VP_EXPLICIT inline vpRGBa(unsigned char v) : R(v), G(v), B(v), A(v) { }

/*!
Constructor.
Expand All @@ -103,7 +103,7 @@ class VISP_EXPORT vpRGBa
\param v : Value to set.
*/
explicit inline vpRGBa(unsigned int v) : R(v), G(v), B(v), A(v)
VP_EXPLICIT inline vpRGBa(unsigned int v) : R(v), G(v), B(v), A(v)
{
assert(v < 256);
}
Expand All @@ -115,7 +115,7 @@ class VISP_EXPORT vpRGBa
\param v : Value to set.
*/
explicit inline vpRGBa(int v) : R(v), G(v), B(v), A(v)
VP_EXPLICIT inline vpRGBa(int v) : R(v), G(v), B(v), A(v)
{
assert(v < 256);
}
Expand All @@ -133,7 +133,7 @@ class VISP_EXPORT vpRGBa
B=v[2]
A=v[3]
*/
explicit inline vpRGBa(const vpColVector &v) : R(0), G(0), B(0), A(vpRGBa::alpha_default) { *this = v; }
VP_EXPLICIT inline vpRGBa(const vpColVector &v) : R(0), G(0), B(0), A(vpRGBa::alpha_default) { *this = v; }

// We cannot add here the following destructor without changing the
// hypothesis that the size of this class is 4. With the destructor it
Expand Down
6 changes: 3 additions & 3 deletions modules/core/include/visp3/core/vpRGBf.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class VISP_EXPORT vpRGBf
\param v : Value to set.
*/
explicit inline vpRGBf(float v) : R(v), G(v), B(v) { }
VP_EXPLICIT inline vpRGBf(float v) : R(v), G(v), B(v) { }

/*!
Constructor.
Expand All @@ -95,7 +95,7 @@ class VISP_EXPORT vpRGBf
\param v : Value to set.
*/
explicit inline vpRGBf(int v)
VP_EXPLICIT inline vpRGBf(int v)
{
*this = v;
}
Expand All @@ -112,7 +112,7 @@ class VISP_EXPORT vpRGBf
G=v[1]
B=v[2]
*/
explicit inline vpRGBf(const vpColVector &v) : R(0), G(0), B(0) { *this = v; }
VP_EXPLICIT inline vpRGBf(const vpColVector &v) : R(0), G(0), B(0) { *this = v; }

vpRGBf &operator=(float v);
vpRGBf &operator=(int v);
Expand Down
5 changes: 2 additions & 3 deletions modules/robot/include/visp3/robot/vpImageSimulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,14 @@
int main()
{
vpImage<vpRGBa> Icamera(480,640,0);
vpImage<vpRGBa> Icamera(480,640,vpRGBa(0));
vpImage<vpRGBa> Iimage(60,60);
// Initialise the image which will be projected into the image Icamera
vpRGBa colorb(0,0,255);
vpRGBa colorw(255,255,255);
vpRGBa colorr(255,0,0);
for(int i = 0; i < 60; i++)
{
for(int i = 0; i < 60; i++) {
for(int j = 0; j < 20; j++)
Iimage[i][j] = colorb;
for(int j = 20; j < 40; j++)
Expand Down
13 changes: 6 additions & 7 deletions modules/robot/include/visp3/robot/vpWireFrameSimulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,29 +113,28 @@ BEGIN_VISP_NAMESPACE
The following example shows how it is easy to use.
\code
#include <visp3/core/vpImage.h>
#include <visp3/robot/vpWireFrameSimulator.h>
int main()
{
vpWireFrameSimulator sim;
vpImage<vpRGBa> Iint(480,640,255);
vpImage<vpRGBa> Iext(480,640,255);
vpImage<vpRGBa> Iint(480, 640, vpRGBa(255));
vpImage<vpRGBa> Iext(480, 640, vpRGBa(255));
//Set the type of scene to use
sim.initScene(vpWireFrameSimulator::PLATE, vpWireFrameSimulator::D_STANDARD);
//Set the initial pose of the camera
sim.setCameraPositionRelObj(vpHomogeneousMatrix(0,0,0.5,vpMath::rad(0),vpMath::rad(10),0));
sim.setCameraPositionRelObj(vpHomogeneousMatrix(0, 0, 0.5, vpMath::rad(0), vpMath::rad(10), 0));
//Set the desired pose of the camera (for the internal view)
sim.setDesiredCameraPosition(vpHomogeneousMatrix(0.0,0,0.5,0,0,0));
sim.setDesiredCameraPosition(vpHomogeneousMatrix(0.0, 0, 0.5, 0, 0, 0));
//Set the pose of the reference frame (for the external view)
sim.setExternalCameraPosition(vpHomogeneousMatrix(0.1,0,0.2,0,0,0));
sim.setExternalCameraPosition(vpHomogeneousMatrix(0.1, 0, 0.2, 0, 0, 0));
//Set the camera parameters
vpCameraParameters camera(1000,1000,320,240);
vpCameraParameters camera(1000, 1000, 320, 240);
sim.setInternalCameraParameters(camera);
sim.setExternalCameraParameters(camera);
Expand Down
26 changes: 12 additions & 14 deletions modules/robot/src/image-simulator/vpImageSimulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,15 +564,14 @@ void vpImageSimulator::getImage(vpImage<vpRGBa> &I, const vpCameraParameters &ca
int main()
{
vpImage<vpRGBa> Icamera(480,640,0);
vpImage<vpRGBa> Iimage(60,60);
vpImage<vpRGBa> Icamera(480, 640, vpRGBa(0));
vpImage<vpRGBa> Iimage(60, 60);
// Initialise the image which will be projected into the image Icamera
vpRGBa colorb(0,0,255);
vpRGBa colorw(255,255,255);
vpRGBa colorr(255,0,0);
for(int i = 0; i < 60; i++)
{
vpRGBa colorb(0, 0, 255);
vpRGBa colorw(255, 255, 255);
vpRGBa colorr(255, 0, 0);
for(int i = 0; i < 60; i++) {
for(int j = 0; j < 20; j++)
Iimage[i][j] = colorb;
for(int j = 20; j < 40; j++)
Expand Down Expand Up @@ -763,15 +762,14 @@ void vpImageSimulator::getImage(vpImage<unsigned char> &I, std::list<vpImageSimu
int main()
{
vpImage<vpRGBa> Icamera(480,640,0);
vpImage<vpRGBa> Iimage(60,60);
vpImage<vpRGBa> Icamera(480, 640, vpRGBa(0));
vpImage<vpRGBa> Iimage(60, 60);
// Initialise the image which will be projected into the image Icamera
vpRGBa colorb(0,0,255);
vpRGBa colorw(255,255,255);
vpRGBa colorr(255,0,0);
for(int i = 0; i < 60; i++)
{
vpRGBa colorb(0, 0, 255);
vpRGBa colorw(255, 255, 255);
vpRGBa colorr(255, 0, 0);
for(int i = 0; i < 60; i++) {
for(int j = 0; j < 20; j++)
Iimage[i][j] = colorb;
for(int j = 20; j < 40; j++)
Expand Down

0 comments on commit ac57ba9

Please sign in to comment.