Loading...
Searching...
No Matches
PackedBitfield.hpp File Reference

Decoder for RGB packed into bit fields narrower than a byte. More...

Detailed Description

Decoder for RGB packed into bit fields narrower than a byte.

Covers the 3-3-2, 5-6-5, 5-5-5 and 4-4-4-4 families that V4L2 and older capture hardware still emit. One parameterised decoder rather than ~25 near-identical shaders: each format is a table of (offset, width) per channel plus a container size, which is the only thing that actually differs between them.

The container is sampled a byte at a time (R8 / RG8) rather than as R16, because R16 would read the pair in the host's byte order and these formats specify their own. Reassembling from bytes makes the endianness explicit and lets the big-endian variants share the code.

Sampling must be NEAREST: PackedDecoder filters Linear by default, which interpolates each byte against its neighbours before this filter can recombine them, which corrupts the reassembled word on its own. The decoder is therefore built with nearest=true.

Go to the source code of this file.

Classes

struct  score::gfx::BitField
 One channel's placement inside the packed container. More...
 
struct  score::gfx::PackedBitfieldLayout
 

Namespaces

namespace  score
 Base toolkit upon which the software is built.
 
namespace  score::gfx
 Graphics rendering pipeline for ossia score.
 

Functions

QString score::gfx::packedBitfieldFilter (const PackedBitfieldLayout &l)
 
std::unique_ptr< GPUVideoDecoderscore::gfx::makePackedBitfieldDecoder (const PackedBitfieldLayout &l, Video::ImageFormat &d)
 Convenience: the decoder for a packed-bitfield format.