|
| static constexpr uint32_t | red = 0xFFU |
| |
◆ image_pattern_gradient()
| image_pattern_gradient::image_pattern_gradient |
( |
const string & | config | ) |
|
|
inlineexplicit |
◆ fill()
| enum generator_depth image_pattern_gradient::fill |
( |
int | width, |
|
|
int | height, |
|
|
unsigned char * | data ) |
|
inlineoverrideprivatevirtual |
- Return values
-
| bit | depth used by the generator (either 8 or 16) |
Implements image_pattern.
Definition at line 345 of file video_pattern_generator.cpp.
345 {
346 auto *ptr = reinterpret_cast<uint16_t *>(data);
347 for (int j = 0; j < height; j += 1) {
348 uint16_t r = sin(
static_cast<double>(j) / height * M_PI) * (
color & 0xFFU) / 0xFFU * 0xFF'FFU;
349 uint16_t g = sin(
static_cast<double>(j) / height * M_PI) * ((
color >> 8) & 0xFFU) / 0xFFU * 0xFF'FFU;
350 uint16_t b = sin(
static_cast<double>(j) / height * M_PI) * ((
color >> 16) & 0xFFU) / 0xFFU * 0xFF'FFU;
351 for (int i = 0; i < width; i += 1) {
352 *ptr++ = r;
353 *ptr++ = g;
354 *ptr++ = b;
355 }
356 }
358 }
References bits16, and color.
◆ color
◆ red
| uint32_t image_pattern_gradient::red = 0xFFU |
|
staticconstexpr |
The documentation for this class was generated from the following file: