@@ -648,6 +648,38 @@ Examples::
648648 %p4cc Y10 little-endian (0x20303159)
649649 %p4cc NV12 big-endian (0xb231564e)
650650
651+ Generic FourCC code
652+ -------------------
653+
654+ ::
655+ %p4c[hnbl] gP00 (0x67503030)
656+
657+ Print a generic FourCC code, as both ASCII characters and its numerical
658+ value as hexadecimal.
659+
660+ The additional ``h ``, ``r ``, ``b ``, and ``l `` specifiers are used to specify
661+ host, reversed, big or little endian order data respectively. Host endian
662+ order means the data is interpreted as a 32-bit integer and the most
663+ significant byte is printed first; that is, the character code as printed
664+ matches the byte order stored in memory on big-endian systems, and is reversed
665+ on little-endian systems.
666+
667+ Passed by reference.
668+
669+ Examples for a little-endian machine, given &(u32)0x67503030::
670+
671+ %p4ch gP00 (0x67503030)
672+ %p4cl gP00 (0x67503030)
673+ %p4cb 00Pg (0x30305067)
674+ %p4cr 00Pg (0x30305067)
675+
676+ Examples for a big-endian machine, given &(u32)0x67503030::
677+
678+ %p4ch gP00 (0x67503030)
679+ %p4cl 00Pg (0x30305067)
680+ %p4cb gP00 (0x67503030)
681+ %p4cr 00Pg (0x30305067)
682+
651683Rust
652684----
653685
0 commit comments