#include <visp3/core/vpRGBa.h>
|
unsigned char | R |
|
unsigned char | G |
|
unsigned char | B |
|
unsigned char | A |
|
|
(Note that these are not member functions.)
|
VISP_EXPORT std::ostream & | operator<< (std::ostream &os, const vpRGBa &rgba) |
|
Class that defines a RGBa 32 bits structure that is used to build color images. RGBa stands for red green blue alpha color space.
The alpha channel is normally used as an opacity channel. If a pixel has a value of 0 in its alpha channel, it is fully transparent, whereas a value of 255 in the alpha channel gives a fully opaque pixel.
By default the alpha channel is set to vpRGBa::alpha_default.
- See also
- vpImage
- Examples
- catchColorConversion.cpp, catchImageWarp.cpp, catchNPZ.cpp, servoMomentImage.cpp, servoMomentPoints.cpp, servoMomentPolygon.cpp, servoSimu4Points.cpp, servoSimuCylinder.cpp, servoSimuSphere.cpp, testConnectedComponents.cpp, testContours.cpp, testConversion.cpp, testDisplayRoi.cpp, testImageBinarise.cpp, testImageDifference.cpp, testImageDraw.cpp, testImageGetValue.cpp, testImagePrint.cpp, testPerformanceLUT.cpp, testRealSense2_D435_align.cpp, tutorial-connected-components.cpp, tutorial-contour.cpp, tutorial-count-coins.cpp, tutorial-flood-fill.cpp, tutorial-image-manipulation.cpp, tutorial-megapose-live-single-object-tracking.cpp, tutorial-npz.cpp, tutorial-pf.cpp, tutorial-ukf.cpp, and wireframeSimulator.cpp.
Definition at line 64 of file vpRGBa.h.
◆ AlphaDefault
◆ vpRGBa() [1/7]
Basic constructor.
Build a black value.
Definition at line 74 of file vpRGBa.h.
◆ vpRGBa() [2/7]
vpRGBa::vpRGBa |
( |
unsigned char |
r, |
|
|
unsigned char |
g, |
|
|
unsigned char |
b, |
|
|
unsigned char |
a = vpRGBa::alpha_default |
|
) |
| |
|
inline |
Constructor.
Initialize the color with R, G, B, A values.
- Parameters
-
r | : Red value. |
g | : Green value. |
b | : Blue value. |
a | : Additional value. |
Definition at line 86 of file vpRGBa.h.
◆ vpRGBa() [3/7]
VP_EXPLICIT vpRGBa::vpRGBa |
( |
unsigned char |
v | ) |
|
|
inline |
Constructor.
Initialize all the R, G, B, A components to v.
- Parameters
-
Definition at line 97 of file vpRGBa.h.
◆ vpRGBa() [4/7]
VP_EXPLICIT vpRGBa::vpRGBa |
( |
unsigned int |
v | ) |
|
|
inline |
Constructor.
Initialize all the R, G, B, A components to v.
- Parameters
-
Definition at line 106 of file vpRGBa.h.
◆ vpRGBa() [5/7]
VP_EXPLICIT vpRGBa::vpRGBa |
( |
int |
v | ) |
|
|
inline |
Constructor.
Initialize all the R, G, B, A components to v.
- Parameters
-
Definition at line 118 of file vpRGBa.h.
◆ vpRGBa() [6/7]
vpRGBa::vpRGBa |
( |
const vpRGBa & |
v | ) |
|
|
inline |
Copy constructor.
Definition at line 126 of file vpRGBa.h.
◆ vpRGBa() [7/7]
Create a RGBa value from a 4 dimension column vector.
R=v[0] G=v[1] B=v[2] A=v[3]
Definition at line 136 of file vpRGBa.h.
◆ operator!=()
bool vpRGBa::operator!= |
( |
const vpRGBa & |
v | ) |
const |
Compare two color pixels.
- Returns
- true if the images are different, false if they are the same.
Definition at line 154 of file vpRGBa.cpp.
References A, B, G, and R.
◆ operator*() [1/2]
vpColVector vpRGBa::operator* |
( |
const double & |
v | ) |
const |
Multiplication operator : v * "this".
- Parameters
-
- Returns
- v * "this"
Definition at line 253 of file vpRGBa.cpp.
References A, B, G, and R.
◆ operator*() [2/2]
Multiplication operator : v * "this".
- Parameters
-
- Returns
- v * "this"
Definition at line 234 of file vpRGBa.cpp.
References A, B, G, and R.
◆ operator+() [1/2]
Addition operator : "this" + v.
- Parameters
-
v | : Color to add to the current object "this". |
- Returns
- "this" + v
Definition at line 215 of file vpRGBa.cpp.
References A, B, G, and R.
◆ operator+() [2/2]
Addition operator : "this" + v.
- Parameters
-
v | : Color to add to the current object "this". |
- Returns
- "this" + v
- Warning
- in case of overflow : e.g. 128+128 returns 0 for all 4 channels
Definition at line 181 of file vpRGBa.cpp.
References A, B, G, and R.
◆ operator-() [1/2]
subtraction operator : "this" - v.
- Parameters
-
v | : Color to subtract to the current object "this". |
- Returns
- "this" - v
Definition at line 196 of file vpRGBa.cpp.
References A, B, G, and R.
◆ operator-() [2/2]
subtraction operator : "this" - v.
- Parameters
-
v | : Color to subtract to the current object "this". |
- Returns
- "this" - v
Definition at line 161 of file vpRGBa.cpp.
References A, B, G, and R.
◆ operator<()
bool vpRGBa::operator< |
( |
const vpRGBa & |
v | ) |
const |
◆ operator=() [1/6]
vpRGBa & vpRGBa::operator= |
( |
const int & |
v | ) |
|
Copy operator that initializes all the components to v
.
- Parameters
-
v | : Value used to initialize the object ( R = G = B = v ). |
Definition at line 79 of file vpRGBa.cpp.
References A, B, G, and R.
◆ operator=() [2/6]
BEGIN_VISP_NAMESPACE vpRGBa & vpRGBa::operator= |
( |
const unsigned char & |
v | ) |
|
Copy operator that initializes all the components to v
.
- Parameters
-
v | : Value used to initialize the object ( R = G = B = v ). |
Definition at line 50 of file vpRGBa.cpp.
References A, B, G, and R.
◆ operator=() [3/6]
vpRGBa & vpRGBa::operator= |
( |
const unsigned int & |
v | ) |
|
Copy operator that initializes all the components to v
.
- Parameters
-
v | : Value used to initialize the object ( R = G = B = v ). |
Definition at line 64 of file vpRGBa.cpp.
References A, B, G, and R.
◆ operator=() [4/6]
Cast a vpColVector in a vpRGBa
- Parameters
-
v | : Input vector. v[0], v[1], v[2], v[3] are to make into relation with respectively R, G, B and A. |
- Exceptions
-
Definition at line 124 of file vpRGBa.cpp.
References A, B, vpException::dimensionError, G, vpArray2D< Type >::getRows(), and R.
◆ operator=() [5/6]
◆ operator=() [6/6]
Copy operator.
Definition at line 92 of file vpRGBa.cpp.
References A, B, G, and R.
◆ operator==()
bool vpRGBa::operator== |
( |
const vpRGBa & |
v | ) |
const |
Compare two RGBa values.
- Returns
- true if the values are the same, false otherwise.
Definition at line 145 of file vpRGBa.cpp.
References A, B, G, and R.
◆ operator>()
bool vpRGBa::operator> |
( |
const vpRGBa & |
v | ) |
const |
◆ operator*
VISP_EXPORT vpRGBa operator* |
( |
const double & |
x, |
|
|
const vpRGBa & |
rgb |
|
) |
| |
|
friend |
Scale RGB components by x. Alpha component remain unchanged.
- Parameters
-
x | : Value used to scale RGB color components. |
rgb | : RGB color components to rescale. |
- Returns
- Rescaled components with RGB * x.
Definition at line 290 of file vpRGBa.cpp.
◆ operator<< [1/2]
VISP_EXPORT std::ostream & operator<< |
( |
std::ostream & |
os, |
|
|
const vpRGBa & |
rgba |
|
) |
| |
|
friend |
Writes the RGBA values to the stream os, and returns a reference to the stream. The coordinates are separated by a comma.
The following code prints the intensity of the pixel in the middle of the image:
#include <visp3/core/vpImage.h>
#ifdef ENABLE_VISP_NAMESPACE
#endif
int main()
{
std::cout << "RGB: " << I[240][320] << std::endl;
return 0;
}
Definition at line 325 of file vpRGBa.cpp.
◆ operator<<() [2/2]
VISP_EXPORT std::ostream & operator<< |
( |
std::ostream & |
os, |
|
|
const vpRGBa & |
rgba |
|
) |
| |
|
related |
Writes the RGBA values to the stream os, and returns a reference to the stream. The coordinates are separated by a comma.
The following code prints the intensity of the pixel in the middle of the image:
#include <visp3/core/vpImage.h>
#ifdef ENABLE_VISP_NAMESPACE
#endif
int main()
{
std::cout << "RGB: " << I[240][320] << std::endl;
return 0;
}
Definition at line 325 of file vpRGBa.cpp.
Additionnal component.
- Examples
- testImageDifference.cpp, and testPerformanceLUT.cpp.
Definition at line 170 of file vpRGBa.h.
Referenced by VISP_NAMESPACE_NAME::adjust(), vpImageConvert::convert(), vpDisplayOpenCV::displayCircle(), vpDisplayOpenCV::displayRectangle(), vpImageTools::imageDifference(), vpImageTools::imageDifferenceAbsolute(), vpImageConvert::merge(), operator!=(), operator*(), operator+(), operator-(), operator=(), operator==(), vpPanda3DRGBRenderer::setBackgroundImage(), and VISP_NAMESPACE_NAME::stretchContrast().
Blue component.
- Examples
- catchImageLoadSave.cpp, testImageDifference.cpp, testPerformanceLUT.cpp, tutorial-megapose-live-single-object-tracking.cpp, and tutorial-panda3d-renderer.cpp.
Definition at line 169 of file vpRGBa.h.
Referenced by VISP_NAMESPACE_NAME::adjust(), vpImageConvert::convert(), vpImageConvert::depthToPointCloud(), vpDisplayOpenCV::displayCircle(), vpDisplayOpenCV::displayImage(), vpDisplayOpenCV::displayImageROI(), vpDisplayOpenCV::displayLine(), vpDisplayOpenCV::displayPoint(), vpDisplayOpenCV::displayRectangle(), vpDisplayOpenCV::displayText(), vpImageDraw::drawCircle(), VISP_NAMESPACE_NAME::drawContours(), vpImageDraw::drawLine(), vpImageDraw::drawPolygon(), vpImageDraw::drawRectangle(), VISP_NAMESPACE_NAME::gammaCorrectionSpatialBased(), vpImageSimulator::getImage(), vpImageTools::imageDifference(), vpImageTools::imageDifferenceAbsolute(), vpDisplayOpenCV::init(), vpImageConvert::merge(), operator!=(), operator*(), operator+(), operator-(), operator<(), operator=(), operator==(), operator>(), vpPanda3DRGBRenderer::setBackgroundImage(), VISP_NAMESPACE_NAME::stretchContrast(), vpColorBlindFriendlyPalette::to_colorRatio(), vpColorBlindFriendlyPalette::to_RGB(), VISP_NAMESPACE_NAME::unsharpMask(), and vpImageTools::warpLinear().
Green component.
- Examples
- catchImageLoadSave.cpp, testImageDifference.cpp, testPerformanceLUT.cpp, tutorial-megapose-live-single-object-tracking.cpp, and tutorial-panda3d-renderer.cpp.
Definition at line 168 of file vpRGBa.h.
Referenced by VISP_NAMESPACE_NAME::adjust(), vpImageConvert::convert(), vpImageConvert::depthToPointCloud(), vpDisplayOpenCV::displayCircle(), vpDisplayOpenCV::displayImage(), vpDisplayOpenCV::displayImageROI(), vpDisplayOpenCV::displayLine(), vpDisplayOpenCV::displayPoint(), vpDisplayOpenCV::displayRectangle(), vpDisplayOpenCV::displayText(), vpImageDraw::drawCircle(), VISP_NAMESPACE_NAME::drawContours(), vpImageDraw::drawLine(), vpImageDraw::drawPolygon(), vpImageDraw::drawRectangle(), VISP_NAMESPACE_NAME::gammaCorrectionSpatialBased(), vpImageSimulator::getImage(), vpImageTools::imageDifference(), vpImageTools::imageDifferenceAbsolute(), vpDisplayOpenCV::init(), vpImageConvert::merge(), operator!=(), operator*(), operator+(), operator-(), operator<(), operator=(), operator==(), operator>(), vpPanda3DRGBRenderer::setBackgroundImage(), VISP_NAMESPACE_NAME::stretchContrast(), vpColorBlindFriendlyPalette::to_colorRatio(), vpColorBlindFriendlyPalette::to_RGB(), VISP_NAMESPACE_NAME::unsharpMask(), and vpImageTools::warpLinear().
Red component.
- Examples
- catchImageLoadSave.cpp, testImageDifference.cpp, testPerformanceLUT.cpp, tutorial-megapose-live-single-object-tracking.cpp, and tutorial-panda3d-renderer.cpp.
Definition at line 167 of file vpRGBa.h.
Referenced by VISP_NAMESPACE_NAME::adjust(), vpImageConvert::convert(), vpImageConvert::depthToPointCloud(), vpDisplayOpenCV::displayCircle(), vpDisplayOpenCV::displayImage(), vpDisplayOpenCV::displayImageROI(), vpDisplayOpenCV::displayLine(), vpDisplayOpenCV::displayPoint(), vpDisplayOpenCV::displayRectangle(), vpDisplayOpenCV::displayText(), vpImageDraw::drawCircle(), VISP_NAMESPACE_NAME::drawContours(), vpImageDraw::drawLine(), vpImageDraw::drawPolygon(), vpImageDraw::drawRectangle(), VISP_NAMESPACE_NAME::gammaCorrectionSpatialBased(), vpImageSimulator::getImage(), vpImageTools::imageDifference(), vpImageTools::imageDifferenceAbsolute(), vpDisplayOpenCV::init(), vpImageConvert::merge(), operator!=(), operator*(), operator+(), operator-(), operator<(), operator=(), operator==(), operator>(), vpPanda3DRGBRenderer::setBackgroundImage(), VISP_NAMESPACE_NAME::stretchContrast(), vpColorBlindFriendlyPalette::to_colorRatio(), vpColorBlindFriendlyPalette::to_RGB(), VISP_NAMESPACE_NAME::unsharpMask(), and vpImageTools::warpLinear().