digiKam
Loading...
Searching...
No Matches
Digikam::DImgLoader Class Referenceabstract

#include <dimgloader.h>

Public Types

enum  LoadFlag {
  LoadItemInfo = 1 , LoadMetadata = 2 , LoadICCData = 4 , LoadImageData = 8 ,
  LoadUniqueHash = 16 , LoadImageHistory = 32 , LoadPreview = 64 , LoadAll = LoadItemInfo | LoadMetadata | LoadICCData | LoadImageData | LoadUniqueHash | LoadImageHistory
}
 

Public Member Functions

virtual bool hasAlpha () const =0
 
virtual bool hasLoadedData () const
 
virtual bool isReadOnly () const =0
 
virtual bool load (const QString &filePath, DImgLoaderObserver *const observer)=0
 
template<typename Type >
Q_INLINE_TEMPLATE Typenew_failureTolerant (quint64 w, quint64 h, uint typesPerPixel)
 
template<typename Type >
Q_INLINE_TEMPLATE Typenew_failureTolerant (size_t size)
 
virtual bool save (const QString &filePath, DImgLoaderObserver *const observer)=0
 
void setLoadFlags (LoadFlags flags)
 
virtual bool sixteenBit () const =0
 
virtual ~DImgLoader ()
 

Static Public Member Functions

static qint64 checkAllocation (qint64 fullSize)
 
static int convertCompressionForLibJpeg (int value)
 
static int convertCompressionForLibPng (int value)
 
static unsigned char * new_failureTolerant (quint64 w, quint64 h, uint typesPerPixel)
 
template<typename Type >
static Typenew_failureTolerant (quint64 w, quint64 h, uint typesPerPixel)
 
static unsigned char * new_failureTolerant (size_t unsecureSize)
 
template<typename Type >
static Typenew_failureTolerant (size_t unsecureSize)
 
static unsigned short * new_short_failureTolerant (quint64 w, quint64 h, uint typesPerPixel)
 
static unsigned short * new_short_failureTolerant (size_t unsecureSize)
 

Protected Member Functions

bool checkExifWorkingColorSpace () const
 
 DImgLoader (DImg *const image)
 
virtual int granularity (DImgLoaderObserver *const observer, int total, float progressSlice=1.0F)
 
int imageBitsDepth () const
 
int imageBytesDepth () const
 
unsigned char *& imageData ()
 
QMap< QString, QString > & imageEmbeddedText () const
 
QVariant imageGetAttribute (const QString &key) const
 
QString imageGetEmbbededText (const QString &key) const
 
bool imageHasAlpha () const
 
unsigned int & imageHeight ()
 
quint64 imageNumBytes () const
 
void imageSetAttribute (const QString &key, const QVariant &value)
 
void imageSetEmbbededText (const QString &key, const QString &text)
 
void imageSetIccProfile (const IccProfile &profile)
 
bool imageSixteenBit () const
 
unsigned int & imageWidth ()
 
void loadingFailed ()
 
void purgeExifWorkingColorSpace ()
 
virtual bool readMetadata (const QString &filePath)
 
virtual bool saveMetadata (const QString &filePath)
 
void storeColorProfileInMetadata ()
 

Protected Attributes

DImgm_image = nullptr
 
LoadFlags m_loadFlags = LoadAll
 

Member Enumeration Documentation

◆ LoadFlag

This is the list of loading modes usable by DImg image plugins

Enumerator
LoadItemInfo 

Load image information without image data.

Image info as width and height

LoadMetadata 

Image metadata.

LoadICCData 

Image color profile.

LoadImageData 

Full image data.

LoadUniqueHash 

Image unique hash.

LoadImageHistory 

Image version history.

LoadPreview 

Special mode to load reduced image data.

Load embedded preview image instead full size image

LoadAll 

Helper to load all information, metadata and full image.

Constructor & Destructor Documentation

◆ ~DImgLoader()

Digikam::DImgLoader::~DImgLoader ( )
virtual

◆ DImgLoader()

Digikam::DImgLoader::DImgLoader ( DImg *const  image)
explicitprotected

Member Function Documentation

◆ checkAllocation()

qint64 Digikam::DImgLoader::checkAllocation ( qint64  fullSize)
static

Value returned : -1 : unsupported platform 0 : parse failure from supported platform 1 : parse done with success from supported platform

Referenced by new_failureTolerant().

◆ checkExifWorkingColorSpace()

bool Digikam::DImgLoader::checkExifWorkingColorSpace ( ) const
protected

◆ convertCompressionForLibJpeg()

int Digikam::DImgLoader::convertCompressionForLibJpeg ( int  value)
static

◆ convertCompressionForLibPng()

int Digikam::DImgLoader::convertCompressionForLibPng ( int  value)
static

◆ granularity()

int Digikam::DImgLoader::granularity ( DImgLoaderObserver *const  observer,
int  total,
float  progressSlice = 1.0F 
)
protectedvirtual

◆ hasAlpha()

virtual bool Digikam::DImgLoader::hasAlpha ( ) const
pure virtual

Referenced by Digikam::DImg::load().

◆ hasLoadedData()

