Changeset View
Changeset View
Standalone View
Standalone View
krita/ui/opengl/kis_opengl_image_textures.h
Show All 16 Lines | |||||
17 | */ | 17 | */ | ||
18 | #ifndef KIS_OPENGL_IMAGE_TEXTURES_H_ | 18 | #ifndef KIS_OPENGL_IMAGE_TEXTURES_H_ | ||
19 | #define KIS_OPENGL_IMAGE_TEXTURES_H_ | 19 | #define KIS_OPENGL_IMAGE_TEXTURES_H_ | ||
20 | 20 | | |||
21 | #include <KoConfig.h> // for HAVE_OPENGL | 21 | #include <KoConfig.h> // for HAVE_OPENGL | ||
22 | 22 | | |||
23 | #ifdef HAVE_OPENGL | 23 | #ifdef HAVE_OPENGL | ||
24 | 24 | | |||
25 | #include <QObject> | | |||
26 | #include <QVector> | 25 | #include <QVector> | ||
27 | #include <QMap> | 26 | #include <QMap> | ||
28 | 27 | | |||
29 | #include "kritaui_export.h" | 28 | #include "kritaui_export.h" | ||
30 | 29 | | |||
31 | #include "kis_shared.h" | 30 | #include "kis_shared.h" | ||
32 | 31 | | |||
33 | #include "canvas/kis_update_info.h" | 32 | #include "canvas/kis_update_info.h" | ||
34 | #include "opengl/kis_texture_tile.h" | 33 | #include "opengl/kis_texture_tile.h" | ||
35 | 34 | | |||
36 | class KisOpenGLImageTextures; | 35 | class KisOpenGLImageTextures; | ||
37 | class QOpenGLFunctions; | 36 | class QOpenGLFunctions; | ||
38 | typedef KisSharedPtr<KisOpenGLImageTextures> KisOpenGLImageTexturesSP; | 37 | typedef KisSharedPtr<KisOpenGLImageTextures> KisOpenGLImageTexturesSP; | ||
39 | 38 | | |||
40 | class KoColorProfile; | 39 | class KoColorProfile; | ||
41 | 40 | | |||
42 | /** | 41 | /** | ||
43 | * A set of OpenGL textures that contains the projection of a KisImage. | 42 | * A set of OpenGL textures that contains the projection of a KisImage. | ||
44 | */ | 43 | */ | ||
45 | class KRITAUI_EXPORT KisOpenGLImageTextures : public QObject, public KisShared | 44 | class KRITAUI_EXPORT KisOpenGLImageTextures : public KisShared | ||
46 | { | 45 | { | ||
47 | Q_OBJECT | | |||
48 | | ||||
49 | public: | 46 | public: | ||
50 | /** | 47 | /** | ||
51 | * Obtain a KisOpenGLImageTextures object for the given image. | 48 | * Obtain a KisOpenGLImageTextures object for the given image. | ||
52 | * @param image The image | 49 | * @param image The image | ||
53 | * @param monitorProfile The profile of the display device | 50 | * @param monitorProfile The profile of the display device | ||
54 | */ | 51 | */ | ||
55 | static KisOpenGLImageTexturesSP getImageTextures(KisImageWSP image, | 52 | static KisOpenGLImageTexturesSP getImageTextures(KisImageWSP image, | ||
56 | const KoColorProfile *monitorProfile, KoColorConversionTransformation::Intent renderingIntent, | 53 | const KoColorProfile *monitorProfile, KoColorConversionTransformation::Intent renderingIntent, | ||
▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Line(s) | 105 | public: | |||
134 | inline qreal texelSize() const { | 131 | inline qreal texelSize() const { | ||
135 | Q_ASSERT(m_texturesInfo.width == m_texturesInfo.height); | 132 | Q_ASSERT(m_texturesInfo.width == m_texturesInfo.height); | ||
136 | return 1.0 / m_texturesInfo.width; | 133 | return 1.0 / m_texturesInfo.width; | ||
137 | } | 134 | } | ||
138 | 135 | | |||
139 | KisOpenGLUpdateInfoSP updateCache(const QRect& rect); | 136 | KisOpenGLUpdateInfoSP updateCache(const QRect& rect); | ||
140 | KisOpenGLUpdateInfoSP updateCacheNoConversion(const QRect& rect); | 137 | KisOpenGLUpdateInfoSP updateCacheNoConversion(const QRect& rect); | ||
141 | 138 | | |||
142 | public Q_SLOTS: | | |||
143 | | ||||
144 | void recalculateCache(KisUpdateInfoSP info); | 139 | void recalculateCache(KisUpdateInfoSP info); | ||
145 | 140 | | |||
146 | void slotImageSizeChanged(qint32 w, qint32 h); | 141 | void slotImageSizeChanged(qint32 w, qint32 h); | ||
147 | 142 | | |||
148 | protected: | 143 | protected: | ||
149 | 144 | | |||
150 | KisOpenGLImageTextures(KisImageWSP image, const KoColorProfile *monitorProfile, | 145 | KisOpenGLImageTextures(KisImageWSP image, const KoColorProfile *monitorProfile, | ||
151 | KoColorConversionTransformation::Intent renderingIntent, | 146 | KoColorConversionTransformation::Intent renderingIntent, | ||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |