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

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_FILTERMASK_H
0007 #define LIBKIS_FILTERMASK_H
0008 
0009 #include <QObject>
0010 #include "Node.h"
0011 #include "Filter.h"
0012 
0013 #include <kis_types.h>
0014 
0015 #include "kritalibkis_export.h"
0016 #include "libkis.h"
0017 
0018 /**
0019  * @brief The FilterMask class
0020  * A filter mask, unlike a filter layer, will add a non-destructive filter
0021  * to the composited image of the node it is attached to.
0022  *
0023  * You can set grayscale pixeldata on the filter mask to adjust where the filter is applied.
0024  *
0025  * Filtermasks can be animated.
0026  */
0027 
0028 class KRITALIBKIS_EXPORT FilterMask : public Node
0029 {
0030     Q_OBJECT
0031     Q_DISABLE_COPY(FilterMask)
0032 
0033 public:
0034     explicit FilterMask(KisImageSP image, QString name, Filter &filter, QObject *parent = 0);
0035     explicit FilterMask(KisImageSP image, KisFilterMaskSP mask, QObject *parent=0);
0036     ~FilterMask() override;
0037 public Q_SLOTS:
0038 
0039     /**
0040      * @brief type Krita has several types of nodes, split in layers and masks. Group
0041      * layers can contain other layers, any layer can contain masks.
0042      *
0043      * @return The type of the node. Valid types are:
0044      * <ul>
0045      *  <li>paintlayer
0046      *  <li>grouplayer
0047      *  <li>filelayer
0048      *  <li>filterlayer
0049      *  <li>filllayer
0050      *  <li>clonelayer
0051      *  <li>vectorlayer
0052      *  <li>transparencymask
0053      *  <li>filtermask
0054      *  <li>transformmask
0055      *  <li>selectionmask
0056      *  <li>colorizemask
0057      * </ul>
0058      *
0059      * If the Node object isn't wrapping a valid Krita layer or mask object, and
0060      * empty string is returned.
0061      */
0062     QString type() const override;
0063 
0064     void setFilter(Filter &filter);
0065     Filter *filter();
0066 };
0067 
0068 #endif // LIBKIS_FILTERMASK_H
0069 
0070