Loading...
Searching...
No Matches
Public Member Functions |
Static Public Member Functions |
Public Attributes |
Static Public Attributes |
List of all members
score::gfx::R210Decoder Struct Reference
Decodes 10-bit RGB packed in r210 (DeckLink bmdFormat10BitRGB). More...
Inheritance diagram for score::gfx::R210Decoder:
Detailed Description
Decodes 10-bit RGB packed in r210 (DeckLink bmdFormat10BitRGB).
One pixel per 32-bit BIG-ENDIAN word: (R << 20) | (G << 10) | B, full-scale 0-1023 — the exact inverse of PackedRGBEncoder::r210be(). Rows are padded to 256-byte multiples (((width + 63) / 64) * 256), so the input texture is sized on the padded stride and indexed 1 texel : 1 pixel (padding sits past the visible width).
Public Member Functions | |
| R210Decoder (Video::ImageFormat &d) | |
| std::pair< QShader, QShader > | init (RenderList &r) override |
| Initialize a GPUVideoDecoder. | |
| void | exec (RenderList &, QRhiResourceUpdateBatch &res, AVFrame &frame) override |
| Decode and upload a video frame to the GPU. | |
Public Member Functions inherited from score::gfx::GPUVideoDecoder | |
| virtual void | release (RenderList &) |
| This method will release all the created samplers and textures. | |
Static Public Member Functions | |
| static constexpr int | rowBytesFor (int w) noexcept |
Static Public Member Functions inherited from score::gfx::GPUVideoDecoder | |
| static QRhiTextureSubresourceUploadDescription | createTextureUpload (uint8_t *pixels, int w, int h, int bytesPerPixel, int stride) |
| Utility method to create a QRhiTextureSubresourceUploadDescription. | |
| static QString | vertexShader (bool invertY=false) noexcept |
Public Attributes | |
| Video::ImageFormat & | decoder |
Public Attributes inherited from score::gfx::GPUVideoDecoder | |
| std::vector< Sampler > | samplers |
| bool | hasFrame {} |
| bool | failed {} |
| bool | formatChanged {} |
Static Public Attributes | |
| static const constexpr auto | frag |
Member Function Documentation
◆ exec()
|
inlineoverridevirtual |
Decode and upload a video frame to the GPU.
Implements score::gfx::GPUVideoDecoder.
◆ init()
|
inlineoverridevirtual |
Initialize a GPUVideoDecoder.
This method must :
- Create samplers and textures for the video format.
- Create shaders that will render the data put into these textures.
It returns a {vertex, fragment} shader pair.
Implements score::gfx::GPUVideoDecoder.
Member Data Documentation
◆ frag
|
staticconstexpr |
Initial value:
= R"_(#version 450
)_" SCORE_GFX_VIDEO_UNIFORMS R"_(
layout(binding=3) uniform sampler2D u_tex;
layout(location = 0) in vec2 v_texcoord;
layout(location = 0) out vec4 fragColor;
vec4 processTexture(vec4 tex) {
vec4 processed = tex;
{ %1 }
return processed;
}
void main() {
int x = int(floor(v_texcoord.x * mat.texSz.x));
int y = int(floor(v_texcoord.y * mat.texSz.y));
vec4 t = texelFetch(u_tex, ivec2(x, y), 0);
uint b0 = uint(t.r * 255.0 + 0.5);
uint b1 = uint(t.g * 255.0 + 0.5);
uint b2 = uint(t.b * 255.0 + 0.5);
uint b3 = uint(t.a * 255.0 + 0.5);
uint w = (b0 << 24u) | (b1 << 16u) | (b2 << 8u) | b3; // big-endian word
float r = float((w >> 20u) & 0x3FFu);
float g = float((w >> 10u) & 0x3FFu);
float b = float( w & 0x3FFu);
fragColor = processTexture(vec4(r, g, b, 1023.0) / 1023.0);
}
)_"
The documentation for this struct was generated from the following file:
Public Member Functions inherited from