Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qcolortransform.cpp File Reference
#include "qcolortransform.h"
#include "qcolortransform_p.h"
#include "qcolormatrix_p.h"
#include "qcolorspace_p.h"
#include "qcolortrc_p.h"
#include "qcolortrclut_p.h"
#include <QtCore/qatomic.h>
#include <QtCore/qmath.h>
#include <QtGui/qcolor.h>
#include <QtGui/qimage.h>
#include <QtGui/qtransform.h>
#include <QtCore/private/qsimd_p.h>
#include <qdebug.h>
+ Include dependency graph for qcolortransform.cpp:

Go to the source code of this file.

Classes

class  QUninitialized< T, Count >
 

Functions

QT_BEGIN_NAMESPACE std::shared_ptr< QColorTrcLutlutFromTrc (const QColorTrc &trc)
 
template<bool DoClamp = true>
static void applyMatrix (QColorVector *buffer, const qsizetype len, const QColorMatrix &colorMatrix)
 
template<typename T >
static void loadPremultiplied (QColorVector *buffer, const T *src, const qsizetype len, const QColorTransformPrivate *d_ptr)
 
template<typename T >
static void loadUnpremultiplied (QColorVector *buffer, const T *src, const qsizetype len, const QColorTransformPrivate *d_ptr)
 
template<>
void loadPremultiplied< QRgb > (QColorVector *buffer, const QRgb *src, const qsizetype len, const QColorTransformPrivate *d_ptr)
 
template<>
void loadPremultiplied< QRgba64 > (QColorVector *buffer, const QRgba64 *src, const qsizetype len, const QColorTransformPrivate *d_ptr)
 
template<>
void loadUnpremultiplied< QRgb > (QColorVector *buffer, const QRgb *src, const qsizetype len, const QColorTransformPrivate *d_ptr)
 
template<>
void loadUnpremultiplied< QRgba64 > (QColorVector *buffer, const QRgba64 *src, const qsizetype len, const QColorTransformPrivate *d_ptr)
 
template<>
void loadPremultiplied< QRgbaFloat32 > (QColorVector *buffer, const QRgbaFloat32 *src, const qsizetype len, const QColorTransformPrivate *d_ptr)
 
template<>
void loadUnpremultiplied< QRgbaFloat32 > (QColorVector *buffer, const QRgbaFloat32 *src, const qsizetype len, const QColorTransformPrivate *d_ptr)
 
static void storePremultiplied (QRgb *dst, const QRgb *src, const QColorVector *buffer, const qsizetype len, const QColorTransformPrivate *d_ptr)
 
static void storeUnpremultiplied (QRgb *dst, const QRgb *src, const QColorVector *buffer, const qsizetype len, const QColorTransformPrivate *d_ptr)
 
static void storeOpaque (QRgb *dst, const QRgb *src, const QColorVector *buffer, const qsizetype len, const QColorTransformPrivate *d_ptr)
 
static void storePremultiplied (QRgba64 *dst, const QRgba64 *src, const QColorVector *buffer, const qsizetype len, const QColorTransformPrivate *d_ptr)
 
static void storeUnpremultiplied (QRgba64 *dst, const QRgba64 *src, const QColorVector *buffer, const qsizetype len, const QColorTransformPrivate *d_ptr)
 
static void storeOpaque (QRgba64 *dst, const QRgba64 *src, const QColorVector *buffer, const qsizetype len, const QColorTransformPrivate *d_ptr)
 
static void storePremultiplied (QRgbaFloat32 *dst, const QRgbaFloat32 *src, const QColorVector *buffer, const qsizetype len, const QColorTransformPrivate *d_ptr)
 
static void storeUnpremultiplied (QRgbaFloat32 *dst, const QRgbaFloat32 *src, const QColorVector *buffer, const qsizetype len, const QColorTransformPrivate *d_ptr)
 
static void storeOpaque (QRgbaFloat32 *dst, const QRgbaFloat32 *src, const QColorVector *buffer, const qsizetype len, const QColorTransformPrivate *d_ptr)
 
static void storeGray (quint8 *dst, const QRgb *src, const QColorVector *buffer, const qsizetype len, const QColorTransformPrivate *d_ptr)
 
static void storeGray (quint16 *dst, const QRgba64 *src, const QColorVector *buffer, const qsizetype len, const QColorTransformPrivate *d_ptr)
 

Variables

static constexpr qsizetype WorkBlockSize = 256
 

Function Documentation

◆ applyMatrix()

template<bool DoClamp = true>
static void applyMatrix ( QColorVector buffer,
const qsizetype  len,
const QColorMatrix colorMatrix 
)
static

