core/colortransformation: add floating point transformation helper

This commit is contained in:
Xaver Hugl 2023-10-10 12:32:09 +02:00
parent 1206dad079
commit 286914133e
2 changed files with 8 additions and 0 deletions

View file

@ -71,4 +71,10 @@ std::tuple<uint16_t, uint16_t, uint16_t> ColorTransformation::transform(uint16_t
return {out[0], out[1], out[2]};
}
QVector3D ColorTransformation::transform(QVector3D in) const
{
QVector3D ret;
cmsPipelineEvalFloat(&in[0], &ret[0], m_pipeline);
return ret;
}
}

View file

@ -16,6 +16,7 @@
#include "kwin_export.h"
typedef struct _cmsPipeline_struct cmsPipeline;
class QVector3D;
namespace KWin
{
@ -33,6 +34,7 @@ public:
bool valid() const;
std::tuple<uint16_t, uint16_t, uint16_t> transform(uint16_t r, uint16_t g, uint16_t b) const;
QVector3D transform(QVector3D in) const;
private:
cmsPipeline *const m_pipeline;