bool Digikam::DImgLoader::hasLoadedData ( ) const
virtual

◆ imageBitsDepth()

int Digikam::DImgLoader::imageBitsDepth ( ) const
protected

◆ imageBytesDepth()

int Digikam::DImgLoader::imageBytesDepth ( ) const
protected

◆ imageData()

unsigned char *& Digikam::DImgLoader::imageData ( )
protected

References m_image.

◆ imageEmbeddedText()

QMap< QString, QString > & Digikam::DImgLoader::imageEmbeddedText ( ) const
protected

References m_image.

◆ imageGetAttribute()

QVariant Digikam::DImgLoader::imageGetAttribute ( const QString &  key) const
protected

References Digikam::DImg::attribute(), and m_image.

Referenced by saveMetadata().

◆ imageGetEmbbededText()

QString Digikam::DImgLoader::imageGetEmbbededText ( const QString &  key) const
protected

◆ imageHasAlpha()

bool Digikam::DImgLoader::imageHasAlpha ( ) const
protected

◆ imageHeight()

unsigned int & Digikam::DImgLoader::imageHeight ( )
protected

References m_image.

◆ imageNumBytes()

quint64 Digikam::DImgLoader::imageNumBytes ( ) const
protected

◆ imageSetAttribute()

void Digikam::DImgLoader::imageSetAttribute ( const QString &  key,
const QVariant &  value 
)
protected

References m_image, Digikam::DImg::setAttribute(), and value.

Referenced by readMetadata().

◆ imageSetEmbbededText()

void Digikam::DImgLoader::imageSetEmbbededText ( const QString &  key,
const QString &  text 
)
protected

◆ imageSetIccProfile()

void Digikam::DImgLoader::imageSetIccProfile ( const IccProfile profile)
protected

◆ imageSixteenBit()

bool Digikam::DImgLoader::imageSixteenBit ( ) const
protected

◆ imageWidth()

unsigned int & Digikam::DImgLoader::imageWidth ( )
protected

References m_image.

◆ isReadOnly()

virtual bool Digikam::DImgLoader::isReadOnly ( ) const
pure virtual

◆ load()

virtual bool Digikam::DImgLoader::load ( const QString &  filePath,
DImgLoaderObserver *const  observer 
)
pure virtual

Referenced by Digikam::DImg::load().

◆ loadingFailed()

void Digikam::DImgLoader::loadingFailed ( )
protected

References m_image.

◆ new_failureTolerant() [1/6]

unsigned char * Digikam::DImgLoader::new_failureTolerant ( quint64  w,
quint64  h,
uint  typesPerPixel 
)
static

◆ new_failureTolerant() [2/6]

template<typename Type >
static Type * Digikam::DImgLoader::new_failureTolerant ( quint64  w,
quint64  h,
uint  typesPerPixel 
)
static

◆ new_failureTolerant() [3/6]

template<typename Type >
Q_INLINE_TEMPLATE Type * Digikam::DImgLoader::new_failureTolerant ( quint64  w,
quint64  h,
uint  typesPerPixel 
)

Allows safe multiplication of requested pixel number and bytes per pixel, avoiding particularly 32 bits overflow and exceeding the size_t type

◆ new_failureTolerant() [4/6]

template<typename Type >
Q_INLINE_TEMPLATE Type * Digikam::DImgLoader::new_failureTolerant ( size_t  size)

References checkAllocation().

◆ new_failureTolerant() [5/6]

unsigned char * Digikam::DImgLoader::new_failureTolerant ( size_t  unsecureSize)
static

◆ new_failureTolerant() [6/6]

template<typename Type >
static Type * Digikam::DImgLoader::new_failureTolerant ( size_t  unsecureSize)
static

◆ new_short_failureTolerant() [1/2]

unsigned short * Digikam::DImgLoader::new_short_failureTolerant ( quint64  w,
quint64  h,
uint  typesPerPixel 
)
static

◆ new_short_failureTolerant() [2/2]

unsigned short * Digikam::DImgLoader::new_short_failureTolerant ( size_t  unsecureSize)
static

◆ purgeExifWorkingColorSpace()

void Digikam::DImgLoader::purgeExifWorkingColorSpace ( )
protected

◆ readMetadata()

◆ save()

virtual bool Digikam::DImgLoader::save ( const QString &  filePath,
DImgLoaderObserver *const  observer 
)
pure virtual

Referenced by Digikam::DImg::save().

◆ saveMetadata()

bool Digikam::DImgLoader::saveMetadata ( const QString &  filePath)
protectedvirtual

◆ setLoadFlags()

void Digikam::DImgLoader::setLoadFlags ( LoadFlags  flags)

References m_loadFlags.

Referenced by Digikam::DImg::load().

◆ sixteenBit()

virtual bool Digikam::DImgLoader::sixteenBit ( ) const
pure virtual

Referenced by Digikam::DImg::load().

◆ storeColorProfileInMetadata()

void Digikam::DImgLoader::storeColorProfileInMetadata ( )
protected

Member Data Documentation

◆ m_image

◆ m_loadFlags

LoadFlags Digikam::DImgLoader::m_loadFlags = LoadAll
protected

The documentation for this class was generated from the following files: