feat: multiple test patterns in testpattern node
V210.hpp: add fill_colorbars, fill_ire_ramp, fill_black, fill_white.
Shared fill_solid helper stamps the first line across all rows via
memcpy. Generic write_palette_line template handles both SMPTE and
IRE bar palettes. fill_frame kept as a backward-compat alias.
testpattern/main.cpp: read "pattern" from node config and dispatch
to the appropriate fill function (bars/ire/black/white).
build_graph: pass {"pattern","bars"} to testpattern node params.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -30,9 +30,11 @@ class TestPatternNode : public dmf::NodeBase {
|
||||
return;
|
||||
}
|
||||
|
||||
const uint32_t stride = cfg_info.discrete.sliceSizes[0];
|
||||
log("stride=%u B/line grain=%u B ring=%u grains",
|
||||
stride, stride * static_cast<uint32_t>(height), cfg_info.discrete.grainCount);
|
||||
const uint32_t stride = cfg_info.discrete.sliceSizes[0];
|
||||
const auto pattern = config().value("pattern", "bars");
|
||||
log("stride=%u B/line grain=%u B ring=%u grains pattern=%s",
|
||||
stride, stride * static_cast<uint32_t>(height), cfg_info.discrete.grainCount,
|
||||
pattern.c_str());
|
||||
|
||||
const mxlRational rate = {fps_num, fps_den};
|
||||
uint64_t index = mxlGetCurrentIndex(&rate);
|
||||
@@ -49,7 +51,11 @@ class TestPatternNode : public dmf::NodeBase {
|
||||
continue;
|
||||
}
|
||||
|
||||
dmf::v210::fill_frame(buf, width, height, stride);
|
||||
if (pattern == "bars") dmf::v210::fill_colorbars(buf, width, height, stride);
|
||||
else if (pattern == "ire") dmf::v210::fill_ire_ramp (buf, width, height, stride);
|
||||
else if (pattern == "black") dmf::v210::fill_black (buf, width, height, stride);
|
||||
else if (pattern == "white") dmf::v210::fill_white (buf, width, height, stride);
|
||||
else dmf::v210::fill_colorbars (buf, width, height, stride);
|
||||
grain.flags = 0;
|
||||
grain.validSlices = grain.totalSlices; // mark grain complete so readers can consume it
|
||||
mxlFlowWriterCommitGrain(writer, &grain);
|
||||
|
||||
Reference in New Issue
Block a user