Krita Source Code Documentation
Loading...
Searching...
No Matches
KoColorConversionFromAlphaTransformationFactoryImpl< alpha_channel_type > Class Template Reference

#include <KoColorConversionAlphaTransformation.h>

+ Inheritance diagram for KoColorConversionFromAlphaTransformationFactoryImpl< alpha_channel_type >:

Public Member Functions

KoColorConversionTransformationcreateColorTransformation (const KoColorSpace *srcColorSpace, const KoColorSpace *dstColorSpace, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags) const override
 
 KoColorConversionFromAlphaTransformationFactoryImpl (const QString &_dstModelId, const QString &_dstDepthId, const QString &_dstProfileName)
 
- Public Member Functions inherited from KoColorConversionTransformationFactory
QString dstColorDepthId () const
 
QString dstColorModelId () const
 
QString dstProfile () const
 
 KoColorConversionTransformationFactory (const QString &_srcModelId, const QString &_srcDepthId, const QString &_srcProfile, const QString &_dstModelId, const QString &_dstDepthId, const QString &_dstProfile)
 
QString srcColorDepthId () const
 
QString srcColorModelId () const
 
QString srcProfile () const
 
 ~KoColorConversionTransformationFactory () override
 
- Public Member Functions inherited from Private
 Private (KisCanvas2 *c)
 
- Public Member Functions inherited from KoColorConversionTransformationAbstractFactory
virtual KoColorProofingConversionTransformationcreateColorProofingTransformation (const KoColorSpace *srcColorSpace, const KoColorSpace *dstColorSpace, const KoColorSpace *proofingSpace, KoColorProofingConversionTransformation::Intent renderingIntent, KoColorProofingConversionTransformation::Intent proofingIntent, bool bpcFirstTransform, quint8 *gamutWarning, KoColorConversionTransformation::ConversionFlags displayConversionFlags) const
 
 KoColorConversionTransformationAbstractFactory ()
 
virtual ~KoColorConversionTransformationAbstractFactory ()
 

Additional Inherited Members

- Public Attributes inherited from KoColorConversionTransformationFactory
QString dstDepthId
 
QString dstModelId
 
QString dstProfile
 
QString srcDepthId
 
QString srcModelId
 
QString srcProfile
 
- Public Attributes inherited from Private
KisCanvas2canvas
 
int displayedFrame
 
int intendedFrame
 
- Protected Member Functions inherited from KoColorConversionTransformationFactory
bool canBeDestination (const KoColorSpace *dstCS) const
 
bool canBeSource (const KoColorSpace *srcCS) const
 

Detailed Description

template<typename alpha_channel_type>
class KoColorConversionFromAlphaTransformationFactoryImpl< alpha_channel_type >

Create converter from the alpha color space to any color space This class is for use by the KoColorConversionSystem, no reason to use it directly.

Definition at line 24 of file KoColorConversionAlphaTransformation.h.

Constructor & Destructor Documentation

◆ KoColorConversionFromAlphaTransformationFactoryImpl()

template<typename alpha_channel_type >
KoColorConversionFromAlphaTransformationFactoryImpl< alpha_channel_type >::KoColorConversionFromAlphaTransformationFactoryImpl ( const QString & _dstModelId,
const QString & _dstDepthId,
const QString & _dstProfileName )

Definition at line 110 of file KoColorConversionAlphaTransformation.cpp.

113 colorDepthIdForChannelType<alpha_channel_type>().id(),
114 "default",
115 _dstModelId, _dstDepthId, _dstProfileName)
116{
117}
const KoID AlphaColorModelID("A", ki18n("Alpha mask"))
QString id() const
Definition KoID.cpp:63
KoColorConversionTransformationFactory(const QString &_srcModelId, const QString &_srcDepthId, const QString &_srcProfile, const QString &_dstModelId, const QString &_dstDepthId, const QString &_dstProfile)

Member Function Documentation

◆ createColorTransformation()

template<typename alpha_channel_type >
KoColorConversionTransformation * KoColorConversionFromAlphaTransformationFactoryImpl< alpha_channel_type >::createColorTransformation ( const KoColorSpace * srcColorSpace,
const KoColorSpace * dstColorSpace,
KoColorConversionTransformation::Intent renderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags ) const
overridevirtual

Creates a color transformation between the source color space and the destination color space.

Parameters
srcColorSpacesource color space
dstColorSpacedestination color space
renderingIntentrendering intent
conversionFlagsconversion flags

Implements KoColorConversionTransformationAbstractFactory.

Definition at line 121 of file KoColorConversionAlphaTransformation.cpp.

126{
127 Q_ASSERT(canBeSource(srcColorSpace));
128 Q_ASSERT(canBeDestination(dstColorSpace));
129
130 if (dstColorSpace->colorModelId() == GrayAColorModelID &&
131 dstColorSpace->colorDepthId() == Integer8BitsColorDepthID) {
132 return new KoColorConversionGrayAFromAlphaTransformation<alpha_channel_type, quint8>(srcColorSpace, dstColorSpace, renderingIntent, conversionFlags);
133
134 } else if (dstColorSpace->colorModelId() == GrayAColorModelID &&
135 dstColorSpace->colorDepthId() == Integer16BitsColorDepthID) {
136 return new KoColorConversionGrayAFromAlphaTransformation<alpha_channel_type, quint16>(srcColorSpace, dstColorSpace, renderingIntent, conversionFlags);
137
138 #ifdef HAVE_OPENEXR
139 } else if (dstColorSpace->colorModelId() == GrayAColorModelID &&
140 dstColorSpace->colorDepthId() == Float16BitsColorDepthID) {
141 return new KoColorConversionGrayAFromAlphaTransformation<alpha_channel_type, half>(srcColorSpace, dstColorSpace, renderingIntent, conversionFlags);
142 #endif
143
144 } else if (dstColorSpace->colorModelId() == GrayAColorModelID &&
145 dstColorSpace->colorDepthId() == Float32BitsColorDepthID) {
146 return new KoColorConversionGrayAFromAlphaTransformation<alpha_channel_type, float>(srcColorSpace, dstColorSpace, renderingIntent, conversionFlags);
147
148 } else if (dstColorSpace->colorModelId() == LABAColorModelID &&
149 dstColorSpace->colorDepthId() == Integer16BitsColorDepthID) {
150 return new KoColorConversionAlphaToLab16Transformation<alpha_channel_type>(srcColorSpace, dstColorSpace, renderingIntent, conversionFlags);
151
152 } else {
153 return new KoColorConversionFromAlphaTransformation<alpha_channel_type>(srcColorSpace, dstColorSpace, renderingIntent, conversionFlags);
154 }
155}
const KoID Float32BitsColorDepthID("F32", ki18n("32-bit float/channel"))
const KoID GrayAColorModelID("GRAYA", ki18n("Grayscale/Alpha"))
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"))
const KoID LABAColorModelID("LABA", ki18n("L*a*b*/Alpha"))
virtual KoID colorModelId() const =0
virtual KoID colorDepthId() const =0

References KoColorSpace::colorDepthId(), KoColorSpace::colorModelId(), Float16BitsColorDepthID, Float32BitsColorDepthID, GrayAColorModelID, Integer16BitsColorDepthID, Integer8BitsColorDepthID, and LABAColorModelID.


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