|
| | vpRGBa () |
| | vpRGBa (unsigned char r, unsigned char g, unsigned char b, unsigned char a=vpRGBa::alpha_default) |
| VP_EXPLICIT | vpRGBa (unsigned char v) |
| VP_EXPLICIT | vpRGBa (unsigned int v) |
| VP_EXPLICIT | vpRGBa (int v) |
| template<typename T, bool useFullScale, typename std::enable_if< std::is_same< T, unsigned char >::value, int >::type = 0> |
| VP_EXPLICIT | vpRGBa (const vpHSV< T, useFullScale > &hsv) |
| template<typename T, bool useFullScale, typename std::enable_if< std::is_floating_point< T >::value, int >::type = 0> |
| VP_EXPLICIT | vpRGBa (const vpHSV< T, useFullScale > &hsv) |
| template<typename T, bool useFullScale, typename U = float> |
| std::enable_if< std::is_same< U, float >::value &&std::is_same< T, unsignedchar >::value, vpRGBa & >::type | buildFrom (const vpHSV< T, useFullScale > &other) |
| template<typename T, bool useFullScale> |
| std::enable_if< std::is_floating_point< T >::value, vpRGBa & >::type | buildFrom (const vpHSV< T, useFullScale > &hsv) |
| | vpRGBa (const vpRGBa &v)=default |
| VP_EXPLICIT | vpRGBa (const vpColVector &v) |
| vpRGBa & | operator= (const unsigned char &v) |
| vpRGBa & | operator= (const unsigned int &v) |
| vpRGBa & | operator= (const int &v) |
| vpRGBa & | operator= (vpRGBa &&v)=default |
| vpRGBa & | operator= (const vpRGBa &v)=default |
| vpRGBa & | operator= (const vpColVector &v) |
| bool | operator== (const vpRGBa &v) const |
| bool | operator!= (const vpRGBa &v) const |
| vpColVector | operator- (const vpRGBa &v) const |
| vpRGBa | operator+ (const vpRGBa &v) const |
| vpColVector | operator- (const vpColVector &v) const |
| vpColVector | operator+ (const vpColVector &v) const |
| vpColVector | operator* (const float &v) const |
| vpColVector | operator* (const double &v) const |
| bool | operator< (const vpRGBa &v) const |
| bool | operator> (const vpRGBa &v) const |
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, keyboardControlBebop2.cpp, servoSimu4Points.cpp, servoSimuCylinder.cpp, servoSimuSphere.cpp, testConnectedComponents.cpp, testContours.cpp, testConversion.cpp, testDisplayRoi.cpp, testHSVtoRGBa.cpp, testImageBinarise.cpp, testImageDifference.cpp, testImageDraw.cpp, testImageFilterHSVOldVSNew.cpp, testImageGetValue.cpp, testImagePrint.cpp, testOccipitalStructure_Core_images.cpp, testOccipitalStructure_Core_pcl.cpp, testPerformanceLUT.cpp, testRGBaToHSV.cpp, testRealSense2_D435_align.cpp, testRobotBebop2.cpp, tutorial-connected-components.cpp, tutorial-contour.cpp, tutorial-count-coins.cpp, tutorial-flood-fill.cpp, tutorial-grabber-bebop2.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 73 of file vpRGBa.h.
| 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 95 of file vpRGBa.h.
References A, alpha_default, B, G, and R.
| VP_EXPLICIT vpRGBa::vpRGBa |
( |
unsigned char | v | ) |
|
|
inline |
Constructor.
Initialize all the R, G, B, A components to v.
- Parameters
-
Definition at line 106 of file vpRGBa.h.
References A, B, G, and R.
| VP_EXPLICIT vpRGBa::vpRGBa |
( |
unsigned int | v | ) |
|
|
inline |
Constructor.
Initialize all the R, G, B, A components to v that should be in 0 - 255 range.
- Parameters
-
Definition at line 115 of file vpRGBa.h.
References A, B, G, and R.
| VP_EXPLICIT vpRGBa::vpRGBa |
( |
int | v | ) |
|
|
inline |
Constructor.
Initialize all the R, G, B, A components to v that should be in 0 - 255 range.
- Parameters
-
Definition at line 132 of file vpRGBa.h.
References A, B, G, and R.
template<typename T, bool useFullScale>
| std::enable_if< std::is_floating_point< T >::value, vpRGBa & >::type vpRGBa::buildFrom |
( |
const vpHSV< T, useFullScale > & | hsv | ) |
|
|
inline |
Build a vpRGBa object from a vpHSV<double> or vpHSV<float> object.
- Template Parameters
-
| T | The type of the channels of the vpHSV pixels. |
| useFullScale | True if vpHSV uses unsigned char and the full range [0; 255], false if vpHSV uses unsigned char and the limited range [0; 180]. |
| std::enable_if<std::is_floating_point<T>::value,int>::type | Enable the method only if T is a floating point number. The "int" is here because we cannot use a floating point type, otherwise we get "{float/double} is not a valid type for a template non-type parameter". |
- Parameters
-
| [in] | hsv | The vpHSV from which we want to build our object. |
- Returns
- vpRGBa& The current object after conversion.
Definition at line 197 of file vpRGBa.h.
References A, alpha_default, B, vpMath::equal(), G, vpHSV< T, useFullScale >::H, R, vpMath::round(), vpHSV< T, useFullScale >::S, and vpHSV< T, useFullScale >::V.
| 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 of the vpImage class member functions.
Definition at line 303 of file vpRGBa.cpp.
References A, B, G, operator<<, R, and vpRGBa().
Referenced by operator<<.