Definition at line 314 of file qcolortransform.cpp.

References QColorMatrix::b, QColorMatrix::g, j, QColorMatrix::map(), QColorMatrix::r, QColorVector::x, QColorVector::y, and QColorVector::z.

Referenced by QColorTransformPrivate::applyReturnGray().

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

◆ loadPremultiplied()

template<typename T >
static void loadPremultiplied ( QColorVector buffer,
const T *  src,
const qsizetype  len,
const QColorTransformPrivate d_ptr 
)
static

Referenced by QColorTransformPrivate::apply(), and QColorTransformPrivate::applyReturnGray().

+ Here is the caller graph for this function:

◆ loadPremultiplied< QRgb >()

template<>
void loadPremultiplied< QRgb > ( QColorVector buffer,
const QRgb src,
const qsizetype  len,
const QColorTransformPrivate d_ptr 
)

Definition at line 679 of file qcolortransform.cpp.

References QColorTransformPrivate::colorSpaceIn, i, QColorSpacePrivate::lut, qAlpha(), qBlue(), qGreen(), and qRed().

+ Here is the call graph for this function:

◆ loadPremultiplied< QRgba64 >()

template<>
void loadPremultiplied< QRgba64 > ( QColorVector buffer,
const QRgba64 src,
const qsizetype  len,
const QColorTransformPrivate d_ptr 
)

Definition at line 699 of file qcolortransform.cpp.

References QRgba64::alpha(), QColorTransformPrivate::colorSpaceIn, i, and QColorSpacePrivate::lut.

+ Here is the call graph for this function:

◆ loadPremultiplied< QRgbaFloat32 >()

template<>
void loadPremultiplied< QRgbaFloat32 > ( QColorVector buffer,
const QRgbaFloat32 src,
const qsizetype  len,
const QColorTransformPrivate d_ptr 
)

Definition at line 742 of file qcolortransform.cpp.

References QRgbaFloat< F >::a, QColorTrc::applyExtended(), QColorTransformPrivate::colorSpaceIn, i, and QColorSpacePrivate::trc.

+ Here is the call graph for this function:

◆ loadUnpremultiplied()

template<typename T >
static void loadUnpremultiplied ( QColorVector buffer,
const T *  src,
const qsizetype  len,
const QColorTransformPrivate d_ptr 
)
static

Referenced by QColorTransformPrivate::apply(), and QColorTransformPrivate::applyReturnGray().

+ Here is the caller graph for this function:

◆ loadUnpremultiplied< QRgb >()

template<>
void loadUnpremultiplied< QRgb > ( QColorVector buffer,
const QRgb src,
const qsizetype  len,
const QColorTransformPrivate d_ptr 
)

Definition at line 719 of file qcolortransform.cpp.

References QColorTransformPrivate::colorSpaceIn, i, QColorSpacePrivate::lut, qBlue(), qGreen(), and qRed().

+ Here is the call graph for this function:

◆ loadUnpremultiplied< QRgba64 >()

template<>
void loadUnpremultiplied< QRgba64 > ( QColorVector buffer,
const QRgba64 src,
const qsizetype  len,
const QColorTransformPrivate d_ptr 
)

◆ loadUnpremultiplied< QRgbaFloat32 >()

template<>
void loadUnpremultiplied< QRgbaFloat32 > ( QColorVector buffer,
const QRgbaFloat32 src,
const qsizetype  len,
const QColorTransformPrivate d_ptr 
)

Definition at line 759 of file qcolortransform.cpp.

References QColorTrc::applyExtended(), QColorTransformPrivate::colorSpaceIn, i, and QColorSpacePrivate::trc.

+ Here is the call graph for this function:

◆ lutFromTrc()

QT_BEGIN_NAMESPACE std::shared_ptr< QColorTrcLut > lutFromTrc ( const QColorTrc trc)

Definition at line 23 of file qcolortransform.cpp.

References QColorTrcLut::fromTransferFunction(), QColorTrcLut::fromTransferTable(), QColorTrc::m_fun, QColorTrc::m_table, QColorTrc::m_type, and qWarning.

Referenced by QColorTransformPrivate::updateLutsIn(), and QColorTransformPrivate::updateLutsOut().

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

◆ storeGray() [1/2]

static void storeGray ( quint16 dst,
const QRgba64 src,
const QColorVector buffer,
const qsizetype  len,
const QColorTransformPrivate d_ptr 
)
static

◆ storeGray() [2/2]

static void storeGray ( quint8 dst,
const QRgb src,
const QColorVector buffer,
const qsizetype  len,
const QColorTransformPrivate d_ptr 
)
static

