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

Public Member Functions

 image_pattern_uv_plane (string const &y_lvl)
 
- 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

int y_level = (LIMIT_HI_Y(16) + LIMIT_LO(16)) / 2
 

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 391 of file video_pattern_generator.cpp.

Constructor & Destructor Documentation

◆ image_pattern_uv_plane()

image_pattern_uv_plane::image_pattern_uv_plane ( string const & y_lvl)
inlineexplicit

Definition at line 393 of file video_pattern_generator.cpp.

393 {
394 if (!y_lvl.empty()) {
395 y_level = LIMIT_LO(16) + stof(y_lvl) * (LIMIT_HI_Y(16) - LIMIT_LO(16));
396 }
397 }
#define LIMIT_LO(depth)
Definition color.h:131
#define LIMIT_HI_Y(depth)
Definition color.h:132

References LIMIT_HI_Y, LIMIT_LO, and y_level.

Member Function Documentation

◆ fill()

enum generator_depth image_pattern_uv_plane::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 400 of file video_pattern_generator.cpp.

400 {
401 assert(width > 1 && height > 1); // avoid division by zero
402 auto *ptr = reinterpret_cast<uint16_t *>(data);
403 auto *conv = get_decoder_from_to(Y416, RG48);
404 int scale_cbcr = LIMIT_HI_CBCR(16) - LIMIT_LO(16);
405 for (int j = 0; j < height; j += 1) {
406 for (int i = 0; i < width; i += 1) {
407 uint16_t uyva[4];
408 uyva[0] = LIMIT_LO(16) + i * scale_cbcr / (width - 1);
409 uyva[1] = y_level;
410 uyva[2] = LIMIT_LO(16) + j * scale_cbcr / (height - 1);
411 uyva[3] = 0xFF'FF;
412 conv((unsigned char *) ptr, (unsigned char *) uyva, 6, DEFAULT_R_SHIFT, DEFAULT_G_SHIFT, DEFAULT_B_SHIFT);
413 ptr += 3;
414 }
415 }
417 }
#define LIMIT_HI_CBCR(depth)
Definition color.h:133
decoder_t get_decoder_from_to(codec_t in, codec_t out)
#define DEFAULT_B_SHIFT
Definition pixfmt_conv.h:72
#define DEFAULT_R_SHIFT
Definition pixfmt_conv.h:70
#define DEFAULT_G_SHIFT
Definition pixfmt_conv.h:71
@ RG48
16-bit RGB little-endian (RlRhGl...)
Definition types.h:95
@ Y416
interleaved little-endian YCbCr 4444 16-bit - UYVA
Definition types.h:99

References bits16, DEFAULT_B_SHIFT, DEFAULT_G_SHIFT, DEFAULT_R_SHIFT, get_decoder_from_to(), LIMIT_HI_CBCR, LIMIT_LO, RG48, Y416, and y_level.

Here is the call graph for this function:

Member Data Documentation

◆ y_level

int image_pattern_uv_plane::y_level = (LIMIT_HI_Y(16) + LIMIT_LO(16)) / 2
private

Definition at line 399 of file video_pattern_generator.cpp.

Referenced by image_pattern_uv_plane(), and fill().


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