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

#include <KoSimpleColorSpaceFactory.h>

+ Inheritance diagram for KoSimpleColorSpaceFactory:

Public Member Functions

QList< KoColorConversionTransformationFactory * > colorConversionLinks () const override
 
KoID colorDepthId () const override
 
KoID colorModelId () const override
 
QString colorSpaceEngine () const override
 
int crossingCost () const override
 
QString defaultProfile () const override
 
QString id () const override
 
bool isHdr () const override
 
 KoSimpleColorSpaceFactory (const QString &id, const QString &name, bool userVisible, const KoID &colorModelId, const KoID &colorDepthId, int referenceDepth=-1, int crossingCost=1)
 
QString name () const override
 
bool profileIsCompatible (const KoColorProfile *profile) const override
 
int referenceDepth () const override
 
bool userVisible () const override
 
- Public Member Functions inherited from KoColorSpaceFactory
const KoColorProfilecolorProfile (const QByteArray &rawData, ProfileRegistrationInterface *registrationInterface) const
 
const KoColorSpacegrabColorSpace (const KoColorProfile *profile)
 
virtual ~KoColorSpaceFactory ()
 
- Public Member Functions inherited from Private
 Private (KisCanvas2 *c)
 

Protected Member Functions

KoColorProfilecreateColorProfile (const QByteArray &) const override
 
- Protected Member Functions inherited from KoColorSpaceFactory
virtual KoColorSpacecreateColorSpace (const KoColorProfile *) const =0
 
 KoColorSpaceFactory ()
 

Private Attributes

KoID m_colorDepthId
 
KoID m_colorModelId
 
int m_crossingCost
 
QString m_id
 
QString m_name
 
int m_referenceDepth
 
bool m_userVisible
 

Additional Inherited Members

- Public Attributes inherited from KoColorSpaceFactory
QHash< QString, KoColorSpace * > availableColorspaces
 
QList< KoColorProfile * > colorprofiles
 
QMutex mutex
 
QHash< KoColorSpace *, QString > stackInformation
 
- Public Attributes inherited from Private
KisCanvas2canvas
 
int displayedFrame
 
int intendedFrame
 

Detailed Description

Definition at line 17 of file KoSimpleColorSpaceFactory.h.

Constructor & Destructor Documentation

◆ KoSimpleColorSpaceFactory()

KoSimpleColorSpaceFactory::KoSimpleColorSpaceFactory ( const QString & id,
const QString & name,
bool userVisible,
const KoID & colorModelId,
const KoID & colorDepthId,
int referenceDepth = -1,
int crossingCost = 1 )
inline

Definition at line 22 of file KoSimpleColorSpaceFactory.h.

29 : m_id(id)
30 , m_name(name)
36 {
37 if (m_referenceDepth >= 0) {
38 // noop, already initialized!
40 m_referenceDepth = 1 * 8;
42 m_referenceDepth = 2 * 8;
44 m_referenceDepth = 2 * 8;
46 m_referenceDepth = 4 * 8;
48 m_referenceDepth = 8 * 8;
49 }
50 }
const KoID Float32BitsColorDepthID("F32", ki18n("32-bit float/channel"))
const KoID Float64BitsColorDepthID("F64", ki18n("64-bit float/channel"))
const KoID Float16BitsColorDepthID("F16", ki18n("16-bit float/channel"))
const KoID Integer8BitsColorDepthID("U8", ki18n("8-bit integer/channel"))
const KoID Integer16BitsColorDepthID("U16", ki18n("16-bit integer/channel"))

References colorDepthId(), Float16BitsColorDepthID, Float32BitsColorDepthID, Float64BitsColorDepthID, Integer16BitsColorDepthID, Integer8BitsColorDepthID, and m_referenceDepth.

Member Function Documentation

◆ colorConversionLinks()

QList< KoColorConversionTransformationFactory * > KoSimpleColorSpaceFactory::colorConversionLinks ( ) const
inlineoverridevirtual
Returns
the list of color conversion provided by this colorspace, the factories constructed by this functions are owned by the caller of the function

Implements KoColorSpaceFactory.

Definition at line 93 of file KoSimpleColorSpaceFactory.h.

◆ colorDepthId()

KoID KoSimpleColorSpaceFactory::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 69 of file KoSimpleColorSpaceFactory.h.

69 {
70 return m_colorDepthId;
71 }

References m_colorDepthId.

◆ colorModelId()

