Description
Discussed in #4282
Originally posted by dv1 November 23, 2024
In Qt6, a QWindow
class has a format()
function, which returns information about the pixel format and the associated color space that window uses. The color space information is available as a QColorSpace instance. It contains information that in theory could be used by libvips to transform a VipsImage to be shown accurately on screen. And this i s my goal - showing VipsImages on screen using Qt6, in an accurate, color space dependent fashion.
However, the properties of QColorSpace do not seem to match what is available in libvips. The closest I found was to use the iccProfile() function to produce an ICC profile out of the QColorSpace and then somehow feed this into libvips. But I see no way of supplying an ICC profile from a memory buffer. I could create a temporary file of course, but this seems suboptimal, and I'd prefer a memory buffer.
Am I on the right track here? If so, how can I supply that ICC profile from the QColorSpace? Also, is vips_icc_transform
the right function to use in this case? Or, can you think of an entirely different, more efficient and appropriate way of accomplishing my goal?