Skip to content

Add PIXMAN_rgba_float16 format

M. Stoeckl requested to merge mstoeckl/pixman:fp16-minimal into master

This MR includes the core patches from !17 (by ajax) needed to add a new PIXMAN_rgba_float16 format.

From my perspective, these changes are good enough to merge as is.

I am making this MR because I a) have the time to update it relatively quickly in response to reviews b) use it often enough that in time I may either find and fix bugs with it, or make performance improvements; these I will add to the MR as they occur c) already have some work to improve Pixman's test suite to the point where it can better handle formats like these; see e.g. !53, and can update this MR if work in that direction is merged.

Edit: To briefly explain why this format is important:

  • Compositors which support HDR will almost certainly perform composition operations in a linear color space using half-float color channel encoding. For an application that would make use of HDR, the ideal format to submit to a such a compositor is exactly the same space the compositor renders in, as then the system can avoid converting between formats (e.g., applying the sRGB transfer function). As a result, I expect that some applications using Pixman (or Cairo) will eventually wish to produce buffers with 16F data. (Pixman does not have proper color space support, but it is still useful when the input and output spaces are properly controlled; for example, when overlaying PIXMAN_r8g8b8_sRGB GUI elements onto a PIXMAN_rgba_float16 background in scRGB color space, and displaying the result.)

  • Other libraries which can provide/receive RGBA16F pixels include OpenEXR, QImage (as of Qt6), OpenGL, and Wayland. Having Pixman be able to read such data avoids unnecessary copying and intermediate format conversion steps for any program which interacts with these.

Edited by M. Stoeckl

Merge request reports