DtkDeclarative
DTK Declarative module
载入中...
搜索中...
未找到
dopacitymasknode.h
1// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DOPACITYMASKNODE_H
6#define DOPACITYMASKNODE_H
7
8#include "dsoftwareeffectrendernode.h"
9
10#include <dtkdeclarative_global.h>
11
12DQUICK_BEGIN_NAMESPACE
13
15{
16 Q_OBJECT
17public:
18 explicit DSoftwareOpacityMaskNode(QSGTextureProvider *source, QSGTextureProvider *maskSource);
19 void setInvert(bool invert);
20
21 QRectF rect() const override { return QRect(0, 0, static_cast<int>(m_width), static_cast<int>(m_height)); }
22 void sync(QQuickItem *item) override;
23 QImage process(const QImage &sourceImage, QPainter::RenderHints hints) override;
24 void preprocess() override;
25
26private Q_SLOTS:
27 void onMaskTextureChanged();
28
29private:
30 bool m_invert = false;
31 qreal m_width = 0;
32 qreal m_height = 0;
33 QQuickItem *m_item = nullptr;
34 QImage m_maskImage;
35 QPointer<QSGTextureProvider> m_maskProvider = nullptr;
36
37};
38
39DQUICK_END_NAMESPACE
40
41#endif // DOPACITYMASKNODE_H
Definition dsoftwareeffectrendernode.h:27
Definition dopacitymasknode.h:15