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

#include <KoColorConversionAlphaTransformation.h>

+ Inheritance diagram for KoColorConversionToAlphaTransformationFactoryImpl< alpha_channel_type >:

Public Member Functions

KoColorConversionTransformationcreateColorTransformation (const KoColorSpace *srcColorSpace, const KoColorSpace *dstColorSpace, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags) const override
 
 KoColorConversionToAlphaTransformationFactoryImpl (const QString &_dstModelId, const QString &_dstDepthId, const QString &_srcProfileName)
 
- 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 KoColorConversionToAlphaTransformationFactoryImpl< alpha_channel_type >

Create converter to 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 47 of file KoColorConversionAlphaTransformation.h.

Constructor & Destructor Documentation

◆ KoColorConversionToAlphaTransformationFactoryImpl()

template<typename alpha_channel_type >
KoColorConversionToAlphaTransformationFactoryImpl< alpha_channel_type >::KoColorConversionToAlphaTransformationFactoryImpl ( const QString & _dstModelId,
const QString & _dstDepthId,
const QString & _srcProfileName )

Definition at line 256 of file KoColorConversionAlphaTransformation.cpp.

258 : KoColorConversionTransformationFactory(_srcModelId, _srcDepthId, _srcProfileName,
259 AlphaColorModelID.id(), colorDepthIdForChannelType<alpha_channel_type>().id(), "default")
260{
261}
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 * KoColorConversionToAlphaTransformationFactoryImpl< 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 265 of file KoColorConversionAlphaTransformation.cpp.

270{
271 Q_ASSERT(canBeSource(srcColorSpace));
272 Q_ASSERT(canBeDestination(dstColorSpace));
273
274 if (srcColorSpace->colorModelId() == GrayAColorModelID &&
275 srcColorSpace->colorDepthId() == Integer8BitsColorDepthID) {
276 return new KoColorConversionGrayAToAlphaTransformation<quint8, alpha_channel_type>(srcColorSpace, dstColorSpace, renderingIntent, conversionFlags);
277
278 } else if (srcColorSpace->colorModelId() == GrayAColorModelID &&
279 srcColorSpace->colorDepthId() == Integer16BitsColorDepthID) {
280 return new KoColorConversionGrayAToAlphaTransformation<quint16, alpha_channel_type>(srcColorSpace, dstColorSpace, renderingIntent, conversionFlags);
281
282#ifdef HAVE_OPENEXR
283 } else if (srcColorSpace->colorModelId() == GrayAColorModelID &&
284 srcColorSpace->colorDepthId() == Float16BitsColorDepthID) {
285 return new KoColorConversionGrayAToAlphaTransformation<half, alpha_channel_type>(srcColorSpace, dstColorSpace, renderingIntent, conversionFlags);
286#endif
287
288 } else if (srcColorSpace->colorModelId() == GrayAColorModelID &&
289 srcColorSpace->colorDepthId() == Float32BitsColorDepthID) {
290 return new KoColorConversionGrayAToAlphaTransformation<float, alpha_channel_type>(srcColorSpace, dstColorSpace, renderingIntent, conversionFlags);
291
292 } else if (srcColorSpace->colorModelId() == LABAColorModelID &&
293 srcColorSpace->colorDepthId() == Integer16BitsColorDepthID) {
294 return new KoColorConversionLab16ToAlphaTransformation<alpha_channel_type>(srcColorSpace, dstColorSpace, renderingIntent, conversionFlags);
295
296 } else {
297 return new KoColorConversionToAlphaTransformation<alpha_channel_type>(srcColorSpace, dstColorSpace, renderingIntent, conversionFlags);
298 }
299}
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: