◆ image_pattern_gradient2()
| image_pattern_gradient2::image_pattern_gradient2 |
( |
string const & | config | ) |
|
|
inlineexplicit |
Definition at line 364 of file video_pattern_generator.cpp.
364 {
365 if (config.empty()) {
366 return;
367 }
368 if (config == "help"s) {
369 cout << "Testcard gradient2 usage:\n\t-t testcard:gradient2[=maxval] - maxval is 16-bit number\n";
370 throw 1;
371 }
372 val_max = stol(config,
nullptr, 0);
373 }
References val_max.
◆ fill()
| enum generator_depth image_pattern_gradient2::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 376 of file video_pattern_generator.cpp.
376 {
377 assert(width > 1);
378 auto *ptr = reinterpret_cast<uint16_t *>(data);
379 for (int j = 0; j < height; j += 1) {
380 for (int i = 0; i < width; i += 1) {
381 unsigned int gray = i *
val_max / (width - 1);
382 *ptr++ = gray;
383 *ptr++ = gray;
384 *ptr++ = gray;
385 }
386 }
388 }
References bits16, and val_max.
◆ val_max
| unsigned int image_pattern_gradient2::val_max = 0XFFFFU |
|
private |
The documentation for this class was generated from the following file: