Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QColorSpace Class Reference

The QColorSpace class provides a color space abstraction. More...

#include <qcolorspace.h>

+ Collaboration diagram for QColorSpace:

Public Types

enum  NamedColorSpace {
  SRgb = 1 , SRgbLinear , AdobeRgb , DisplayP3 ,
  ProPhotoRgb
}
 Predefined color spaces. More...
 
enum class  Primaries {
  Custom = 0 , SRgb , AdobeRgb , DciP3D65 ,
  ProPhotoRgb
}
 Predefined sets of primary colors. More...
 
enum class  TransferFunction {
  Custom = 0 , Linear , Gamma , SRgb ,
  ProPhotoRgb
}
 Predefined transfer functions or gamma curves. More...
 
enum class  TransformModel : uint8_t { ThreeComponentMatrix = 0 , ElementListProcessing }
 
enum class  ColorModel : uint8_t { Undefined = 0 , Rgb = 1 , Gray = 2 , Cmyk = 3 }
 

Public Member Functions

 QColorSpace () noexcept=default
 Creates a new colorspace object that represents an undefined and invalid colorspace.
 
 QColorSpace (NamedColorSpace namedColorSpace)
 Creates a new colorspace object that represents a namedColorSpace.
 
 QColorSpace (const QPointF &whitePoint, TransferFunction transferFunction, float gamma=0.0f)
 Creates a custom grayscale color space with the white point whitePoint, using the transfer function transferFunction and optionally gamma.
 
 QColorSpace (const QPointF &whitePoint, const QList< uint16_t > &transferFunctionTable)
 Creates a custom grayscale color space with white point whitePoint, and using the custom transfer function described by transferFunctionTable.
 
 QColorSpace (Primaries primaries, TransferFunction transferFunction, float gamma=0.0f)
 Creates a custom color space with the primaries primaries, using the transfer function transferFunction and optionally gamma.
 
 QColorSpace (Primaries primaries, float gamma)
 Creates a custom color space with the primaries primaries, using a gamma transfer function of gamma.
 
 QColorSpace (Primaries primaries, const QList< uint16_t > &transferFunctionTable)
 Creates a custom color space with the primaries gamut, using a custom transfer function described by transferFunctionTable.
 
 QColorSpace (const QPointF &whitePoint, const QPointF &redPoint, const QPointF &greenPoint, const QPointF &bluePoint, TransferFunction transferFunction, float gamma=0.0f)
 Creates a custom colorspace with a primaries based on the chromaticities of the primary colors whitePoint, redPoint, greenPoint and bluePoint, and using the transfer function transferFunction and optionally gamma.
 
 QColorSpace (const QPointF &whitePoint, const QPointF &redPoint, const QPointF &greenPoint, const QPointF &bluePoint, const QList< uint16_t > &transferFunctionTable)
 Creates a custom color space with primaries based on the chromaticities of the primary colors whitePoint, redPoint, greenPoint and bluePoint, and using the custom transfer function described by transferFunctionTable.
 
 QColorSpace (const QPointF &whitePoint, const QPointF &redPoint, const QPointF &greenPoint, const QPointF &bluePoint, const QList< uint16_t > &redTransferFunctionTable, const QList< uint16_t > &greenTransferFunctionTable, const QList< uint16_t > &blueTransferFunctionTable)
 Creates a custom color space with primaries based on the chromaticities of the primary colors whitePoint, redPoint, greenPoint and bluePoint, and using the custom transfer functions described by redTransferFunctionTable, greenTransferFunctionTable, and blueTransferFunctionTable.
 
 ~QColorSpace ()
 
 QColorSpace (const QColorSpace &colorSpace) noexcept
 
QColorSpaceoperator= (const QColorSpace &colorSpace) noexcept
 
 QColorSpace (QColorSpace &&colorSpace) noexcept=default
 
void swap (QColorSpace &colorSpace) noexcept
 Swaps color space other with this color space.
 
Primaries primaries () const noexcept
 Returns the predefined primaries of the color space or primaries::Custom if it doesn't match any of them.
 
