Krita Source Code Documentation
Loading...
Searching...
No Matches
KisSurfaceColorimetry::SurfaceDescription Struct Reference

#include <KisSurfaceColorimetry.h>

+ Inheritance diagram for KisSurfaceColorimetry::SurfaceDescription:

Public Member Functions

QString makeTextReport () const
 
bool operator== (const SurfaceDescription &other) const
 

Public Attributes

ColorSpace colorSpace
 
std::optional< MasteringInfomasteringInfo
 

Detailed Description

Definition at line 125 of file KisSurfaceColorimetry.h.

Member Function Documentation

◆ makeTextReport()

QString KisSurfaceColorimetry::SurfaceDescription::makeTextReport ( ) const

Definition at line 154 of file KisSurfaceColorimetry.cpp.

155{
156 QString report;
157 QDebug str(&report);
158
159 str << " Color Space:" << Qt::endl;
160
161 if (std::holds_alternative<KisSurfaceColorimetry::NamedPrimaries>(this->colorSpace.primaries)) {
162 str << " Primaries: " << std::get<KisSurfaceColorimetry::NamedPrimaries>(this->colorSpace.primaries) << Qt::endl;
163 } else {
164 auto col = std::get<KisSurfaceColorimetry::Colorimetry>(this->colorSpace.primaries);
165 str << " Primaries: " << Qt::endl;
166 str << " Red: " << col.red().toxy() << Qt::endl;
167 str << " Green: " << col.green().toxy() << Qt::endl;
168 str << " Blue: " << col.blue().toxy() << Qt::endl;
169 str << " White: " << col.white().toxy() << Qt::endl;
170 }
171
172 if (std::holds_alternative<KisSurfaceColorimetry::NamedTransferFunction>(this->colorSpace.transferFunction)) {
173 str << " Transfer Function: " << std::get<KisSurfaceColorimetry::NamedTransferFunction>(this->colorSpace.transferFunction) << Qt::endl;
174 } else {
175 const uint32_t rawValue = std::get<uint32_t>(this->colorSpace.transferFunction);
176 str << " Transfer Function (gamma): " << rawValue << "(" << qreal(rawValue) / 10000.0 << ")" << Qt::endl;
177 }
178
179 if (this->colorSpace.luminance) {
180 str << " Luminance: " << *this->colorSpace.luminance << Qt::endl;
181 } else {
182 str << " Luminance: " << "<none>" << Qt::endl;
183 }
184
185 if (this->masteringInfo) {
186 str << " Mastering Info:" << Qt::endl;
187 auto col = this->masteringInfo->primaries;
188 str << " Primaries: " << Qt::endl;
189 str << " Red: " << col.red().toxy() << Qt::endl;
190 str << " Green: " << col.green().toxy() << Qt::endl;
191 str << " Blue: " << col.blue().toxy() << Qt::endl;
192 str << " White: " << col.white().toxy() << Qt::endl;
193 str << " Luminance: " << this->masteringInfo->luminance << Qt::endl;
194 str << " Max CLL: " << (this->masteringInfo->maxCll ? QString::number(*this->masteringInfo->maxCll) : "<none>") << Qt::endl;
195 str << " Max FALL: " << (this->masteringInfo->maxFall ? QString::number(*this->masteringInfo->maxFall) : "<none>") << Qt::endl;
196 } else {
197 str << " Mastering Info: <none>" << Qt::endl;
198 }
199
200 return report;
201}
std::optional< Luminance > luminance
std::variant< NamedPrimaries, Colorimetry > primaries
std::variant< NamedTransferFunction, uint32_t > transferFunction

References colorSpace, KisSurfaceColorimetry::ColorSpace::luminance, masteringInfo, KisSurfaceColorimetry::ColorSpace::primaries, and KisSurfaceColorimetry::ColorSpace::transferFunction.

◆ operator==()

bool KisSurfaceColorimetry::SurfaceDescription::operator== ( const SurfaceDescription & other) const
inline

Definition at line 129 of file KisSurfaceColorimetry.h.

129 {
130 return colorSpace == other.colorSpace &&
131 masteringInfo == other.masteringInfo;
132 }

References colorSpace, and masteringInfo.

Member Data Documentation

◆ colorSpace

ColorSpace KisSurfaceColorimetry::SurfaceDescription::colorSpace

Definition at line 126 of file KisSurfaceColorimetry.h.

◆ masteringInfo

std::optional<MasteringInfo> KisSurfaceColorimetry::SurfaceDescription::masteringInfo

Definition at line 127 of file KisSurfaceColorimetry.h.


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