Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QColorTransform Class Reference

The QColorTransform class is a transformation between color spaces. More...

#include <qcolortransform.h>

+ Collaboration diagram for QColorTransform:

Public Member Functions

 QColorTransform () noexcept=default
 
Q_GUI_EXPORT ~QColorTransform ()
 
Q_GUI_EXPORT QColorTransform (const QColorTransform &colorTransform) noexcept
 
 QColorTransform (QColorTransform &&colorTransform)=default
 
QColorTransformoperator= (const QColorTransform &other) noexcept
 
void swap (QColorTransform &other) noexcept
 
Q_GUI_EXPORT bool isIdentity () const noexcept
 
Q_GUI_EXPORT QRgb map (QRgb argb) const
 Applies the color transformation on the QRgb value argb.
 
Q_GUI_EXPORT QRgba64 map (QRgba64 rgba64) const
 Applies the color transformation on the QRgba64 value rgba64.
 
Q_GUI_EXPORT QRgbaFloat16 map (QRgbaFloat16 rgbafp16) const
 Applies the color transformation on the QRgbaFloat16 value rgbafp16.
 
Q_GUI_EXPORT QRgbaFloat32 map (QRgbaFloat32 rgbafp32) const
 Applies the color transformation on the QRgbaFloat32 value rgbafp32.
 
Q_GUI_EXPORT QColor map (const QColor &color) const
 Applies the color transformation on the QColor value color.
 

Friends

class QColorSpacePrivate
 
class QColorTransformPrivate
 
bool operator== (const QColorTransform &ct1, const QColorTransform &ct2)
 
bool operator!= (const QColorTransform &ct1, const QColorTransform &ct2)
 

Detailed Description

The QColorTransform class is a transformation between color spaces.

Since
5.14

\inmodule QtGui

QColorTransform is an instantiation of a transformation between color spaces. It can be applied on color and pixels to convert them from one color space to another.

Setting up a QColorTransform takes some preprocessing, so keeping around QColorTransforms that you need often is recommended, instead of generating them on the fly.

Definition at line 25 of file qcolortransform.h.

Constructor & Destructor Documentation

◆ QColorTransform() [1/3]

QColorTransform::QColorTransform ( )
defaultnoexcept

◆ ~QColorTransform()

QColorTransform::~QColorTransform ( )
default

◆ QColorTransform() [2/3]

QColorTransform::QColorTransform ( const QColorTransform colorTransform)
defaultnoexcept

◆ QColorTransform() [3/3]

QColorTransform::QColorTransform ( QColorTransform &&  colorTransform)
default

Member Function Documentation

◆ isIdentity()

bool QColorTransform::isIdentity ( ) const
noexcept
Since
6.4 Returns true if the color transform is the identity transform.

Definition at line 111 of file qcolortransform.cpp.

References d.

◆ map() [1/5]

◆ map() [2/5]

QRgb QColorTransform::map ( QRgb  argb) const

Applies the color transformation on the QRgb value argb.

The input should be opaque or unpremultiplied.

Definition at line 156 of file qcolortransform.cpp.

References QColorTrc::apply(), QColorTrc::applyInverse(), QColorTransformPrivate::colorMatrix, QColorTransformPrivate::colorSpaceIn, QColorTransformPrivate::colorSpaceOut, QColorSpacePrivate::LUT::generated, QBasicAtomicInteger< T >::loadAcquire(), QColorSpacePrivate::lut, QColorMatrix::map(), qAlpha(), qBlue(), qGreen(), qRed(), qRgba(), QColorSpacePrivate::trc, and QColorVector::x.

Referenced by convert_Indexed8_to_Grayscale8().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ map() [3/5]

QRgba64 QColorTransform::map ( QRgba64  rgba64) const

Applies the color transformation on the QRgba64 value rgba64.

The input should be opaque or unpremultiplied.

Definition at line 193 of file qcolortransform.cpp.

References QRgba64::alpha(), QColorTrc::apply(), QColorTrc::applyInverse(), QRgba64::blue(), QColorTransformPrivate::colorMatrix, QColorTransformPrivate::colorSpaceIn, QColorTransformPrivate::colorSpaceOut, QRgba64::fromRgba64(), QColorSpacePrivate::LUT::generated, QRgba64::green(), QBasicAtomicInteger< T >::loadAcquire(), QColorSpacePrivate::lut, QColorMatrix::map(), QRgba64::red(), QColorSpacePrivate::trc, and QColorVector::x.

+ Here is the call graph for this function:

◆ map() [4/5]

QRgbaFloat16 QColorTransform::map ( QRgbaFloat16  rgbafp16) const

Applies the color transformation on the QRgbaFloat16 value rgbafp16.

The input should be opaque or unpremultiplied.

Since
6.4

Definition at line 231 of file qcolortransform.cpp.

References QColorTrc::applyExtended(), QColorTrc::applyInverseExtended(), QRgbaFloat< F >::b, QColorTransformPrivate::colorMatrix, QColorTransformPrivate::colorSpaceIn, QColorTransformPrivate::colorSpaceOut, QRgbaFloat< F >::g, QColorMatrix::map(), QRgbaFloat< F >::r, and QColorSpacePrivate::trc.

+ Here is the call graph for this function:

◆ map() [5/5]

QRgbaFloat32 QColorTransform::map ( QRgbaFloat32  rgbafp32) const

Applies the color transformation on the QRgbaFloat32 value rgbafp32.

The input should be opaque or unpremultiplied.

Since
6.4

Definition at line 252 of file qcolortransform.cpp.

References QColorTrc::applyExtended(), QColorTrc::applyInverseExtended(), QRgbaFloat< F >::b, QColorTransformPrivate::colorMatrix, QColorTransformPrivate::colorSpaceIn, QColorTransformPrivate::colorSpaceOut, QRgbaFloat< F >::g, QColorMatrix::map(), QRgbaFloat< F >::r, and QColorSpacePrivate::trc.

+ Here is the call graph for this function:

◆ operator=()

QColorTransform & QColorTransform::operator= ( const QColorTransform other)
inlinenoexcept

Definition at line 32 of file qcolortransform.h.

References other().

+ Here is the call graph for this function:

◆ swap()

void QColorTransform::swap ( QColorTransform other)
inlinenoexcept

Definition at line 39 of file qcolortransform.h.

References d, and other().

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ operator!=

bool QColorTransform::operator!= ( const QColorTransform ct1,
const QColorTransform ct2 
)
friend
Since
6.4 Returns true if ct1 does not define the same transformation as ct2.

Definition at line 50 of file qcolortransform.h.

◆ operator==

bool QColorTransform::operator== ( const QColorTransform ct1,
const QColorTransform ct2 
)
friend
Since
6.4 Returns true if ct1 defines the same color transformation as ct2.

Definition at line 48 of file qcolortransform.h.

◆ QColorSpacePrivate

friend class QColorSpacePrivate
friend

Definition at line 54 of file qcolortransform.h.

◆ QColorTransformPrivate

friend class QColorTransformPrivate
friend

Definition at line 55 of file qcolortransform.h.


The documentation for this class was generated from the following files: