24-bit HSV pixel. More...
#include <SimdPixel.hpp>
Public Member Functions | |
| Hsv24 (const uint8_t &gray=uint8_t(0)) | |
| Hsv24 (const uint8_t &h, const uint8_t &s, const uint8_t &v) | |
| Hsv24 (const Hsv24 &p) | |
Static Public Member Functions | |
| template<template< class > class A> | |
| static const Hsv24 & | At (const View< A > &view, ptrdiff_t col, ptrdiff_t row) |
| template<template< class > class A> | |
| static Hsv24 & | At (View< A > &view, ptrdiff_t col, ptrdiff_t row) |
Data Fields | |
| uint8_t | hue |
| Hue channel. First byte of a View::Hsv24 pixel. Range [0, 255]. | |
| uint8_t | saturation |
| Saturation channel. Second byte of a View::Hsv24 pixel. 0 is gray. | |
| uint8_t | value |
| Value channel. Third byte of a View::Hsv24 pixel. | |
Detailed Description
24-bit HSV pixel.
Stores hue, saturation, value as three consecutive bytes. This is the element type of a View::Hsv24 image, including the output of Simd::BgrToHsv. Each component is an 8-bit value in [0, 255], in the same order as the C description of SimdPixelFormatHsv24. There is no constructor from Bgr24; convert a whole image with Simd::BgrToHsv and then read pixels with View::At<Pixel::Hsv24> or Hsv24::At.
Constructor & Destructor Documentation
◆ Hsv24() [1/3]
| SIMD_INLINE Hsv24 | ( | const uint8_t & | gray = uint8_t(0) | ) |
Creates a gray 24-bit HSV pixel.
Hue and saturation are set to 0. Only the value channel receives gray. Hsv24() is black.
- Parameters
-
[in] gray - initial value of the value channel. It is equal to 0 by default.
◆ Hsv24() [2/3]
| SIMD_INLINE Hsv24 | ( | const uint8_t & | h, |
| const uint8_t & | s, | ||
| const uint8_t & | v | ||
| ) |
Creates a 24-bit HSV pixel from hue, saturation and value.
The values are stored in that order. They use the same 8-bit encoding as Simd::BgrToHsv.
- Parameters
-
[in] h - initial value for the hue channel. [in] s - initial value for the saturation channel. [in] v - initial value for the value channel.
◆ Hsv24() [3/3]
Creates a copy of a 24-bit HSV pixel.
- Parameters
-
[in] p - a 24-bit HSV pixel.
Member Function Documentation
◆ At() [1/2]
|
static |
Gets a constant reference to the HSV pixel at (col, row).
Requires view.format == View::Hsv24 and then returns Simd::At. col is the x coordinate and row is the y coordinate; both must lie inside the view. Use this after Simd::BgrToHsv, or use view.At<Pixel::Hsv24>(x, y).
- Parameters
-
[in] view - an image view of 24-bit HSV pixel format. [in] col - x-coordinate of the pixel. [in] row - y-coordinate of the pixel.
- Returns
- a constant reference to the pixel.
◆ At() [2/2]
|
static |
Gets a reference to the HSV pixel at (col, row).
Requires view.format == View::Hsv24 and then returns Simd::At. col is the x coordinate and row is the y coordinate; both must lie inside the view.
- Parameters
-
[in] view - an image view of 24-bit HSV pixel format. [in] col - x-coordinate of the pixel. [in] row - y-coordinate of the pixel.
- Returns
- a reference to the pixel.