Krita Source Code Documentation
Loading...
Searching...
No Matches
RgbU16ColorSpaceFactory Class Reference

#include <RgbU16ColorSpace.h>

+ Inheritance diagram for RgbU16ColorSpaceFactory:

Public Member Functions

QList< KoColorConversionTransformationFactory * > colorConversionLinksFromProfile (const KoColorProfile *profile) const override
 colorConversionLinksFromProfile Sometimes, we need to generate special color conversion links based on the properties of the profile. The Perceptual Quantizer profiles are an example of this. This function is called inside the color conversion system.
 
KoID colorDepthId () const override
 
KoID colorModelId () const override
 
KoColorSpacecreateColorSpace (const KoColorProfile *p) const override
 
QString defaultProfile () const override
 
QString id () const override
 
QString name () const override
 
int referenceDepth () const override
 
QList< KoColorProfileQueryrequiredConnectionProfiles (const KoColorProfile *profile) const override
 
 RgbU16ColorSpaceFactory ()
 
bool userVisible () const override
 
- Public Member Functions inherited from LcmsColorSpaceFactory
QList< KoColorConversionTransformationFactory * > colorConversionLinks () const override
 
QString colorSpaceEngine () const override
 
KoColorProfilecreateColorProfile (const QByteArray &rawData) const override
 
int crossingCost () const override
 
bool isHdr () const override
 
 LcmsColorSpaceFactory (cmsUInt32Number cmType, cmsColorSpaceSignature colorSpaceSignature)
 
bool profileIsCompatible (const KoColorProfile *profile) const override
 
- Public Member Functions inherited from KoColorSpaceFactory
const KoColorSpacegrabColorSpace (const KoColorProfile *profile)
 
virtual ~KoColorSpaceFactory ()
 
- Public Member Functions inherited from Private
 Private (KisCanvas2 *c)
 

Additional Inherited Members

- Public Attributes inherited from KoColorSpaceFactory
QHash< QString, KoColorSpace * > availableColorspaces
 
QMutex mutex
 
QHash< KoColorSpace *, QString > stackInformation
 
- Public Attributes inherited from Private
KisCanvas2canvas
 
int displayedFrame
 
int intendedFrame
 
- Protected Member Functions inherited from KoColorSpaceFactory
 KoColorSpaceFactory ()
 

Detailed Description

Definition at line 52 of file RgbU16ColorSpace.h.

Constructor & Destructor Documentation

◆ RgbU16ColorSpaceFactory()

RgbU16ColorSpaceFactory::RgbU16ColorSpaceFactory ( )
inline

Definition at line 55 of file RgbU16ColorSpace.h.

55 : LcmsColorSpaceFactory(TYPE_BGRA_16, cmsSigRgbData)
56 {
57 }
LcmsColorSpaceFactory(cmsUInt32Number cmType, cmsColorSpaceSignature colorSpaceSignature)

Member Function Documentation

◆ colorConversionLinksFromProfile()

QList< KoColorConversionTransformationFactory * > RgbU16ColorSpaceFactory::colorConversionLinksFromProfile ( const KoColorProfile * profile) const
overridevirtual

colorConversionLinksFromProfile Sometimes, we need to generate special color conversion links based on the properties of the profile. The Perceptual Quantizer profiles are an example of this. This function is called inside the color conversion system.

Parameters
profile– the profile for which to create the links for.

we cannot generate a profile at this stage, it should have been generated by the registry thanks to the call to requiredConnectionProfiles()

Reimplemented from KoColorSpaceFactory.

Definition at line 127 of file RgbU16ColorSpace.cpp.

128{
130 && profile->getColorPrimaries() != PRIMARIES_UNSPECIFIED) {
131
134
137 const KoColorProfile *connectionProfile = registry->profileFor(query, false);
139
140 LcmsRGBP2020PQColorSpaceFactoryWrapper<RgbU16ColorSpaceFactory> factory(profile->name(), connectionProfile->name());
141 return factory.colorConversionLinks();
142 } else if (profile->name() == "High Dynamic Range UHDTV Wide Color Gamut Display (Rec. 2020) - SMPTE ST 2084 PQ EOTF") {
145 return factory.colorConversionLinks();
146 }
148}
@ PRIMARIES_UNSPECIFIED
@ TRC_ITU_R_BT_2100_0_PQ
#define KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(cond, val)
Definition kis_assert.h:129
The KoColorProfileQuery struct.
virtual ColorPrimaries getColorPrimaries() const
getColorPrimaries
virtual TransferCharacteristics getTransferCharacteristics() const
getTransferCharacteristics This function should be subclassed at some point so we can get the value f...
static KoColorSpaceRegistry * instance()
const KoColorProfile * profileFor(const KoColorProfileQuery &query, const bool generate=true) const
profileFor tries to find the profile that matches these characteristics, if no such profile is found,...
const KoColorProfile * p2020G10Profile() const