KoID KoSimpleColorSpaceFactory::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 65 of file KoSimpleColorSpaceFactory.h.

65 {
66 return m_colorModelId;
67 }

References m_colorModelId.

◆ colorSpaceEngine()

QString KoSimpleColorSpaceFactory::colorSpaceEngine ( ) const
inlineoverridevirtual
Returns
the name of the color space engine for this color space, or "" if none

Implements KoColorSpaceFactory.

Definition at line 77 of file KoSimpleColorSpaceFactory.h.

77 {
78 return "simple";
79 }

◆ createColorProfile()

KoColorProfile * KoSimpleColorSpaceFactory::createColorProfile ( const QByteArray & ) const
inlineoverrideprotectedvirtual

Implements KoColorSpaceFactory.

Definition at line 101 of file KoSimpleColorSpaceFactory.h.

101 {
102 return 0;
103 }

◆ crossingCost()

int KoSimpleColorSpaceFactory::crossingCost ( ) const
inlineoverridevirtual
Returns
the cost of the usage of the colorspace in the conversion graph. The higher the cost, the less probably the color space will be chosen for the conversion.

Implements KoColorSpaceFactory.

Definition at line 89 of file KoSimpleColorSpaceFactory.h.

89 {
90 return m_crossingCost;
91 }

References m_crossingCost.

◆ defaultProfile()

QString KoSimpleColorSpaceFactory::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 97 of file KoSimpleColorSpaceFactory.h.

97 {
98 return QString("default");
99 }

◆ id()

QString KoSimpleColorSpaceFactory::id ( ) const
inlineoverridevirtual

Return the unchanging name of this color space

Implements KoColorSpaceFactory.

Definition at line 53 of file KoSimpleColorSpaceFactory.h.

53 {
54 return m_id;
55 }

References m_id.

◆ isHdr()

bool KoSimpleColorSpaceFactory::isHdr ( ) const
inlineoverridevirtual
Returns
true if the color space supports High-Dynamic Range.

Implements KoColorSpaceFactory.

Definition at line 81 of file KoSimpleColorSpaceFactory.h.

81 {
82 return false;
83 }

◆ name()

QString KoSimpleColorSpaceFactory::name ( ) const
inlineoverridevirtual

return the i18n'able description.

Implements KoColorSpaceFactory.

Definition at line 57 of file KoSimpleColorSpaceFactory.h.

57 {
58 return m_name;
59 }

References m_name.

◆ profileIsCompatible()

bool KoSimpleColorSpaceFactory::profileIsCompatible ( const KoColorProfile * profile) const
inlineoverridevirtual
Parameters
profilea pointer to a color profile
Returns
true if the color profile can be used by a color space created by this factory

Implements KoColorSpaceFactory.

Definition at line 73 of file KoSimpleColorSpaceFactory.h.

73 {
74 return dynamic_cast<const KoDummyColorProfile*>(profile);
75 }

◆ referenceDepth()

int KoSimpleColorSpaceFactory::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 85 of file KoSimpleColorSpaceFactory.h.

85 {
86 return m_referenceDepth;
87 }

References m_referenceDepth.

◆ userVisible()

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

Implements KoColorSpaceFactory.

Definition at line 61 of file KoSimpleColorSpaceFactory.h.

61 {
62 return m_userVisible;
63 }

References m_userVisible.

Member Data Documentation

◆ m_colorDepthId

KoID KoSimpleColorSpaceFactory::m_colorDepthId
private

Definition at line 110 of file KoSimpleColorSpaceFactory.h.

◆ m_colorModelId

KoID KoSimpleColorSpaceFactory::m_colorModelId
private

Definition at line 109 of file KoSimpleColorSpaceFactory.h.

◆ m_crossingCost

int KoSimpleColorSpaceFactory::m_crossingCost
private

Definition at line 112 of file KoSimpleColorSpaceFactory.h.

◆ m_id

QString KoSimpleColorSpaceFactory::m_id
private

Definition at line 106 of file KoSimpleColorSpaceFactory.h.

◆ m_name

QString KoSimpleColorSpaceFactory::m_name
private

Definition at line 107 of file KoSimpleColorSpaceFactory.h.

◆ m_referenceDepth

int KoSimpleColorSpaceFactory::m_referenceDepth
private

Definition at line 111 of file KoSimpleColorSpaceFactory.h.

◆ m_userVisible

bool KoSimpleColorSpaceFactory::m_userVisible
private

Definition at line 108 of file KoSimpleColorSpaceFactory.h.


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