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

#include <MultiTransparencyMaskCheck.h>

+ Inheritance diagram for MultiTransparencyMaskCheck:

Public Member Functions

Level check (KisImageSP) const override
 
bool checkNeeded (KisImageSP image) const override
 
 MultiTransparencyMaskCheck (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 ()
 

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 17 of file MultiTransparencyMaskCheck.h.

Constructor & Destructor Documentation

◆ MultiTransparencyMaskCheck()

MultiTransparencyMaskCheck::MultiTransparencyMaskCheck ( const QString & id,
Level level,
const QString & customWarning = QString() )
inline

Definition at line 21 of file MultiTransparencyMaskCheck.h.

22 : KisExportCheckBase(id, level, customWarning, true)
23 {
24 if (customWarning.isEmpty()) {
25 m_warning = i18nc("image conversion warning", "The image has <b>more than one transparency mask on a layer</b>. For all layers that have multiple transparency masks, only the rendered result will be saved.");
26 }
27 }
KisExportCheckBase(const QString &id, Level level, const QString &customWarning=QString(), bool perLayerCheck=false)
KisExportCheckBase.

References KisExportCheckBase::m_warning.

Member Function Documentation

◆ check()

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

Implements KisExportCheckBase.

Definition at line 52 of file MultiTransparencyMaskCheck.h.

53 {
54 return m_level;
55 }

◆ checkNeeded()

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

Implements KisExportCheckBase.

Definition at line 29 of file MultiTransparencyMaskCheck.h.

30 {
32 [] (KisNodeSP node)
33 {
34 quint32 transparencyMasks = 0;
35 KisNodeSP mask;
36
37 for (mask = node->firstChild(); mask != 0; mask = mask->nextSibling()) {
38 if (mask->inherits("KisTransparencyMask")) {
39 transparencyMasks += 1;
40 if (transparencyMasks > 1) {
41 return true;
42 }
43 }
44 }
45
46 return false;
47 });
48
49 return (layer != 0);
50 }
KisGroupLayerSP rootLayer() const
KisNodeSP recursiveFindNode(KisNodeSP node, std::function< bool(KisNodeSP)> func)

References KisLayerUtils::recursiveFindNode(), and KisImage::rootLayer().


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