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

Private Member Functions

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

Static Private Attributes

static constexpr uint32_t bottom_bars []
 

Additional Inherited Members

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

Member Function Documentation

◆ fill()

enum generator_depth image_pattern_smpte_bars::fill ( int width,
int height,
unsigned char * data )
inlineoverrideprivatevirtual
Return values
bitdepth used by the generator (either 8 or 16)

Reimplemented from image_pattern_ebu_smpte_bars< 0xBFU, 7 >.

Definition at line 267 of file video_pattern_generator.cpp.

267 {
268 auto ret = image_pattern_ebu_smpte_bars<0xBFU, 7>::fill(width, height, data); // upper 2 3rds
269 assert(ret == generator_depth::bits8);
270 int columns = 7;
271 struct testcard_pixmap pixmap{ .w = width, .h = height, .data = data };
272 const int mid_strip_height = height / 3 - width / 6;
273 struct testcard_rect r{ .x = 0, .y = height / 3 * 2, .w = (width + columns - 1) / columns, .h = mid_strip_height};
274 for (int i = 0; i < columns; i += 1) {
275 r.x = i * r.w;
276 log_msg(LOG_LEVEL_DEBUG, MOD_NAME "Fill rect at %d,%d\n", r.x, r.y);
277 if (i % 2 == 1) {
278 testcard_fillRect(&pixmap, &r, 0);
279 } else {
281 &pixmap, &r,
283 0xBFU, 7>::bars[columns - 1 - i]);
284 }
285 }
286 columns = 6;
287 r.w = (width + columns - 1) / columns;
288 r.h = width / 6;
289 r.y += mid_strip_height;
290 for (int i = 0; i < columns; i += 1) {
291 r.x = i * r.w;
292 log_msg(LOG_LEVEL_DEBUG, MOD_NAME "Fill rect at %d,%d\n", r.x, r.y);
293 testcard_fillRect(&pixmap, &r,
294 bottom_bars[i]);
295 }
296 // pluge - skipping a "superblack" and black bar
297 r.x = 5 * (width / 7);
298 r.w = (width / 7) / 3;
299 r.x += 2 * r.w;
300 log_msg(LOG_LEVEL_DEBUG, MOD_NAME "Fill rect at %d,%d\n", r.x, r.y);
301 testcard_fillRect(&pixmap, &r,
302 0xFFU << 24 | 0x0A0A0A);
304 }
enum generator_depth fill(int width, int height, unsigned char *data) override
static constexpr uint32_t bottom_bars[]
void log_msg(int level, const char *format,...)
Definition debug.cpp:130
#define LOG_LEVEL_DEBUG
Definition kernels.cu:48
void testcard_fillRect(struct testcard_pixmap *s, struct testcard_rect *r, uint32_t color)
#define MOD_NAME

References image_pattern_ebu_smpte_bars< 0xBFU, 7 >::bars, bits8, bottom_bars, image_pattern_ebu_smpte_bars< f, columns >::fill(), testcard_rect::h, LOG_LEVEL_DEBUG, log_msg(), MOD_NAME, testcard_fillRect(), testcard_pixmap::w, testcard_rect::w, testcard_rect::x, and testcard_rect::y.

Here is the call graph for this function:

Member Data Documentation

◆ bottom_bars

uint32_t image_pattern_smpte_bars::bottom_bars[]
staticconstexprprivate
Initial value:
= {
uint32_t{0xFFU << 24U | 105 << 16U | 63 << 8U | 0U },
uint32_t{0xFFFFFFFFU },
uint32_t{0xFFU << 24U | 119U << 16U | 0U << 8U | 0U },
uint32_t{0xFF000000U },
uint32_t{0xFF000000U },
uint32_t{0xFF000000U },
}

Definition at line 259 of file video_pattern_generator.cpp.

259 {
260 uint32_t{0xFFU << 24U | 105 << 16U | 63 << 8U | 0U },
261 uint32_t{0xFFFFFFFFU },
262 uint32_t{0xFFU << 24U | 119U << 16U | 0U << 8U | 0U },
263 uint32_t{0xFF000000U },
264 uint32_t{0xFF000000U },
265 uint32_t{0xFF000000U },
266 };

Referenced by fill().


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