Definition at line 1194 of file qcolortransform.cpp.

References QColorTransformPrivate::colorSpaceOut, i, QColorSpacePrivate::lut, and Q_UNUSED.

Referenced by QColorTransformPrivate::applyReturnGray().

+ Here is the caller graph for this function:

◆ storeOpaque() [1/3]

static void storeOpaque ( QRgb dst,
const QRgb src,
const QColorVector buffer,
const qsizetype  len,
const QColorTransformPrivate d_ptr 
)
static

Definition at line 1109 of file qcolortransform.cpp.

References QColorTransformPrivate::colorSpaceOut, i, QColorSpacePrivate::lut, and Q_UNUSED.

Referenced by QColorTransformPrivate::apply().

+ Here is the caller graph for this function:

◆ storeOpaque() [2/3]

static void storeOpaque ( QRgba64 dst,
const QRgba64 src,
const QColorVector buffer,
const qsizetype  len,
const QColorTransformPrivate d_ptr 
)
static

Definition at line 1145 of file qcolortransform.cpp.

References QColorTransformPrivate::colorSpaceOut, i, QColorSpacePrivate::lut, Q_UNUSED, and qRgba64().

+ Here is the call graph for this function:

◆ storeOpaque() [3/3]

static void storeOpaque ( QRgbaFloat32 dst,
const QRgbaFloat32 src,
const QColorVector buffer,
const qsizetype  len,
const QColorTransformPrivate d_ptr 
)
static

Definition at line 1182 of file qcolortransform.cpp.

References QColorTrc::applyInverseExtended(), QColorTransformPrivate::colorSpaceOut, i, Q_UNUSED, and QColorSpacePrivate::trc.

+ Here is the call graph for this function:

◆ storePremultiplied() [1/3]

static void storePremultiplied ( QRgb dst,
const QRgb src,
const QColorVector buffer,
const qsizetype  len,
const QColorTransformPrivate d_ptr 
)
static

Definition at line 1085 of file qcolortransform.cpp.

References QColorTransformPrivate::colorSpaceOut, i, QColorSpacePrivate::lut, qAlpha(), and qRgba().

Referenced by QColorTransformPrivate::apply().

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

◆ storePremultiplied() [2/3]

static void storePremultiplied ( QRgba64 dst,
const QRgba64 src,
const QColorVector buffer,
const qsizetype  len,
const QColorTransformPrivate d_ptr 
)
static

Definition at line 1121 of file qcolortransform.cpp.

References QColorTransformPrivate::colorSpaceOut, i, QColorSpacePrivate::lut, and qRgba64().

+ Here is the call graph for this function:

◆ storePremultiplied() [3/3]

static void storePremultiplied ( QRgbaFloat32 dst,
const QRgbaFloat32 src,
const QColorVector buffer,
const qsizetype  len,
const QColorTransformPrivate d_ptr 
)
static

Definition at line 1158 of file qcolortransform.cpp.

References QColorTrc::applyInverseExtended(), QColorTransformPrivate::colorSpaceOut, i, and QColorSpacePrivate::trc.

+ Here is the call graph for this function:

◆ storeUnpremultiplied() [1/3]

static void storeUnpremultiplied ( QRgb dst,
const QRgb src,
const QColorVector buffer,
const qsizetype  len,
const QColorTransformPrivate d_ptr 
)
static

Definition at line 1098 of file qcolortransform.cpp.

References QColorTransformPrivate::colorSpaceOut, i, and QColorSpacePrivate::lut.

Referenced by QColorTransformPrivate::apply().

+ Here is the caller graph for this function:

◆ storeUnpremultiplied() [2/3]

static void storeUnpremultiplied ( QRgba64 dst,
const QRgba64 src,
const QColorVector buffer,
const qsizetype  len,
const QColorTransformPrivate d_ptr 
)
static

Definition at line 1134 of file qcolortransform.cpp.

References QColorTransformPrivate::colorSpaceOut, i, QColorSpacePrivate::lut, and qRgba64().

+ Here is the call graph for this function:

◆ storeUnpremultiplied() [3/3]

static void storeUnpremultiplied ( QRgbaFloat32 dst,
const QRgbaFloat32 src,
const QColorVector buffer,
const qsizetype  len,
const QColorTransformPrivate d_ptr 
)
static

Definition at line 1170 of file qcolortransform.cpp.

References QColorTrc::applyInverseExtended(), QColorTransformPrivate::colorSpaceOut, i, and QColorSpacePrivate::trc.

+ Here is the call graph for this function:

Variable Documentation

◆ WorkBlockSize

constexpr qsizetype WorkBlockSize = 256
staticconstexpr