Skip to content

DDS-Plugin Rewrite: Groundwork

Stayd requested to merge Stayd/gimp:master into master

This is the first part of a large rewrite of the DDS file plugin. Much more work than is included in this merge request has already been done, but in the interest of keeping these requests somewhat manageable I'll be submitting them in steps. This MR is primarily back-end work and cleanup in preparation for larger functionality changes.

Included here:

  • Fixed some glaring mistakes with mipmap generation, namely that gamma-correction was both being applied in reverse and in 8-bit precision, seriously mangling colors and doing the opposite of what gamma-correction is meant to do. Gamma-correction is now handled correctly, and mips are generated entirely in 32-bit floating-point precision. For fun I also added a new cubic filtering mode, Catmull-Rom, which sits between Mitchell and Lanczos in terms of sharpness.
  • Reworked parts of the importer to better handle DX10+ files. This was necessary to make BC6H and BC7 importing a possibility, but more can and should be done here.
  • Removed the toggle for decoding YCoCg and Alpha Exponent files, as these are now always decoded. As far as I can tell this was only optional because previous versions of the plugin added filters to decode these files after they had already been imported. These certainly aren't coming back so there's no reason to ever not decode the encoded files.
  • BC1 alpha cutout pixels are now always interpreted as black with 0 alpha, matching the format spec and hardware decoding.
  • General cleanup, organization, and formatting of a few files, with more to come in the relevant files of future MRs.

As this is mostly back-end work it doesn't affect the plugin's functionality much. Feedback is extremely welcome, as this is my first merge request for GIMP, and I apologize in advance for all the incredibly embarrassing mistakes I've surely made throughout the codebase already.

Edited by Stayd

Merge request reports