DtkDeclarative
DTK Declarative module
载入中...
搜索中...
未找到
dsoftwareroundedimagenode_p.h
1
// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd.
2
//
3
// SPDX-License-Identifier: LGPL-3.0-or-later
4
5
#ifndef DSOFTWAREROUNDEDIMAGENODE_P_H
6
#define DSOFTWAREROUNDEDIMAGENODE_P_H
7
8
#include <dtkdeclarative_global.h>
9
#include <QSGRenderNode>
10
#include <QImage>
11
#include <QPainterPath>
12
13
QT_BEGIN_NAMESPACE
14
class
QQuickItem;
15
class
QSGTexture;
16
QT_END_NAMESPACE
17
18
DQUICK_BEGIN_NAMESPACE
19
20
class
Q_DECL_EXPORT
DSoftwareRoundedImageNode
:
public
QSGRenderNode
21
{
22
public
:
23
DSoftwareRoundedImageNode
(QQuickItem *owner);
24
25
void
setTexture(QSGTexture *texture);
26
inline
QSGTexture *texture()
const
27
{
return
m_texture;}
28
void
setRadius(qreal radius);
29
void
setSmooth(
bool
smooth);
30
void
setSourceRect(
const
QRectF &source);
31
void
setRect(
const
QRectF &target);
32
33
void
render(
const
RenderState *state)
override
;
34
void
releaseResources()
override
;
35
RenderingFlags flags()
const override
;
36
QRectF rect()
const override
;
37
38
private
:
39
void
updateCachedImage();
40
QRectF convertToTextureNormalizedSourceRect()
const
;
41
42
qreal radius = 0;
43
bool
smooth =
false
;
44
QRectF sourceRect;
45
QRectF targetRect;
46
QPainterPath clipPath;
47
48
QSGTexture *m_texture =
nullptr
;
49
QQuickItem *item =
nullptr
;
50
QImage cachedImage;
51
};
52
53
DQUICK_END_NAMESPACE
54
55
#endif
// DSOFTWAREROUNDEDIMAGENODE_P_H
Dtk::Quick::DSoftwareRoundedImageNode
Definition
dsoftwareroundedimagenode_p.h:21
src
private
dsoftwareroundedimagenode_p.h
文档生成时间:2024-02-02-06:50 +00
Doxygen Version
1.9.8
制作者:deepin doc doc go SIG
文档使用CC-BY-4.0共享