UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
image_pattern_gradient2 Class Reference
Inheritance diagram for image_pattern_gradient2:
Inheritance graph
Collaboration diagram for image_pattern_gradient2:
Collaboration graph

Public Member Functions

 image_pattern_gradient2 (string const &config)
 
- Public Member Functions inherited from image_pattern
 image_pattern ()=default
 
 image_pattern (const image_pattern &)=delete
 
 image_pattern (image_pattern &&)=delete
 
virtual ~image_pattern ()=default
 
auto init (int width, int height, enum generator_depth depth) noexcept
 
image_pattern & operator= (const image_pattern &)=delete
 
image_pattern && operator= (image_pattern &&)=delete
 

Private Member Functions

enum generator_depth fill (int width, int height, unsigned char *data) override
 

Private Attributes

unsigned int val_max = 0XFFFFU
 

Additional Inherited Members

- Static Public Member Functions inherited from image_pattern
static unique_ptr< image_pattern > create (string const &pattern, string const &params)
 

Detailed Description

Definition at line 362 of file video_pattern_generator.cpp.

Constructor & Destructor Documentation

◆ 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.

Member Function Documentation

◆ fill()

enum generator_depth image_pattern_gradient2::fill ( int width,
int height,
unsigned char * data )
inlineoverrideprivatevirtual
Return values
bitdepth 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); // avoid division by zero
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.

Member Data Documentation

◆ val_max

unsigned int image_pattern_gradient2::val_max = 0XFFFFU
private

Definition at line 375 of file video_pattern_generator.cpp.

Referenced by image_pattern_gradient2(), and fill().


The documentation for this class was generated from the following file: