@@ -632,6 +632,38 @@ Examples::
632632 %p4cc Y10 little-endian (0x20303159)
633633 %p4cc NV12 big-endian (0xb231564e)
634634
635+ Generic FourCC code
636+ -------------------
637+
638+ ::
639+ %p4c[hnbl] gP00 (0x67503030)
640+
641+ Print a generic FourCC code, as both ASCII characters and its numerical
642+ value as hexadecimal.
643+
644+ The additional ``h ``, ``r ``, ``b ``, and ``l `` specifiers are used to specify
645+ host, reversed, big or little endian order data respectively. Host endian
646+ order means the data is interpreted as a 32-bit integer and the most
647+ significant byte is printed first; that is, the character code as printed
648+ matches the byte order stored in memory on big-endian systems, and is reversed
649+ on little-endian systems.
650+
651+ Passed by reference.
652+
653+ Examples for a little-endian machine, given &(u32)0x67503030::
654+
655+ %p4ch gP00 (0x67503030)
656+ %p4cl gP00 (0x67503030)
657+ %p4cb 00Pg (0x30305067)
658+ %p4cr 00Pg (0x30305067)
659+
660+ Examples for a big-endian machine, given &(u32)0x67503030::
661+
662+ %p4ch gP00 (0x67503030)
663+ %p4cl 00Pg (0x30305067)
664+ %p4cb gP00 (0x67503030)
665+ %p4cr 00Pg (0x30305067)
666+
635667Rust
636668----
637669
0 commit comments