References LcmsRGBP2020PQColorSpaceFactoryWrapper< BaseColorSpaceFactory >::colorConversionLinks(), KoColorProfile::getColorPrimaries(), KoColorProfile::getTransferCharacteristics(), KoColorSpaceRegistry::instance(), KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, KoColorProfile::name, KoColorSpaceRegistry::p2020G10Profile(), PRIMARIES_UNSPECIFIED, KoColorSpaceRegistry::profileFor(), TRC_ITU_R_BT_2100_0_PQ, and TRC_LINEAR.

◆ colorDepthId()

KoID RgbU16ColorSpaceFactory::colorDepthId ( ) const
inlineoverridevirtual
Returns
a string that identify the bit depth (for instance "U8" or "F16" ...)
See also
KoColorModelStandardIds.h

Implements KoColorSpaceFactory.

Definition at line 75 of file RgbU16ColorSpace.h.

76 {
78 }
const KoID Integer16BitsColorDepthID("U16", ki18n("16-bit integer/channel"))

References Integer16BitsColorDepthID.

◆ colorModelId()

KoID RgbU16ColorSpaceFactory::colorModelId ( ) const
inlineoverridevirtual
Returns
a string that identify the color model (for instance "RGB" or "CMYK" ...)
See also
KoColorModelStandardIds.h

Implements KoColorSpaceFactory.

Definition at line 71 of file RgbU16ColorSpace.h.

72 {
73 return RGBAColorModelID;
74 }
const KoID RGBAColorModelID("RGBA", ki18n("RGB/Alpha"))

References RGBAColorModelID.

◆ createColorSpace()

KoColorSpace * RgbU16ColorSpaceFactory::createColorSpace ( const KoColorProfile * ) const
inlineoverridevirtual

creates a color space using the given profile.

Implements KoColorSpaceFactory.

Definition at line 84 of file RgbU16ColorSpace.h.

85 {
86 return new RgbU16ColorSpace(name(), p->clone());
87 }
const Params2D p
QString name() const override

References name(), and p.

◆ defaultProfile()

QString RgbU16ColorSpaceFactory::defaultProfile ( ) const
inlineoverridevirtual

Returns the default icc profile for use with this colorspace. This may be ""

Returns
the default icc profile name

Implements KoColorSpaceFactory.

Definition at line 89 of file RgbU16ColorSpace.h.

90 {
91 return "sRGB-elle-V2-g10.icc";//this is a linear space, because 16bit is enough to only enjoy advantages of linear space
92 }

◆ id()

QString RgbU16ColorSpaceFactory::id ( ) const
inlineoverridevirtual

Return the unchanging name of this color space

Implements KoColorSpaceFactory.

Definition at line 58 of file RgbU16ColorSpace.h.

59 {
61 }
static QString colorSpaceId()

References RgbU16ColorSpace::colorSpaceId().

◆ name()

QString RgbU16ColorSpaceFactory::name ( ) const
inlineoverridevirtual

return the i18n'able description.

Implements KoColorSpaceFactory.

Definition at line 62 of file RgbU16ColorSpace.h.

63 {
64 return QString("%1 (%2)").arg(RGBAColorModelID.name()).arg(Integer16BitsColorDepthID.name());
65 }
QString name() const
Definition KoID.cpp:68

References Integer16BitsColorDepthID, KoID::name(), and RGBAColorModelID.

◆ referenceDepth()

int RgbU16ColorSpaceFactory::referenceDepth ( ) const
inlineoverridevirtual
Returns
the reference depth, that is for a color space where all channels have the same depth, this is the depth of one channel, for a color space with different bit depth for each channel, it's usually the highest bit depth. This value is used by the Color Conversion System to check if a lost of bit depth during a color conversion is acceptable, for instance when converting from RGB32bit to XYZ16bit, it's acceptable to go through a conversion to RGB16bit, while it's not the case for RGB32bit to XYZ32bit.

Implements KoColorSpaceFactory.

Definition at line 79 of file RgbU16ColorSpace.h.

80 {
81 return 16;
82 }

◆ requiredConnectionProfiles()

QList< KoColorProfileQuery > RgbU16ColorSpaceFactory::requiredConnectionProfiles ( const KoColorProfile * profile) const
overridevirtual

◆ userVisible()

bool RgbU16ColorSpaceFactory::userVisible ( ) const
inlineoverridevirtual
Returns
true if the color space should be shown in a User Interface, or false otherwise.

Implements KoColorSpaceFactory.

Definition at line 67 of file RgbU16ColorSpace.h.

68 {
69 return true;
70 }

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