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_FILTERLAYER_H
0007 #define LIBKIS_FILTERLAYER_H
0008 
0009 #include <QObject>
0010 #include "Node.h"
0011 #include <Filter.h>
0012 #include <Selection.h>
0013 
0014 #include <kis_types.h>
0015 
0016 #include "kritalibkis_export.h"
0017 #include "libkis.h"
0018 /**
0019  * @brief The FilterLayer class
0020  * A filter layer will, when compositing, take the composited
0021  * image up to the point of the loction of the filter layer
0022  * in the stack, create a copy and apply a filter.
0023  *
0024  * This means you can use blending modes on the filter layers,
0025  * which will be used to blend the filtered image with the original.
0026  *
0027  * Similarly, you can activate things like alpha inheritance, or
0028  * you can set grayscale pixeldata on the filter layer to act as
0029  * a mask.
0030  *
0031  * Filter layers can be animated.
0032  */
0033 class KRITALIBKIS_EXPORT FilterLayer : public Node
0034 {
0035     Q_OBJECT
0036     Q_DISABLE_COPY(FilterLayer)
0037 
0038 public:
0039     explicit FilterLayer(KisImageSP image, QString name, Filter &filter, Selection &selection, QObject *parent = 0);
0040     explicit FilterLayer(KisAdjustmentLayerSP layer, QObject *parent = 0);
0041     ~FilterLayer() override;
0042 public Q_SLOTS:
0043 
0044     /**
0045      * @brief type Krita has several types of nodes, split in layers and masks. Group
0046      * layers can contain other layers, any layer can contain masks.
0047      *
0048      * @return "filterlayer"
0049      */
0050     QString type() const override;
0051 
0052     void setFilter(Filter &filter);
0053 
0054     Filter * filter();
0055 };
0056 
0057 #endif // LIBKIS_FILTERLAYER_H
0058