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

#include <qcolortransform_p.h>

+ Inheritance diagram for QColorTransformPrivate:
+ Collaboration diagram for QColorTransformPrivate:

Public Types

enum  TransformFlag {
  Unpremultiplied = 0 , InputOpaque = 1 , InputPremultiplied = 2 , OutputPremultiplied = 4 ,
  Premultiplied = (InputPremultiplied | OutputPremultiplied)
}
 

Public Member Functions

void updateLutsIn () const
 
void updateLutsOut () const
 
bool isIdentity () const
 
Q_GUI_EXPORT void prepare ()
 
void apply (QRgb *dst, const QRgb *src, qsizetype count, TransformFlags flags=Unpremultiplied) const
 
void apply (QRgba64 *dst, const QRgba64 *src, qsizetype count, TransformFlags flags=Unpremultiplied) const
 
void apply (QRgbaFloat32 *dst, const QRgbaFloat32 *src, qsizetype count, TransformFlags flags=Unpremultiplied) const
 
void apply (quint8 *dst, const QRgb *src, qsizetype count, TransformFlags flags=Unpremultiplied) const
 
void apply (quint16 *dst, const QRgba64 *src, qsizetype count, TransformFlags flags=Unpremultiplied) const
 
template<typename T >
void apply (T *dst, const T *src, qsizetype count, TransformFlags flags) const
 
template<typename D , typename S >
void applyReturnGray (D *dst, const S *src, qsizetype count, TransformFlags flags) const
 
- Public Member Functions inherited from QSharedData
 QSharedData () noexcept
 Constructs a QSharedData object with a reference count of 0.
 
 QSharedData (const QSharedData &) noexcept
 Constructs a QSharedData object with reference count 0.
 
QSharedDataoperator= (const QSharedData &)=delete
 
 ~QSharedData ()=default
 

Static Public Member Functions

static QColorTransformPrivateget (const QColorTransform &q)
 

Public Attributes

QColorMatrix colorMatrix
 
QExplicitlySharedDataPointer< const QColorSpacePrivatecolorSpaceIn
 
QExplicitlySharedDataPointer< const QColorSpacePrivatecolorSpaceOut
 
- Public Attributes inherited from QSharedData
QAtomicInt ref
 

Detailed Description

Definition at line 26 of file qcolortransform_p.h.

Member Enumeration Documentation

◆ TransformFlag

Defines how the transform is to be applied.

\value Unpremultiplied The input and output should both be unpremultiplied. \value InputOpaque The input is guaranteed to be opaque. \value InputPremultiplied The input is premultiplied. \value OutputPremultiplied The output should be premultiplied. \value Premultiplied Both input and output should both be premultiplied.

Enumerator
Unpremultiplied 
InputOpaque 
InputPremultiplied 
OutputPremultiplied 
Premultiplied 

Definition at line 41 of file qcolortransform_p.h.

Member Function Documentation

◆ apply() [1/6]

void QColorTransformPrivate::apply ( QRgb dst,
const QRgb src,
qsizetype  count,
TransformFlags  flags = Unpremultiplied 
) const

Applies the color transformation on count QRgb pixels starting from src and stores the result in dst.

Thread-safe if prepare() has been called first.

Assumes unpremultiplied data by default. Set flags to change defaults.

See also
prepare()

Definition at line 1323 of file qcolortransform.cpp.

Referenced by QImage::applyColorTransform(), convert_ARGB_to_gray16(), convert_ARGB_to_gray8(), convert_RGBA64_to_gray16(), convert_RGBA64_to_gray8(), destStoreGray16(), and destStoreGray8().

+ Here is the caller graph for this function:

◆ apply() [2/6]

void QColorTransformPrivate::apply ( QRgba64 dst,
const QRgba64 src,
qsizetype  count,
TransformFlags  flags = Unpremultiplied 
) const

Applies the color transformation on count QRgba64 pixels starting from src and stores the result in dst.

Thread-safe if prepare() has been called first.

Assumes unpremultiplied data by default. Set flags to change defaults.

See also
prepare()

Definition at line 1339 of file qcolortransform.cpp.

◆ apply() [3/6]

void QColorTransformPrivate::apply ( QRgbaFloat32 dst,
const QRgbaFloat32 src,
qsizetype  count,
TransformFlags  flags = Unpremultiplied 
) const

Applies the color transformation on count QRgbaFloat32 pixels starting from src and stores the result in dst.

Thread-safe if prepare() has been called first.

Assumes unpremultiplied data by default. Set flags to change defaults.

See also
prepare()

Definition at line 1355 of file qcolortransform.cpp.

