IRE palette for bars pattern
This commit is contained in:
+20
-2
@@ -20,6 +20,24 @@ constexpr std::array<Color, 7> SMPTE_BARS = {{
|
||||
{111, 848, 481}, // blue
|
||||
}};
|
||||
|
||||
// IRE 11-step greyscale bars
|
||||
// from total black to 100% white
|
||||
// Y_10bit = 64 + (IRE / 100) × (940 − 64) Rec. 709/Rec. 2020
|
||||
// Y_10bit = 64 + (IRE × 8.76)
|
||||
constexpr std::array<Color, 11> IRE_BARS = {{
|
||||
{64, 512, 512}, // IRE 0
|
||||
{152, 512, 512}, // IRE 10
|
||||
{239, 512, 512}, // IRE 20 and so on
|
||||
{327, 512, 512},
|
||||
{414, 512, 512},
|
||||
{502, 512, 512},
|
||||
{590, 512, 512},
|
||||
{677, 512, 512},
|
||||
{765, 512, 512},
|
||||
{852, 512, 512},
|
||||
{940, 512, 512},
|
||||
}};
|
||||
|
||||
// Pack 6 pixels into 4 x 32-bit V210 words (16 bytes total).
|
||||
//
|
||||
// V210 is 4:2:2 — each pair of pixels shares one Cb and one Cr sample.
|
||||
@@ -41,7 +59,7 @@ inline void pack_block(
|
||||
w[3] = (y4 & 0x3FFu) | ((p45.cr & 0x3FFu) << 10) | ((y5 & 0x3FFu) << 20);
|
||||
}
|
||||
|
||||
// Write one horizontal line of SMPTE 75% bars.
|
||||
// Write one horizontal line of bars.
|
||||
// `stride` is the line size in bytes as returned by MXL (configInfo.discrete.sliceSizes[0]).
|
||||
// Bytes beyond the active pixels are already zeroed by the mmap, so no explicit padding needed.
|
||||
inline void write_bar_line(uint8_t* line, int width, uint32_t /*stride*/)
|
||||
@@ -64,7 +82,7 @@ inline void write_bar_line(uint8_t* line, int width, uint32_t /*stride*/)
|
||||
}
|
||||
}
|
||||
|
||||
// Fill an entire frame buffer with SMPTE 75% color bars.
|
||||
// Fill an entire frame buffer with color bars.
|
||||
inline void fill_frame(uint8_t* buf, int width, int height, uint32_t stride)
|
||||
{
|
||||
for (int y = 0; y < height; y++) {
|
||||
|
||||
Reference in New Issue
Block a user