Krita Source Code Documentation
Loading...
Searching...
No Matches
KoColorProfileQuery Struct Reference

The KoColorProfileQuery struct. More...

#include <KoColorProfileQuery.h>

Public Member Functions

bool isGrayscale () const
 
bool isRgb () const
 
bool isValid () const
 Used for PQ profiles.
 
 KoColorProfileQuery (ColorPrimaries primaries=PRIMARIES_UNSPECIFIED, TransferCharacteristics transfer=TRC_UNSPECIFIED, std::optional< qreal > hdrReferenceWhite=std::nullopt)
 
 KoColorProfileQuery (const KoColorProfileQuery &rhs)=default
 
 KoColorProfileQuery (KoColorProfileQuery &&rhs)=default
 
bool operator!= (const KoColorProfileQuery &rhs) const
 
KoColorProfileQueryoperator= (const KoColorProfileQuery &rhs)=default
 
KoColorProfileQueryoperator= (KoColorProfileQuery &&rhs)=default
 
bool operator== (const KoColorProfileQuery &rhs) const
 

Public Attributes

std::optional< double > hdrReferenceWhite
 CICP-compatible enum value representing the transfer function.
 
ColorPrimaries primaries
 Rgb Primaries of the profile. When empty, this is a query for a greyscale profile.
 
QList< KoColorimetryUtils::xyrgbColorants
 The desired white point of the profile.
 
TransferCharacteristics transfer
 CICP-compatible enum value representing the white point and primaries.
 
KoColorimetryUtils::xy whitePoint {0.0, 0.0}
 

Detailed Description

The KoColorProfileQuery struct.

This is a struct that represents the characteristics of a KoColorProfile for either search or generation.

Definition at line 19 of file KoColorProfileQuery.h.

Constructor & Destructor Documentation

◆ KoColorProfileQuery() [1/3]

KoColorProfileQuery::KoColorProfileQuery ( ColorPrimaries primaries = PRIMARIES_UNSPECIFIED,
TransferCharacteristics transfer = TRC_UNSPECIFIED,
std::optional< qreal > hdrReferenceWhite = std::nullopt )
inline

Definition at line 20 of file KoColorProfileQuery.h.

26 {}
TransferCharacteristics transfer
CICP-compatible enum value representing the white point and primaries.
ColorPrimaries primaries
Rgb Primaries of the profile. When empty, this is a query for a greyscale profile.
std::optional< double > hdrReferenceWhite
CICP-compatible enum value representing the transfer function.

◆ KoColorProfileQuery() [2/3]

KoColorProfileQuery::KoColorProfileQuery ( const KoColorProfileQuery & rhs)
default

◆ KoColorProfileQuery() [3/3]

KoColorProfileQuery::KoColorProfileQuery ( KoColorProfileQuery && rhs)
default

Member Function Documentation

◆ isGrayscale()

bool KoColorProfileQuery::isGrayscale ( ) const
inline

Definition at line 46 of file KoColorProfileQuery.h.

46 {
48 && rgbColorants.isEmpty()
50 && !(whitePoint == KoColorimetryUtils::xy{0.0, 0.0});
51 }
@ PRIMARIES_UNSPECIFIED
QList< KoColorimetryUtils::xy > rgbColorants
The desired white point of the profile.
KoColorimetryUtils::xy whitePoint

References primaries, PRIMARIES_UNSPECIFIED, rgbColorants, transfer, TRC_UNSPECIFIED, and whitePoint.

◆ isRgb()

bool KoColorProfileQuery::isRgb ( ) const
inline

Definition at line 53 of file KoColorProfileQuery.h.

53 {
56 || (!rgbColorants.isEmpty() && !(whitePoint == KoColorimetryUtils::xy{0.0, 0.0})));
57 }

References primaries, PRIMARIES_UNSPECIFIED, rgbColorants, transfer, TRC_UNSPECIFIED, and whitePoint.

◆ isValid()

bool KoColorProfileQuery::isValid ( ) const
inline

Used for PQ profiles.

Definition at line 42 of file KoColorProfileQuery.h.

42 {
43 return isGrayscale() || isRgb();
44 }

References isGrayscale(), and isRgb().

◆ operator!=()

bool KoColorProfileQuery::operator!= ( const KoColorProfileQuery & rhs) const
inline

Definition at line 67 of file KoColorProfileQuery.h.

67 {
68 return !(*this == rhs);
69 }

◆ operator=() [1/2]

KoColorProfileQuery & KoColorProfileQuery::operator= ( const KoColorProfileQuery & rhs)
default

◆ operator=() [2/2]

KoColorProfileQuery & KoColorProfileQuery::operator= ( KoColorProfileQuery && rhs)
default

◆ operator==()

bool KoColorProfileQuery::operator== ( const KoColorProfileQuery & rhs) const
inline

Definition at line 59 of file KoColorProfileQuery.h.

59 {
60 return whitePoint == rhs.whitePoint
62 && primaries == rhs.primaries
63 && transfer == rhs.transfer
65 }

References hdrReferenceWhite, primaries, rgbColorants, transfer, and whitePoint.

Member Data Documentation

◆ hdrReferenceWhite

std::optional<double> KoColorProfileQuery::hdrReferenceWhite

CICP-compatible enum value representing the transfer function.

Definition at line 40 of file KoColorProfileQuery.h.

◆ primaries

ColorPrimaries KoColorProfileQuery::primaries

Rgb Primaries of the profile. When empty, this is a query for a greyscale profile.

Definition at line 37 of file KoColorProfileQuery.h.

◆ rgbColorants

QList<KoColorimetryUtils::xy> KoColorProfileQuery::rgbColorants

The desired white point of the profile.

Definition at line 35 of file KoColorProfileQuery.h.

◆ transfer

TransferCharacteristics KoColorProfileQuery::transfer

CICP-compatible enum value representing the white point and primaries.

Definition at line 38 of file KoColorProfileQuery.h.

◆ whitePoint

KoColorimetryUtils::xy KoColorProfileQuery::whitePoint {0.0, 0.0}

Definition at line 34 of file KoColorProfileQuery.h.

34{0.0, 0.0};

The documentation for this struct was generated from the following file: