Implement proof of concept for drawing HDR reference images.

This introduces functions to convert between QColorSpace and KoColorProfile.

Then it uses those functions to convert QImages appropriately, so we can draw HDR images as HDR. We do this by setting the canvas profile on the main buffer (QImage), testing whether the QPainter paintDevice is a QImage, and then converting reference images as appropriate to said QImage color profile.

Note: Unsure if this'll work on Qt5 at all

Also related to #46 (closed), though more optional.

TODO:

  • Once !2753 (merged) is merged, adjust KisReferenceImagesDecoration::drawDecoration to set the canvas opengl profile appropriately.
  • Storing HDR images is questionable.
  • Test color picking.
  • There's something weird with Kra files; they're loaded as PNGs.

Test Plan

  • Load Krita with HDR enabled hardware.
  • Load any image.
  • Load an exr or other HDR image (except Kra, as that seems to be loaded oddly) as a reference image.
  • Observe how it is HDR enabled.
  • Should also work with wide-gamut colors.

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!)
    • The QColorSpace conversion(s) needs a unittest, IMHO.
  • 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.
  • Does the patch add a user-visible feature? If yes, is there a documentation MR ready for it at Krita Documentation Repository?
Edited by Wolthera van Hövell

Merge request reports

Loading