You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking for a solution for mapping values from matroska::elements::Video::colour_space into av_data::pixel::ColorModel as part of #9. The value are written in FourCC as described here.
Here is a first draft of the solution
constRAW:u32 = fourcc(b'r',b'a',b'w',b' ');constfnfourcc(a:u8,b:u8,c:u8,d:u8) -> u32{(d asu32) | (c asu32) << 8 | (b asu32) << 16 | (a asu32) << 24}// parse fourCC value into pixel::ColorModel// TODO: assumed Big Endianfncolour_space_to_color_model(colour_space:&[u8]) -> Option<ColorModel>{letmut fourcc_val:u32 = 0;for c in colour_space {let b = *c asu8;
fourcc_val = (fourcc_val << 8) | b asu32}match fourcc_val {RAW => Some(ColorModel::Trichromatic(TrichromaticEncodingSystem::RGB)),
_ => None}}
I'm looking for a solution for mapping values from
matroska::elements::Video::colour_space
intoav_data::pixel::ColorModel
as part of #9. The value are written in FourCC as described here.Here is a first draft of the solution
av_data::pixel::TrichromaticEncodingSystem
The text was updated successfully, but these errors were encountered: