digiKam
Loading...
Searching...
No Matches
dimgitems_p.h
Go to the documentation of this file.
1/* ============================================================
2 *
3 * This file is a part of digiKam project
4 * https://www.digikam.org
5 *
6 * Date : 2010-04-30
7 * Description : Graphics View item for DImg - Private containers
8 *
9 * SPDX-FileCopyrightText: 2010-2012 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
10 *
11 * SPDX-License-Identifier: GPL-2.0-or-later
12 *
13 * ============================================================ */
14
15#pragma once
16
17// Qt includes
18
19#include <QPixmapCache>
20#include <QQueue>
21#include <QString>
22
23// Local includes
24
25#include "digikam_export.h"
26#include "dimg.h"
27#include "dimgpreviewitem.h"
28#include "imagezoomsettings.h"
29#include "previewsettings.h"
30
31namespace Digikam
32{
33
35{
36public:
37
38 CachedPixmapKey() = default;
39
40 QRect region;
41 QPixmapCache::Key key;
42};
43
44// -------------------------------------------------------------------------------
45
47{
48public:
49
50 explicit CachedPixmaps(int maxCount = 2);
52
53 void setMaxCount(int);
54 void clear();
55 bool find(const QRect& region, QPixmap* const pix, QRect* const source);
56 void insert(const QRect& region, const QPixmap& pixmap);
57
58protected:
59
60 int maxCount = 2;
61 QQueue<CachedPixmapKey> keys;
62
63private:
64
65 // Disable
66 CachedPixmaps(const CachedPixmaps&) = delete;
67 CachedPixmaps& operator=(const CachedPixmaps&) = delete;
68};
69
70// -------------------------------------------------------------------------------
71
72class DIGIKAM_EXPORT GraphicsDImgItem::GraphicsDImgItemPrivate
73{
74public:
75
77
78 void init(GraphicsDImgItem* const q);
79
80public:
81
85};
86
87// -------------------------------------------------------------------------------
88
90class DImgPreviewItem;
91
92class DIGIKAM_EXPORT DImgPreviewItem::DImgPreviewItemPrivate : public GraphicsDImgItem::GraphicsDImgItemPrivate
93{
94public:
95
97 void init(DImgPreviewItem* const q);
98
99public:
100
101 DImgPreviewItem::State state = DImgPreviewItem::NoImage;
102 bool exifRotate = false;
103 int previewSize = 1024;
104
105 QString path;
107 PreviewLoadThread* previewThread = nullptr;
108 PreviewLoadThread* preloadThread = nullptr;
109 QStringList pathsToPreload;
110};
111
112} // namespace Digikam
Definition dimgitems_p.h:35
QRect region
Definition dimgitems_p.h:40
QPixmapCache::Key key
Definition dimgitems_p.h:41
Definition dimgitems_p.h:47
~CachedPixmaps()
Definition graphicsdimgitem.cpp:43
QQueue< CachedPixmapKey > keys
Definition dimgitems_p.h:61
void clear()
Definition graphicsdimgitem.cpp:53
void setMaxCount(int)
Definition graphicsdimgitem.cpp:48
void insert(const QRect &region, const QPixmap &pixmap)
Definition graphicsdimgitem.cpp:97
bool find(const QRect &region, QPixmap *const pix, QRect *const source)
Definition graphicsdimgitem.cpp:63
int maxCount
Definition dimgitems_p.h:60
Definition dimgitems_p.h:93
QString path
Definition dimgitems_p.h:105
State
Definition dimgpreviewitem.h:42
QStringList pathsToPreload
Definition dimgitems_p.h:109
PreviewSettings previewSettings
Definition dimgitems_p.h:106
void init(DImgPreviewItem *const q)
DImgPreviewItemPrivate()=default
Definition dimg.h:52
Definition dimgitems_p.h:73
DImg image
Definition dimgitems_p.h:82
CachedPixmaps cachedPixmaps
Definition dimgitems_p.h:84
void init(GraphicsDImgItem *const q)
ImageZoomSettings zoomSettings
Definition dimgitems_p.h:83
Definition imagezoomsettings.h:32
Definition previewloadthread.h:26
Definition previewsettings.h:25
Definition datefolderview.cpp:34