ImageFormat Class Referenceabstract

#include <Pt/Gfx/ImageFormat.h>

Runtime pixel format. More...

Inherited by Argb32, Rgb16, Rgb32, and Yuv12.

Detailed Description

ImageFormat describes how bytes in a buffer become colors when the layout is not fixed at compile time. Image uses it for pixel operations. Callers do not construct a useful format directly. Use argb32(), rgb32(), rgb16(), or get(), or take the format from an existing image.

Typed images use a concrete format type such as Argb32 for their pixel operations. Those concrete types still derive from ImageFormat so a typed image can be used where a runtime format is required.

Equality compares the dynamic type, so two format objects of the same layout compare equal. Adding a format means deriving from this class, implementing the protected storage operations, and providing matching pixel types and an ImageTraits specialization.