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