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

#include <ColorModelPerLayerCheck.h>

+ Inheritance diagram for ColorModelPerLayerCheck:

Public Member Functions

Level check (KisImageSP) const override
 
bool checkNeeded (KisImageSP image) const override
 
 ColorModelPerLayerCheck (const KoID &colorModelID, const KoID &colorDepthID, const QString &id, Level level, const QString &customWarning=QString())
 
- Public Member Functions inherited from KisExportCheckBase
virtual QString id () const
 
 KisExportCheckBase (const QString &id, Level level, const QString &customWarning=QString(), bool perLayerCheck=false)
 KisExportCheckBase.
 
virtual bool perLayerCheck () const
 
QString warning () const
 
virtual ~KisExportCheckBase ()
 

Public Attributes

const KoID m_colorDepthID
 
const KoID m_ColorModelID
 

Additional Inherited Members

- Public Types inherited from KisExportCheckBase
enum  Level { SUPPORTED , PARTIALLY , UNSUPPORTED }
 
- Protected Attributes inherited from KisExportCheckBase
QString m_id
 
Level m_level {UNSUPPORTED}
 
bool m_perLayerCheck {false}
 
QString m_warning
 

Detailed Description

Definition at line 103 of file ColorModelPerLayerCheck.h.

Constructor & Destructor Documentation

◆ ColorModelPerLayerCheck()

ColorModelPerLayerCheck::ColorModelPerLayerCheck ( const KoID & colorModelID,
const KoID & colorDepthID,
const QString & id,
Level level,
const QString & customWarning = QString() )
inline

Definition at line 107 of file ColorModelPerLayerCheck.h.

108 : KisExportCheckBase(id, level, customWarning, true)
109 , m_ColorModelID(colorModelID)
110 , m_colorDepthID(colorDepthID)
111 {
112 Q_ASSERT(!colorModelID.name().isEmpty());
113 Q_ASSERT(!colorDepthID.name().isEmpty());
114
115 if (customWarning.isEmpty()) {
116 m_warning = i18nc("image conversion warning", "Your image contains layers with the color model <b>%1</b> and channel depth <b>%2</b> which cannot be saved to this format. The layers will be converted."
119 }
120 }
KisExportCheckBase(const QString &id, Level level, const QString &customWarning=QString(), bool perLayerCheck=false)
KisExportCheckBase.
QString name() const
Definition KoID.cpp:68

References m_colorDepthID, m_ColorModelID, KisExportCheckBase::m_warning, and KoID::name().

Member Function Documentation

◆ check()

Level ColorModelPerLayerCheck::check ( KisImageSP image) const
inlineoverridevirtual
Returns
the level of support for this feature

Implements KisExportCheckBase.

Definition at line 129 of file ColorModelPerLayerCheck.h.

130 {
131 return m_level;
132 }

References KisExportCheckBase::m_level.

◆ checkNeeded()

bool ColorModelPerLayerCheck::checkNeeded ( KisImageSP image) const
inlineoverridevirtual
Returns
whether the image uses this feature

Implements KisExportCheckBase.

Definition at line 122 of file ColorModelPerLayerCheck.h.

123 {
125 image->rootLayer()->accept(v);
126 return (v.count() > 0);
127 }
qreal v
KisGroupLayerSP rootLayer() const
bool accept(KisNodeVisitor &v) override

References KisGroupLayer::accept(), m_colorDepthID, m_ColorModelID, KisImage::rootLayer(), and v.

Member Data Documentation

◆ m_colorDepthID

const KoID ColorModelPerLayerCheck::m_colorDepthID

Definition at line 135 of file ColorModelPerLayerCheck.h.

◆ m_ColorModelID

const KoID ColorModelPerLayerCheck::m_ColorModelID

Definition at line 134 of file ColorModelPerLayerCheck.h.


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