TransferFunction transferFunction () const noexcept
 Returns the predefined transfer function of the color space or TransferFunction::Custom if it doesn't match any of them.
 
float gamma () const noexcept
 Returns the gamma value of color spaces with TransferFunction::Gamma, an approximate gamma value for other predefined color spaces, or 0.0 if no approximate gamma is known.
 
QString description () const noexcept
 Returns the name or short description.
 
void setDescription (const QString &description)
 Sets the name or short description of the color space to description.
 
void setTransferFunction (TransferFunction transferFunction, float gamma=0.0f)
 Sets the transfer function to transferFunction and gamma.
 
void setTransferFunction (const QList< uint16_t > &transferFunctionTable)
 Sets the transfer function to transferFunctionTable.
 
void setTransferFunctions (const QList< uint16_t > &redTransferFunctionTable, const QList< uint16_t > &greenTransferFunctionTable, const QList< uint16_t > &blueTransferFunctionTable)
 Sets the transfer functions to redTransferFunctionTable, greenTransferFunctionTable and blueTransferFunctionTable.
 
QColorSpace withTransferFunction (TransferFunction transferFunction, float gamma=0.0f) const
 Returns a copy of this color space, except using the transfer function transferFunction and gamma.
 
QColorSpace withTransferFunction (const QList< uint16_t > &transferFunctionTable) const
 Returns a copy of this color space, except using the transfer function described by transferFunctionTable.
 
QColorSpace withTransferFunctions (const QList< uint16_t > &redTransferFunctionTable, const QList< uint16_t > &greenTransferFunctionTable, const QList< uint16_t > &blueTransferFunctionTable) const
 Returns a copy of this color space, except using the transfer functions described by redTransferFunctionTable, greenTransferFunctionTable and blueTransferFunctionTable.
 
void setPrimaries (Primaries primariesId)
 Sets the primaries to those of the primariesId set.
 
void setPrimaries (const QPointF &whitePoint, const QPointF &redPoint, const QPointF &greenPoint, const QPointF &bluePoint)
 Set primaries to the chromaticities of whitePoint, redPoint, greenPoint and bluePoint.
 
void setWhitePoint (const QPointF &whitePoint)
 Sets the white point to used for this color space to whitePoint.
 
QPointF whitePoint () const
 Returns the white point used for this color space.
 
TransformModel transformModel () const noexcept
 Returns the transfrom processing model used for this color space.
 
ColorModel colorModel () const noexcept
 Returns the color model this color space can represent.
 
void detach ()
 
bool isValid () const noexcept
 Returns true if the color space is valid.
 
bool isValidTarget () const noexcept
 
QByteArray iccProfile () const
 Returns an ICC profile representing the color space.
 
QColorTransform transformationToColorSpace (const QColorSpace &colorspace) const
 Generates and returns a color space transformation from this color space to colorspace.
 
 operator QVariant () const
 Returns the color space as a QVariant.
 

Static Public Member Functions

static QColorSpace fromIccProfile (const QByteArray &iccProfile)
 Creates a QColorSpace from ICC profile iccProfile.
 

Friends

class QColorSpacePrivate
 
bool operator== (const QColorSpace &colorSpace1, const QColorSpace &colorSpace2)
 Returns true if colorspace colorSpace1 is equal to colorspace colorSpace2; otherwise returns false.
 
bool operator!= (const QColorSpace &colorSpace1, const QColorSpace &colorSpace2)
 Returns true if colorspace colorSpace1 is not equal to colorspace colorSpace2; otherwise returns false.
 
Q_GUI_EXPORT QDebug operator<< (QDebug dbg, const QColorSpace &colorSpace)
 

Related Symbols

(Note that these are not member symbols.)

QDataStreamoperator<< (QDataStream &stream, const QColorSpace &colorSpace)
 Writes the given colorSpace to the given stream as an ICC profile.
 
QDataStreamoperator>> (QDataStream &stream, QColorSpace &colorSpace)
 Reads a color space from the given stream and stores it in the given colorSpace.
 

Detailed Description

The QColorSpace class provides a color space abstraction.

Since
5.14

\inmodule QtGui

Color values can be interpreted in different ways, and based on the interpretation can live in different spaces. We call this {color spaces}.

QColorSpace provides access to creating several predefined color spaces and can generate QColorTransforms for converting colors from one color space to another.

QColorSpace can also represent color spaces defined by ICC profiles or embedded in images, that do not otherwise fit the predefined color spaces.

A color space can generally speaking be conceived as a combination of set of primary colors and a transfer function. The primaries defines the axes of the color space, and the transfer function how values are mapped on the axes. The primaries are for ColorModel::Rgb color spaces defined by three primary colors that represent exactly how red, green, and blue look in this particular color space, and a white color that represents where and how bright pure white is. For grayscale color spaces, only a single white primary is needed. The range of colors expressible by the primary colors is called the gamut, and a color space that can represent a wider range of colors is also known as a wide-gamut color space.

The transfer function or gamma curve determines how each component in the color space is encoded. These are used because human perception does not operate linearly, and the transfer functions try to ensure that colors will seem evenly spaced to human eyes.

Definition at line 20 of file qcolorspace.h.

Member Enumeration Documentation

◆ ColorModel

enum class QColorSpace::ColorModel : uint8_t
strong
Since
6.8

Defines the color model used by the color space data.

\value Undefined No color model \value Rgb An RGB color model with red, green, and blue colors. Can apply to RGB and grayscale data. \value Gray A gray scale color model. Can only apply to grayscale data. \value Cmyk Can only represent color data defined with cyan, magenta, yellow, and black colors. In effect only QImage::Format_CMYK32. Note Cmyk color spaces will be TransformModel::ElementListProcessing.

Enumerator
Undefined 
Rgb 
Gray 
Cmyk 

Definition at line 53 of file qcolorspace.h.

◆ NamedColorSpace

Predefined color spaces.

