Skip to content

Commit

Permalink
testcard/pattern: rename pixel_bars to strips + w=10
Browse files Browse the repository at this point in the history
Renamed pixel_bars to strips - the original name is not much descriptive -
pixels indicated 1 pixel width, which is not necessarily true, bars
(=vertical) isn't the default mode. Also not much distinctive (there
are other "bars").

Set also the default width to 10 - actually, the original width 1 is
better for troubleshooting compressions etc. But 10 is a visually more
appealing as a default and for the original use, the with can be set
explictily.
  • Loading branch information
MartinPulec committed Sep 4, 2024
1 parent 3a4c13f commit 52b9ed2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/utils/video_pattern_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,9 @@ class image_pattern_noise : public image_pattern {
}
};

struct image_pattern_pixel_bars : public image_pattern
struct image_pattern_strips : public image_pattern
{
explicit image_pattern_pixel_bars(string const &config)
explicit image_pattern_strips(string const &config)
{
for (int i = 0; i < COL_NUM; ++i) {
pattern[3 + i] = rect_colors[i];
Expand All @@ -445,7 +445,7 @@ struct image_pattern_pixel_bars : public image_pattern
if (config == "help"s) {
color_printf(
"\t" TBOLD("-t "
"testcard:patt=image_bars[=[vert|hor|"
"testcard:patt=strips[=[vert|hor|"
"diag][,w[idth]=W]]") "\n");
throw 1;
}
Expand All @@ -472,7 +472,7 @@ struct image_pattern_pixel_bars : public image_pattern

enum { ROWS, COLS, DIAG } type = DIAG;
uint32_t pattern[3 + COL_NUM] = { RGBA_WHITE, RGBA_BLACK, RGBA_GRAY };
int fill_w = 1;
int fill_w = 10;
enum generator_depth fill(int width, int height,
unsigned char *data) override
{
Expand Down Expand Up @@ -637,15 +637,15 @@ unique_ptr<image_pattern> image_pattern::create(string const &pattern, string co
if (pattern == "noise") {
return make_unique<image_pattern_noise>();
}
if (pattern == "pixel_bars") {
return make_unique<image_pattern_pixel_bars>(params);
}
if (pattern == "raw") {
return make_unique<image_pattern_raw>(params);
}
if (pattern == "smpte_bars") {
return make_unique<image_pattern_smpte_bars>();
}
if (pattern == "strips") {
return make_unique<image_pattern_strips>(params);
}
if (pattern == "text") {
return make_unique<image_pattern_text>(params);
}
Expand Down Expand Up @@ -845,7 +845,7 @@ video_pattern_generator_create(const char *config, int width, int height, codec_
"noise",
"raw=0xXX[YYZZ..]",
"smpte_bars",
"pixel_bars*",
"strips*",
"uv_plane[=<y_lvl>]",
}) {
col() << "\t- " << SBOLD(p) << "\n";
Expand Down

0 comments on commit 52b9ed2

Please sign in to comment.