Skip to content

Draft: Add support for 16bit and float textures

Matthias Clasen requested to merge gamma-shenanigans into master

This MR adds

  • GDK_MEMORY_R16G16B16
  • GDK_MEMORY_R16G16B16A16_PREMULTIPLIED
  • GDK_MEMORY_R16G16B16_FLOAT
  • GDK_MEMORY_R16G16B16A16_FLOAT_PREMULTIPLIED
  • GDK_MEMORY_R32G32B32_FLOAT
  • GDK_MEMORY_R32G32B32A32_FLOAT_PREMULTIPLIED

formats.

GDK_MEMORY_R16G16B16A16_PREMULTIPLIED matches the libpng PNG_FORMAT_LINEAR_RGB_ALPHA format, the remaining four are half-float and float formats (for HDR).

The MR also adds support for loading and saving pngs in 16bit integer format. We move away from gdk-pixbuf for this and directly use the 'simplified' libpng api, which has the nice side-effect that we apply gamma and srgb conversion, so we actually get linearized content.

For the floating point formats, we are saving them to tiff in the new gdk_texture_save_to_file api, since that file formatcan accommodate all of our memory formats without lossy compression.

Edited by Matthias Clasen

Merge request reports