◆ apply() [4/6]

void QColorTransformPrivate::apply ( quint16 dst,
const QRgba64 src,
qsizetype  count,
TransformFlags  flags = Unpremultiplied 
) const

Is to be called on a color-transform to XYZ, returns only luminance values.

Definition at line 1376 of file qcolortransform.cpp.

◆ apply() [5/6]

void QColorTransformPrivate::apply ( quint8 dst,
const QRgb src,
qsizetype  count,
TransformFlags  flags = Unpremultiplied 
) const

Is to be called on a color-transform to XYZ, returns only luminance values.

Definition at line 1366 of file qcolortransform.cpp.

◆ apply() [6/6]

template<typename T >
void QColorTransformPrivate::apply ( T *  dst,
const T *  src,
qsizetype  count,
TransformFlags  flags 
) const

Definition at line 1222 of file qcolortransform.cpp.

References colorMatrix, i, InputOpaque, InputPremultiplied, QColorMatrix::isIdentity(), QColorMatrix::isValid(), loadPremultiplied(), loadUnpremultiplied(), OutputPremultiplied, qMin(), storeOpaque(), storePremultiplied(), storeUnpremultiplied(), updateLutsIn(), updateLutsOut(), and WorkBlockSize.

+ Here is the call graph for this function:

◆ applyReturnGray()

template<typename D , typename S >
void QColorTransformPrivate::applyReturnGray ( D *  dst,
const S *  src,
qsizetype  count,
TransformFlags  flags 
) const

Definition at line 1258 of file qcolortransform.cpp.

References applyMatrix(), colorMatrix, i, InputPremultiplied, QColorMatrix::isValid(), loadPremultiplied(), loadUnpremultiplied(), qMin(), storeGray(), updateLutsIn(), updateLutsOut(), and WorkBlockSize.

+ Here is the call graph for this function:

◆ get()

static QColorTransformPrivate * QColorTransformPrivate::get ( const QColorTransform q)
inlinestatic

Definition at line 33 of file qcolortransform_p.h.

Referenced by QImage::applyColorTransform(), convert_ARGB_to_gray16(), convert_ARGB_to_gray8(), convert_RGBA64_to_gray16(), convert_RGBA64_to_gray8(), destStoreGray16(), and destStoreGray8().

+ Here is the caller graph for this function:

◆ isIdentity()

bool QColorTransformPrivate::isIdentity ( ) const

Definition at line 1385 of file qcolortransform.cpp.

References colorMatrix, colorSpaceIn, colorSpaceOut, QColorSpace::Custom, QColorMatrix::isIdentity(), QColorSpace::Linear, QColorSpacePrivate::transferFunction, and QColorSpacePrivate::trc.

+ Here is the call graph for this function:

◆ prepare()

void QColorTransformPrivate::prepare ( )

Prepares a color transformation for fast application. You do not need to call this explicitly as it will be called implicitly on the first transforms, but if you want predictable performance on the first transforms, you can perform it in advance.

See also
QColorTransform::map(), apply()

Definition at line 1306 of file qcolortransform.cpp.

References updateLutsIn(), and updateLutsOut().

+ Here is the call graph for this function:

◆ updateLutsIn()

void QColorTransformPrivate::updateLutsIn ( ) const

Definition at line 33 of file qcolortransform.cpp.

References colorSpaceIn, QColorSpacePrivate::LUT::generated, i, QColorTrc::isValid(), QBasicAtomicInteger< T >::loadAcquire(), QBasicAtomicInteger< T >::loadRelaxed(), lock, QColorSpacePrivate::lut, lutFromTrc(), QColorSpacePrivate::s_lutWriteLock, QBasicAtomicInteger< T >::storeRelease(), and QColorSpacePrivate::trc.

Referenced by apply(), applyReturnGray(), and prepare().

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

◆ updateLutsOut()

void QColorTransformPrivate::updateLutsOut ( ) const

Definition at line 58 of file qcolortransform.cpp.

References colorSpaceOut, QColorSpacePrivate::LUT::generated, i, QColorTrc::isValid(), QBasicAtomicInteger< T >::loadAcquire(), QBasicAtomicInteger< T >::loadRelaxed(), lock, QColorSpacePrivate::lut, lutFromTrc(), QColorSpacePrivate::s_lutWriteLock, QBasicAtomicInteger< T >::storeRelease(), and QColorSpacePrivate::trc.

Referenced by apply(), applyReturnGray(), and prepare().

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

Member Data Documentation

◆ colorMatrix

◆ colorSpaceIn

◆ colorSpaceOut


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