[FEATURE] Add support for Radiance RGBE
This MR proposed to add basic Radiance RGBE format .hdr
import/export functionality to Krita.
Will possibly close BUG: 384136 as well as BUG: 413958 since RGBE images are mistakenly imported via libraw (and libraw cannot parse it).
Import code is based on KImageFormats as they're indeed can parse RGBE images, but the results are always in uint8, aka. QImage::Format_RGB32
. And export code is inspired from https://www.graphics.cornell.edu/~bjw/rgbe.html
Some format limitation:
- Flattened image
- No color profile, exported image will be always converted to float, linear sRGB
- No alpha
Test Plan
- Build Krita
- Try to open RGBE(.hdr) image and confirm if the image is imported correctly
- Also try to export HDR image to RGBE format and check on other apps like Blender or Gimp to confirm it exported correctly
Formalities Checklist
-
I confirmed this builds. -
I confirmed Krita ran and the relevant functions work. -
I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!) -
I made sure my commits build individually and have good descriptions as per KDE guidelines. -
I made sure my code conforms to the standards set in the HACKING file. -
I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.
Reminder: the reviewer is responsible for merging the patch, this is to ensure at the least two people can build the patch. In case a patch breaks the build, both the author and the reviewer should be contacted to fix the build. If this is not possible, the commits shall be reverted, and a notification with the reasoning and any relevant logs shall be sent to the mailing list, kimageshop@kde.org.