Scale channel values by 255.0 when sending a non-RGBA image to G'MIC
ClosedPublic

Authored by nicholasl on Aug 10 2017, 5:41 AM.

Details

Summary

This patch fixes bug 382396 ("(gmic-qt) Using non-RGBA colorspace results in empty image").

A different code path is taken depending on whether or not the image data to be sent to G'MIC is in the RGBA space.
In the RGBA case, the channel values are scaled to range between 0.0 and 255.0
In the non-RGBA case, the values were not being similarly scaled before this patch.
(In both cases, the image is converted to use 32-bit float RGBA before any scaling is applied.)

This is different from how the old plug-in worked:
Old plug-in

  • convertToGmicImageFast() on RGBA image fills gmicImage._data with values between 0.0 and 1.0
  • convertToGmicImage() on non-RGBA image fills gmicImage._data with values between 0.0 and 1.0

New plug-in, patched

  • convertToGmicImageFast() on RGBA image fills gmicImage->_data with values between 0.0 and 255.0
  • convertToGmicImage() on non-RGBA image fills gmicImage->_data with values between 0.0 and 255.0

New plug-in, unpatched

  • convertToGmicImageFast() on RGBA image fills gmicImage->_data with values between 0.0 and 255.0
  • convertToGmicImage() on non-RGBA image fills gmicImage->_data with values between 0.0 and 1.0

Diff Detail

Repository
R37 Krita
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
nicholasl created this revision.Aug 10 2017, 5:41 AM
rempt accepted this revision.Aug 10 2017, 8:23 AM
This revision is now accepted and ready to land.Aug 10 2017, 8:23 AM
This revision was automatically updated to reflect the committed changes.