1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QQUICKIMAGE_P_P_H
5#define QQUICKIMAGE_P_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include "qquickimagebase_p_p.h"
19#include "qquickimage_p.h"
20#include <QtQuick/qsgtextureprovider.h>
21
22QT_BEGIN_NAMESPACE
23
24class Q_QUICK_PRIVATE_EXPORT QQuickImageTextureProvider : public QSGTextureProvider
25{
26 Q_OBJECT
27public:
28 QQuickImageTextureProvider();
29
30 void updateTexture(QSGTexture *texture);
31
32 QSGTexture *texture() const override ;
33
34 friend class QQuickImage;
35
36 QSGTexture *m_texture;
37 bool m_smooth;
38 bool m_mipmap;
39};
40
41class Q_QUICK_PRIVATE_EXPORT QQuickImagePrivate : public QQuickImageBasePrivate
42{
43 Q_DECLARE_PUBLIC(QQuickImage)
44
45public:
46 QQuickImagePrivate();
47 void setImage(const QImage &img);
48 void setPixmap(const QQuickPixmap &pixmap);
49
50 bool pixmapChanged : 1;
51 bool mipmap : 1;
52 QQuickImage::HAlignment hAlign = QQuickImage::AlignHCenter;
53 QQuickImage::VAlignment vAlign = QQuickImage::AlignVCenter;
54 QQuickImage::FillMode fillMode = QQuickImage::Stretch;
55
56 qreal paintedWidth = 0;
57 qreal paintedHeight = 0;
58 QQuickImageTextureProvider *provider = nullptr;
59};
60
61QT_END_NAMESPACE
62
63#endif // QQUICKIMAGE_P_P_H
64

source code of qtdeclarative/src/quick/items/qquickimage_p_p.h