\value SRgb The sRGB color space, which Qt operates in by default. It is a close approximation of how most classic monitors operate, and a mode most software and hardware support. \l{http://www.color.org/chardata/rgb/srgb.xalter}{ICC registration of sRGB}. \value SRgbLinear The sRGB color space with linear gamma. Useful for gamma-corrected blending. \value AdobeRgb The Adobe RGB color space is a classic wide-gamut color space, using a gamma of 2.2. \l{http://www.color.org/chardata/rgb/adobergb.xalter}{ICC registration of Adobe RGB (1998)} \value DisplayP3 A color-space using the primaries of DCI-P3, but with the whitepoint and transfer function of sRGB. Common in modern wide-gamut screens. \l{http://www.color.org/chardata/rgb/DCIP3.xalter}{ICC registration of DCI-P3} \value ProPhotoRgb The Pro Photo RGB color space, also known as ROMM RGB is a very wide gamut color space. \l{http://www.color.org/chardata/rgb/rommrgb.xalter}{ICC registration of ROMM RGB}

Enumerator
SRgb 
SRgbLinear 
AdobeRgb 
DisplayP3 
ProPhotoRgb 

Definition at line 24 of file qcolorspace.h.

◆ Primaries

enum class QColorSpace::Primaries
strong

Predefined sets of primary colors.

\value Custom The primaries are undefined or does not match any predefined sets. \value SRgb The sRGB primaries \value AdobeRgb The Adobe RGB primaries \value DciP3D65 The DCI-P3 primaries with the D65 whitepoint \value ProPhotoRgb The ProPhoto RGB primaries with the D50 whitepoint

Enumerator
Custom 
SRgb 
AdobeRgb 
DciP3D65 
ProPhotoRgb 

Definition at line 32 of file qcolorspace.h.

◆ TransferFunction

enum class QColorSpace::TransferFunction
strong

Predefined transfer functions or gamma curves.

\value Custom The custom or null transfer function \value Linear The linear transfer functions \value Gamma A transfer function that is a real gamma curve based on the value of gamma() \value SRgb The sRGB transfer function, composed of linear and gamma parts \value ProPhotoRgb The ProPhoto RGB transfer function, composed of linear and gamma parts

Enumerator
Custom 
Linear 
Gamma 
SRgb 
ProPhotoRgb 

Definition at line 40 of file qcolorspace.h.

◆ TransformModel

enum class QColorSpace::TransformModel : uint8_t
strong
Since
6.8

Defines the processing model used for color space transforms.

\value ThreeComponentMatrix The transform consist of a matrix calculated from primaries and set of transfer functions for each color channel. This is very fast and used by all predefined color spaces. Any color space on this form is reversible and always both valid sources and targets. \value ElementListProcessing The transforms are one or two lists of processing elements that can do many things, each list only process either to the connection color space or from it. This is very flexible, but rather slow, and can only be set by reading ICC profiles (See \l fromIccProfile()). Since the two lists are separate a color space on this form can be a valid source, but not necessarily also a valid target. When changing either primaries or transfer function on a color space on this type it will reset to an empty ThreeComponentMatrix form.

Enumerator
ThreeComponentMatrix 
ElementListProcessing 

Definition at line 48 of file qcolorspace.h.

Constructor & Destructor Documentation

◆ QColorSpace() [1/12]

QColorSpace::QColorSpace ( )
defaultnoexcept

Creates a new colorspace object that represents an undefined and invalid colorspace.

◆ QColorSpace() [2/12]

QColorSpace::QColorSpace ( NamedColorSpace namedColorSpace)

Creates a new colorspace object that represents a namedColorSpace.

Definition at line 593 of file qcolorspace.cpp.

References isValid(), ProPhotoRgb, Q_ASSERT, QColorSpacePrivate, qWarning, and s_predefinedColorspacePrivates.

+ Here is the call graph for this function:

◆ QColorSpace() [3/12]

QColorSpace::QColorSpace ( const QPointF & whitePoint,
TransferFunction transferFunction,
float gamma = 0.0f )

Creates a custom grayscale color space with the white point whitePoint, using the transfer function transferFunction and optionally gamma.

Since
6.8

Definition at line 652 of file qcolorspace.cpp.

◆ QColorSpace() [4/12]

QColorSpace::QColorSpace ( const QPointF & whitePoint,
const QList< uint16_t > & transferFunctionTable )

Creates a custom grayscale color space with white point whitePoint, and using the custom transfer function described by transferFunctionTable.

Since
6.8

Definition at line 663 of file qcolorspace.cpp.

◆ QColorSpace() [5/12]

QColorSpace::QColorSpace ( QColorSpace::Primaries primaries,
QColorSpace::TransferFunction transferFunction,
float gamma = 0.0f )

Creates a custom color space with the primaries primaries, using the transfer function transferFunction and optionally gamma.

Definition at line 618 of file qcolorspace.cpp.

◆ QColorSpace() [6/12]

QColorSpace::QColorSpace ( QColorSpace::Primaries primaries,
float gamma )

Creates a custom color space with the primaries primaries, using a gamma transfer function of gamma.

Definition at line 627 of file qcolorspace.cpp.

◆ QColorSpace() [7/12]

QColorSpace::QColorSpace ( QColorSpace::Primaries gamut,
const QList< uint16_t > & transferFunctionTable )

Creates a custom color space with the primaries gamut, using a custom transfer function described by transferFunctionTable.

The table should contain at least 2 values, and contain an monotonically increasing list of values from 0 to 65535.

Since
6.1

Definition at line 641 of file qcolorspace.cpp.

◆ QColorSpace() [8/12]

QColorSpace::QColorSpace ( const QPointF & whitePoint,
const QPointF & redPoint,
const QPointF & greenPoint,
const QPointF & bluePoint,
QColorSpace::TransferFunction transferFunction,
float gamma = 0.0f )

Creates a custom colorspace with a primaries based on the chromaticities of the primary colors whitePoint, redPoint, greenPoint and bluePoint, and using the transfer function transferFunction and optionally gamma.

Definition at line 672 of file qcolorspace.cpp.

References gamma(), primaries(), QColorSpacePrivate, qWarning, transferFunction(), and whitePoint().

+ Here is the call graph for this function:

◆ QColorSpace() [9/12]

QColorSpace::QColorSpace ( const QPointF & whitePoint,
const QPointF & redPoint,
const QPointF & greenPoint,
const QPointF & bluePoint,
const QList< uint16_t > & transferFunctionTable )

Creates a custom color space with primaries based on the chromaticities of the primary colors whitePoint, redPoint, greenPoint and bluePoint, and using the custom transfer function described by transferFunctionTable.

Since
6.1

Definition at line 691 of file qcolorspace.cpp.

References whitePoint().

+ Here is the call graph for this function:

◆ QColorSpace() [10/12]

QColorSpace::QColorSpace ( const QPointF & whitePoint,
const QPointF & redPoint,
const QPointF & greenPoint,
const QPointF & bluePoint,
const QList< uint16_t > & redTransferFunctionTable,
const QList< uint16_t > & greenTransferFunctionTable,
const QList< uint16_t > & blueTransferFunctionTable )

Creates a custom color space with primaries based on the chromaticities of the primary colors whitePoint, redPoint, greenPoint and bluePoint, and using the custom transfer functions described by redTransferFunctionTable, greenTransferFunctionTable, and blueTransferFunctionTable.

Since
6.1

Definition at line 705 of file qcolorspace.cpp.

References whitePoint().

+ Here is the call graph for this function:

◆ ~QColorSpace()

QColorSpace::~QColorSpace ( )
default

◆ QColorSpace() [11/12]

QColorSpace::QColorSpace ( const QColorSpace & colorSpace)
defaultnoexcept

◆ QColorSpace() [12/12]

QColorSpace::QColorSpace ( QColorSpace && colorSpace)
defaultnoexcept

Member Function Documentation

◆ colorModel()

QColorSpace::ColorModel QColorSpace::colorModel ( ) const
noexcept

Returns the color model this color space can represent.

Since
6.8

Definition at line 1029 of file qcolorspace.cpp.

References QColorSpacePrivate::colorModel, Q_UNLIKELY, and Undefined.

Referenced by QImage::convertedToColorSpace(), QImage::convertToColorSpace(), QImage::convertToColorSpace(), and QImage::setColorSpace().

+ Here is the caller graph for this function:

◆ description()

QString QColorSpace::description ( ) const
noexcept

Returns the name or short description.

If a description hasn't been given in setDescription(), the original name of the profile is returned if the profile is unmodified, a guessed name is returned if the profile has been recognized as a known color space, otherwise an empty string is returned.

Since
6.2

Definition at line 1331 of file qcolorspace.cpp.

References QColorSpacePrivate::description, QString::isEmpty(), and QColorSpacePrivate::userDescription.

Referenced by setDescription(), QIcc::toIccProfile(), and QPNGImageWriter::writeImage().

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

◆ detach()

void QColorSpace::detach ( )

Definition at line 1039 of file qcolorspace.cpp.

References QExplicitlySharedDataPointer< T >::detach(), and QColorSpacePrivate.

Referenced by QIcc::fromIccProfile(), fromIccProfile(), setDescription(), setPrimaries(), setPrimaries(), setTransferFunction(), setTransferFunction(), setTransferFunctions(), and setWhitePoint().

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

◆ fromIccProfile()

QColorSpace QColorSpace::fromIccProfile ( const QByteArray & iccProfile)
static

Creates a QColorSpace from ICC profile iccProfile.

Note
Not all ICC profiles are supported. QColorSpace only supports RGB or Gray ICC profiles.

If the ICC profile is not supported an invalid QColorSpace is returned where you can still read the original ICC profile using iccProfile().

See also
iccProfile()

Definition at line 1081 of file qcolorspace.cpp.

References detach(), QIcc::fromIccProfile(), iccProfile(), and QColorSpacePrivate::iccProfile.

Referenced by operator>>(), QJpegHandlerPrivate::read(), QTiffHandler::read(), QWebpHandler::read(), and QPngHandlerPrivate::readPngHeader().

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

◆ gamma()

float QColorSpace::gamma ( ) const
noexcept

Returns the gamma value of color spaces with TransferFunction::Gamma, an approximate gamma value for other predefined color spaces, or 0.0 if no approximate gamma is known.

See also
transferFunction()

Definition at line 760 of file qcolorspace.cpp.

References QColorSpacePrivate::gamma, and Q_UNLIKELY.

Referenced by QColorSpace(), setTransferFunction(), withTransferFunction(), and QPNGImageWriter::writeImage().

+ Here is the caller graph for this function:

◆ iccProfile()

QByteArray QColorSpace::iccProfile ( ) const

Returns an ICC profile representing the color space.

If the color space was generated from an ICC profile, that profile is returned, otherwise one is generated.

Note
Even invalid color spaces may return the ICC profile if they were generated from one, to allow applications to implement wider support themselves.
See also
fromIccProfile()

Definition at line 1059 of file qcolorspace.cpp.

References QColorSpacePrivate::iccProfile, QByteArray::isEmpty(), isValid(), Q_UNLIKELY, QByteArray(), and QIcc::toIccProfile().

Referenced by fromIccProfile(), and QPNGImageWriter::writeImage().

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

◆ isValid()

bool QColorSpace::isValid ( ) const
noexcept

Returns true if the color space is valid.

For a color space with TransformModel::ThreeComponentMatrix that means both primaries and transfer functions set, and implies isValidTarget(). For a color space with TransformModel::ElementListProcessing it means it has a valid source transform, to check if it also a valid target color space use isValidTarget().

See also
isValidTarget()

Definition at line 1099 of file qcolorspace.cpp.

References QColorSpacePrivate::isValid().

Referenced by QColorSpace(), convert_ARGB_to_gray16(), convert_ARGB_to_gray8(), convert_Indexed8_to_Grayscale8(), convert_RGBA64_to_gray16(), convert_RGBA64_to_gray8(), destStoreGray16(), destStoreGray8(), iccProfile(), readImage(), QPngHandlerPrivate::readPngImage(), QImage::setColorSpace(), QIcc::toIccProfile(), transformationToColorSpace(), withTransferFunction(), withTransferFunction(), withTransferFunctions(), and QPNGImageWriter::writeImage().

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

◆ isValidTarget()

bool QColorSpace::isValidTarget ( ) const
noexcept
Since
6.8

Returns true if the color space is a valid target color space.

Definition at line 1111 of file qcolorspace.cpp.

References QList< T >::isEmpty(), QColorSpacePrivate::isThreeComponentMatrix(), QColorSpacePrivate::isValid(), and QColorSpacePrivate::mBA.

Referenced by QImage::convertedToColorSpace(), QImage::convertedToColorSpace(), QImage::convertToColorSpace(), and QImage::convertToColorSpace().

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

◆ operator QVariant()

QColorSpace::operator QVariant ( ) const

Returns the color space as a QVariant.

Since
5.15

Definition at line 1318 of file qcolorspace.cpp.

References QVariant::fromValue().

+ Here is the call graph for this function:

◆ operator=()

QColorSpace & QColorSpace::operator= ( const QColorSpace & colorSpace)
inlinenoexcept

Definition at line 82 of file qcolorspace.h.

References copy(), and swap().

+ Here is the call graph for this function:

◆ primaries()

QColorSpace::Primaries QColorSpace::primaries ( ) const
noexcept

Returns the predefined primaries of the color space or primaries::Custom if it doesn't match any of them.

Definition at line 733 of file qcolorspace.cpp.

References Custom, QColorSpacePrivate::primaries, and Q_UNLIKELY.

Referenced by QColorSpace(), and setPrimaries().

+ Here is the caller graph for this function:

◆ setDescription()

void QColorSpace::setDescription ( const QString & description)

Sets the name or short description of the color space to description.

If set to empty description() will return original or guessed descriptions instead.

Since
6.2

Definition at line 1346 of file qcolorspace.cpp.

References description(), detach(), QColorSpacePrivate::iccProfile, and QColorSpacePrivate::userDescription.

+ Here is the call graph for this function:

◆ setPrimaries() [1/2]

void QColorSpace::setPrimaries ( const QPointF & whitePoint,
const QPointF & redPoint,
const QPointF & greenPoint,
const QPointF & bluePoint )

◆ setPrimaries() [2/2]

void QColorSpace::setPrimaries ( QColorSpace::Primaries primariesId)

Sets the primaries to those of the primariesId set.

See also
primaries()

Definition at line 905 of file qcolorspace.cpp.

References QColorSpacePrivate::clearElementListProcessingForEdit(), QColorSpacePrivate::colorModel, Custom, QColorSpacePrivate::description, detach(), ElementListProcessing, QColorSpacePrivate::iccProfile, QColorSpacePrivate::identifyColorSpace(), QColorSpacePrivate::primaries, QColorSpacePrivate, Rgb, QColorSpacePrivate::setToXyzMatrix(), and QColorSpacePrivate::transformModel.

+ Here is the call graph for this function:

◆ setTransferFunction() [1/2]

void QColorSpace::setTransferFunction ( const QList< uint16_t > & transferFunctionTable)

◆ setTransferFunction() [2/2]

void QColorSpace::setTransferFunction ( QColorSpace::TransferFunction transferFunction,
float gamma = 0.0f )

Sets the transfer function to transferFunction and gamma.

See also
transferFunction(), gamma(), withTransferFunction()

Definition at line 772 of file qcolorspace.cpp.

References QColorSpacePrivate::clearElementListProcessingForEdit(), Custom, QColorSpacePrivate::description, detach(), ElementListProcessing, gamma(), QColorSpacePrivate::gamma, QColorSpacePrivate::iccProfile, QColorSpacePrivate::identifyColorSpace(), QColorSpacePrivate, QColorSpacePrivate::setTransferFunction(), transferFunction(), QColorSpacePrivate::transferFunction, and QColorSpacePrivate::transformModel.

Referenced by QPngHandlerPrivate::readPngImage().

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

◆ setTransferFunctions()

void QColorSpace::setTransferFunctions ( const QList< uint16_t > & redTransferFunctionTable,
const QList< uint16_t > & greenTransferFunctionTable,
const QList< uint16_t > & blueTransferFunctionTable )

Sets the transfer functions to redTransferFunctionTable, greenTransferFunctionTable and blueTransferFunctionTable.

Since
6.1
See also
withTransferFunctions()

Definition at line 824 of file qcolorspace.cpp.

References QColorSpacePrivate::clearElementListProcessingForEdit(), QColorSpacePrivate::description, detach(), ElementListProcessing, QColorSpacePrivate::gamma, QColorSpacePrivate::iccProfile, QColorSpacePrivate::identifyColorSpace(), QColorSpacePrivate, QBasicAtomicInteger< T >::ref(), QSharedData::ref, QColorSpacePrivate::setTransferFunctionTables(), and QColorSpacePrivate::transformModel.

+ Here is the call graph for this function:

◆ setWhitePoint()

◆ swap()

void QColorSpace::swap ( QColorSpace & other)
inlinenoexcept

Swaps color space other with this color space.

This operation is very fast and never fails.

Definition at line 92 of file qcolorspace.h.

◆ transferFunction()

QColorSpace::TransferFunction QColorSpace::transferFunction ( ) const
noexcept

Returns the predefined transfer function of the color space or TransferFunction::Custom if it doesn't match any of them.

See also
gamma(), setTransferFunction(), withTransferFunction()

Definition at line 746 of file qcolorspace.cpp.

References Custom, Q_UNLIKELY, and QColorSpacePrivate::transferFunction.

Referenced by QColorSpace(), QRasterPaintEngine::alphaPenBlt(), setTransferFunction(), and withTransferFunction().

+ Here is the caller graph for this function:

◆ transformationToColorSpace()

QColorTransform QColorSpace::transformationToColorSpace ( const QColorSpace & colorspace) const

Generates and returns a color space transformation from this color space to colorspace.

Definition at line 1299 of file qcolorspace.cpp.

References isValid(), qWarning, and QColorSpacePrivate::transformationToColorSpace().

+ Here is the call graph for this function:

◆ transformModel()

QColorSpace::TransformModel QColorSpace::transformModel ( ) const
noexcept

Returns the transfrom processing model used for this color space.

Since
6.8

Definition at line 1017 of file qcolorspace.cpp.

References Q_UNLIKELY, ThreeComponentMatrix, and QColorSpacePrivate::transformModel.

◆ whitePoint()

QPointF QColorSpace::whitePoint ( ) const

Returns the white point used for this color space.

Returns a null QPointF if not defined.

Since
6.8

Definition at line 966 of file qcolorspace.cpp.

References Q_UNLIKELY, QColorVector::toChromaticity(), and QColorSpacePrivate::whitePoint.

Referenced by QColorSpace(), QColorSpace(), QColorSpace(), setPrimaries(), and setWhitePoint().

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

◆ withTransferFunction() [1/2]

QColorSpace QColorSpace::withTransferFunction ( const QList< uint16_t > & transferFunctionTable) const

Returns a copy of this color space, except using the transfer function described by transferFunctionTable.

Since
6.1
See also
transferFunction(), setTransferFunction()

Definition at line 872 of file qcolorspace.cpp.

References isValid(), and out.

+ Here is the call graph for this function:

◆ withTransferFunction() [2/2]

QColorSpace QColorSpace::withTransferFunction ( QColorSpace::TransferFunction transferFunction,
float gamma = 0.0f ) const

Returns a copy of this color space, except using the transfer function transferFunction and gamma.

See also
transferFunction(), gamma(), setTransferFunction()

Definition at line 854 of file qcolorspace.cpp.

References Custom, gamma(), QColorSpacePrivate::gamma, isValid(), out, transferFunction(), and QColorSpacePrivate::transferFunction.

Referenced by QPNGImageWriter::writeImage().

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

◆ withTransferFunctions()

QColorSpace QColorSpace::withTransferFunctions ( const QList< uint16_t > & redTransferFunctionTable,
const QList< uint16_t > & greenTransferFunctionTable,
const QList< uint16_t > & blueTransferFunctionTable ) const

Returns a copy of this color space, except using the transfer functions described by redTransferFunctionTable, greenTransferFunctionTable and blueTransferFunctionTable.

Since
6.1
See also
setTransferFunctions()

Definition at line 889 of file qcolorspace.cpp.

References isValid(), and out.

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ operator!=

bool QColorSpace::operator!= ( const QColorSpace & colorSpace1,
const QColorSpace & colorSpace2 )
friend

Returns true if colorspace colorSpace1 is not equal to colorspace colorSpace2; otherwise returns false.

Definition at line 127 of file qcolorspace.h.

◆ operator<<() [1/2]

QDataStream & operator<< ( QDataStream & stream,
const QColorSpace & colorSpace )
related

Writes the given colorSpace to the given stream as an ICC profile.

See also
QColorSpace::iccProfile(), {Serializing Qt Data Types}

Definition at line 1366 of file qcolorspace.cpp.

◆ operator<< [2/2]

Q_GUI_EXPORT QDebug operator<< ( QDebug dbg,
const QColorSpace & colorSpace )
friend

Definition at line 1414 of file qcolorspace.cpp.

◆ operator==

bool QColorSpace::operator== ( const QColorSpace & colorSpace1,
const QColorSpace & colorSpace2 )
friend

Returns true if colorspace colorSpace1 is equal to colorspace colorSpace2; otherwise returns false.

Definition at line 125 of file qcolorspace.h.

◆ operator>>()

QDataStream & operator>> ( QDataStream & stream,
QColorSpace & colorSpace )
related

Reads a color space from the given stream and stores it in the given colorSpace.

See also
QColorSpace::fromIccProfile(), {Serializing Qt Data Types}

Definition at line 1382 of file qcolorspace.cpp.

References fromIccProfile().

+ Here is the call graph for this function:

◆ QColorSpacePrivate


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