File indexing completed on 2024-05-12 15:59:08

0001 /*
0002  *  SPDX-FileCopyrightText: 2017 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
0003  *
0004  *  SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 #ifndef LIBKIS_SELECTIONMASK_H
0007 #define LIBKIS_SELECTIONMASK_H
0008 
0009 #include <QObject>
0010 #include "Node.h"
0011 
0012 #include <kis_types.h>
0013 
0014 #include "kritalibkis_export.h"
0015 #include "libkis.h"
0016 
0017 /**
0018  * @brief The SelectionMask class
0019  * A selection mask is a mask type node that can be used
0020  * to store selections. In the gui, these are referred to
0021  * as local selections.
0022  *
0023  * A selection mask can hold both raster and vector selections, though
0024  * the API only supports raster selections.
0025  */
0026 class KRITALIBKIS_EXPORT SelectionMask : public Node
0027 {
0028     Q_OBJECT
0029     Q_DISABLE_COPY(SelectionMask)
0030 
0031 public:
0032     explicit SelectionMask(KisImageSP image, QString name, QObject *parent = 0);
0033     explicit SelectionMask(KisImageSP image, KisSelectionMaskSP mask, QObject *parent = 0);
0034     ~SelectionMask() override;
0035 public Q_SLOTS:
0036 
0037     /**
0038      * @brief type Krita has several types of nodes, split in layers and masks. Group
0039      * layers can contain other layers, any layer can contain masks.
0040      *
0041      * @return selectionmask
0042      *
0043      * If the Node object isn't wrapping a valid Krita layer or mask object, and
0044      * empty string is returned.
0045      */
0046     virtual QString type() const override;
0047 
0048     Selection *selection() const;
0049 
0050     void setSelection(Selection *selection);
0051 };
0052 
0053 #endif // LIBKIS_SELECTIONMASK_H
0054