mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 09:40:18 +00:00
video pattern generator: rem. hard-coded 16-b list
Use 16-bit source if there is a conversion.
This commit is contained in:
@@ -61,7 +61,6 @@
|
||||
#include <array>
|
||||
#include <iostream>
|
||||
#include <random>
|
||||
#include <set>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
@@ -87,7 +86,6 @@ using std::make_unique;
|
||||
using std::max;
|
||||
using std::min;
|
||||
using std::move;
|
||||
using std::set;
|
||||
using std::string;
|
||||
using std::swap;
|
||||
using std::unique_ptr;
|
||||
@@ -99,8 +97,6 @@ enum class generator_depth {
|
||||
bits16
|
||||
};
|
||||
|
||||
static const set<codec_t> native_16b{ RG48, R12L, R10k, v210, Y416, Y216 };
|
||||
|
||||
class image_pattern {
|
||||
public:
|
||||
static unique_ptr<image_pattern> create(string const & config);
|
||||
@@ -339,8 +335,10 @@ unique_ptr<image_pattern> image_pattern::create(string const &config) {
|
||||
if (config == "help") {
|
||||
cout << "Pattern to use, one of: " << BOLD("bars, blank, ebu_bars, gradient[=0x<AABBGGRR>], gradient2, noise, raw=0xXX[YYZZ..], smpte_bars, 0x<AABBGGRR>\n");
|
||||
cout << "\t\t- patterns 'gradient2' and 'noise' generate full bit-depth patterns with";
|
||||
for (auto & c : native_16b) {
|
||||
cout << " " << BOLD(get_codec_name(c));
|
||||
for (codec_t c = VIDEO_CODEC_FIRST; c != VIDEO_CODEC_COUNT; c = static_cast<codec_t>(static_cast<int>(c) + 1)) {
|
||||
if (get_decoder_from_to(RG48, c, true) != NULL) {
|
||||
cout << " " << BOLD(get_codec_name(c));
|
||||
}
|
||||
}
|
||||
cout << "\n";
|
||||
cout << "\t\t- pattern 'raw' generates repeating sequence of given bytes without any color conversion\n";
|
||||
@@ -419,7 +417,7 @@ video_pattern_generate(std::string const & config, int width, int height, codec_
|
||||
|
||||
auto data = generator->init(width, height, generator_depth::bits8);
|
||||
codec_t codec_src = RGBA;
|
||||
if (native_16b.find(color_spec) != native_16b.end()) {
|
||||
if (get_decoder_from_to(RG48, color_spec, true) != NULL) {
|
||||
data = generator->init(width, height, generator_depth::bits16);
|
||||
codec_src = RG48;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user