core/colortransformation: add floating point transformation helper
This commit is contained in:
parent
1206dad079
commit
286914133e
2 changed files with 8 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue