37class DImgLoaderObserver;
57 LoadImageHistory = 32,
65 LoadAll = LoadItemInfo | LoadMetadata | LoadICCData | LoadImageData | LoadUniqueHash | LoadImageHistory
67 Q_DECLARE_FLAGS(LoadFlags, LoadFlag)
71 void setLoadFlags(LoadFlags flags);
78 virtual bool hasLoadedData()
const;
83 static unsigned char* new_failureTolerant(
size_t unsecureSize);
84 static unsigned char* new_failureTolerant(quint64 w, quint64 h, uint typesPerPixel);
85 static unsigned short* new_short_failureTolerant(
size_t unsecureSize);
86 static unsigned short* new_short_failureTolerant(quint64 w, quint64 h, uint typesPerPixel);
88 static int convertCompressionForLibPng(
int value);
89 static int convertCompressionForLibJpeg(
int value);
96 static qint64 checkAllocation(qint64 fullSize);
105 unsigned char*& imageData();
106 unsigned int& imageWidth();
107 unsigned int& imageHeight();
109 bool imageHasAlpha()
const;
110 bool imageSixteenBit()
const;
112 quint64 imageNumBytes()
const;
113 int imageBitsDepth()
const;
114 int imageBytesDepth()
const;
116 void imageSetIccProfile(
const IccProfile& profile);
117 QVariant imageGetAttribute(
const QString& key)
const;
118 void imageSetAttribute(
const QString& key,
119 const QVariant&
value);
121 QMap<QString, QString>& imageEmbeddedText()
const;
122 QString imageGetEmbbededText(
const QString& key)
const;
123 void imageSetEmbbededText(
const QString& key,
124 const QString& text);
126 void loadingFailed();
127 bool checkExifWorkingColorSpace()
const;
128 void purgeExifWorkingColorSpace();
129 void storeColorProfileInMetadata();
131 virtual bool readMetadata(
const QString& filePath);
132 virtual bool saveMetadata(
const QString& filePath);
133 virtual int granularity(
DImgLoaderObserver*
const observer,
int total,
float progressSlice = 1.0F);
138 LoadFlags m_loadFlags = LoadAll;
156template <
typename Type>
159 quint64 requested = w * h * (quint64)typesPerPixel;
161 if (requested >= std::numeric_limits<size_t>::max())
163 qCCritical(DIGIKAM_DIMG_LOG) <<
"Requested memory of" << requested * quint64(
sizeof(
Type))
164 <<
"is larger than size_t supported by platform.";
168 return new_failureTolerant<Type>(requested);
171template <
typename Type>
195 Type*
const reserved =
new (std::nothrow)
Type[size];
199 qCCritical(DIGIKAM_DIMG_LOG) <<
"Failed to allocate chunk of memory of size" << size;
205Q_DECLARE_OPERATORS_FOR_FLAGS(DImgLoader::LoadFlags)
Definition dimgloaderobserver.h:31
Definition dimgloader.h:41
virtual bool hasAlpha() const =0
static unsigned char * new_failureTolerant(size_t unsecureSize)
Definition dimgloader.cpp:286
static Type * new_failureTolerant(quint64 w, quint64 h, uint typesPerPixel)
static Type * new_failureTolerant(size_t unsecureSize)
LoadFlag
Definition dimgloader.h:48
virtual bool isReadOnly() const =0
virtual bool save(const QString &filePath, DImgLoaderObserver *const observer)=0
static qint64 checkAllocation(qint64 fullSize)
Definition dimgloader.cpp:159
virtual bool load(const QString &filePath, DImgLoaderObserver *const observer)=0
virtual bool sixteenBit() const =0
Definition iccprofile.h:33
qulonglong value
Definition itemviewutilities.cpp:585
Definition datefolderview.cpp:34
Type
Definition gpsitemcontainer.h:36