digiKam
Digikam::DRawDecoder Class Reference
+ Inheritance diagram for Digikam::DRawDecoder:

Classes

class  Private
 

Public Member Functions

void cancel ()
 
bool decodeHalfRAWImage (const QString &filePath, const DRawDecoderSettings &DRawDecoderSettings, QByteArray &imageData, int &width, int &height, int &rgbmax)
 
bool decodeRAWImage (const QString &filePath, const DRawDecoderSettings &DRawDecoderSettings, QByteArray &imageData, int &width, int &height, int &rgbmax)
 
 DRawDecoder ()
 
bool extractRAWData (const QString &filePath, QByteArray &rawData, DRawInfo &identify, unsigned int shotSelect=0)
 
 ~DRawDecoder () override
 

Static Public Member Functions

static bool isRawFile (const QUrl &url)
 
static int librawUseGomp ()
 
static QString librawVersion ()
 
static bool loadEmbeddedPreview (QByteArray &imgData, const QBuffer &inBuffer)
 
static bool loadEmbeddedPreview (QByteArray &imgData, const QString &path)
 
static bool loadEmbeddedPreview (QImage &image, const QString &path)
 
static bool loadFullImage (QImage &image, const QString &path, const DRawDecoderSettings &settings=DRawDecoderSettings())
 
static bool loadHalfPreview (QByteArray &imgData, const QBuffer &inBuffer)
 
static bool loadHalfPreview (QByteArray &imgData, const QString &path)
 
static bool loadHalfPreview (QImage &image, const QString &path)
 
static bool loadRawPreview (QByteArray &imgData, const QBuffer &inBuffer)
 
static bool loadRawPreview (QByteArray &imgData, const QString &path)
 
static bool loadRawPreview (QImage &image, const QString &path)
 
static bool rawFileIdentify (DRawInfo &identify, const QString &path)
 
static QString rawFiles ()
 
static QStringList rawFilesList ()
 
static int rawFilesVersion ()
 
static QStringList supportedCamera ()
 

Protected Member Functions

virtual bool checkToCancelWaitingData ()
 
virtual void setWaitingDataProgress (double value)
 

Protected Attributes

bool m_cancel
 
DRawDecoderSettings m_decoderSettings
 

Friends

class Private
 

Constructor & Destructor Documentation

◆ DRawDecoder()

Digikam::DRawDecoder::DRawDecoder ( )

Standard constructor.

◆ ~DRawDecoder()

Digikam::DRawDecoder::~DRawDecoder ( )
override

Standard destructor.

References cancel().

Member Function Documentation

◆ cancel()

void Digikam::DRawDecoder::cancel ( )

To cancel 'decodeHalfRAWImage' and 'decodeRAWImage' methods running in a separate thread.

References m_cancel.

Referenced by ~DRawDecoder().

◆ checkToCancelWaitingData()

bool Digikam::DRawDecoder::checkToCancelWaitingData ( )
protectedvirtual

Re-implement this method to control the cancelisation of loop which wait data from RAW decoding process with your proper environment. By default, this method check if m_cancel is true.

References m_cancel.

◆ decodeHalfRAWImage()

bool Digikam::DRawDecoder::decodeHalfRAWImage ( const QString &  filePath,
const DRawDecoderSettings DRawDecoderSettings,
QByteArray &  imageData,
int &  width,
int &  height,
int &  rgbmax 
)

Extract a small size of decode RAW data from 'filePath' picture file using 'DRawDecoderSettings' settings. This is a cancelable method which require a class instance to run because RAW pictures decoding can take a while.

This method return:

- A byte array container 'imageData' with picture data. Pixels order is RGB.
  Color depth can be 8 or 16. In 8 bits you can access to color component
  using (uchar*), in 16 bits using (ushort*).

- Size size of image in number of pixels ('width' and 'height').
- The max average of RGB components from decoded picture.
- 'false' is returned if decoding failed, else 'true'.

References Digikam::DRawDecoderSettings::halfSizeColorImage, Digikam::DRawDecoder::Private::loadFromLibraw(), and m_decoderSettings.

◆ decodeRAWImage()

bool Digikam::DRawDecoder::decodeRAWImage ( const QString &  filePath,
const DRawDecoderSettings DRawDecoderSettings,
QByteArray &  imageData,
int &  width,
int &  height,
int &  rgbmax 
)

Extract a full size of RAW data from 'filePath' picture file using 'DRawDecoderSettings' settings. This is a cancelable method which require a class instance to run because RAW pictures decoding can take a while.

This method return:

- A byte array container 'imageData' with picture data. Pixels order is RGB.
  Color depth can be 8 or 16. In 8 bits you can access to color component
  using (uchar*), in 16 bits using (ushort*).

- Size size of image in number of pixels ('width' and 'height').
- The max average of RGB components from decoded picture.
- 'false' is returned if decoding failed, else 'true'.

References Digikam::DRawDecoder::Private::loadFromLibraw(), and m_decoderSettings.

◆ extractRAWData()

bool Digikam::DRawDecoder::extractRAWData ( const QString &  filePath,
QByteArray &  rawData,
DRawInfo identify,
unsigned int  shotSelect = 0 
)

Extract Raw image data undemosaiced and without post processing from 'filePath' picture file. This is a cancelable method which require a class instance to run because RAW pictures loading can take a while.

This method return:

- A byte array container 'rawData' with raw data.
- All info about Raw image into 'identify' container.
- 'false' is returned if loading failed, else 'true'.

References Digikam::DRawDecoder::Private::fillIndentifyInfo(), Digikam::DRawInfo::isDecodable, m_cancel, rawFiles(), Digikam::s_exifParserCallbackForLibRaw(), Digikam::s_progressCallbackForLibRaw(), and Digikam::DRawDecoder::Private::setProgress().

◆ isRawFile()

bool Digikam::DRawDecoder::isRawFile ( const QUrl &  url)
static

◆ librawUseGomp()

int Digikam::DRawDecoder::librawUseGomp ( )
static

Return true or false if LibRaw use parallel demosaicing or not (libgomp support). Return -1 if undefined.

Referenced by Digikam::LibsInfoDlg::LibsInfoDlg().

◆ librawVersion()

QString Digikam::DRawDecoder::librawVersion ( )
static

Return LibRaw version string.

Referenced by Digikam::LibsInfoDlg::LibsInfoDlg(), and Digikam::DRawDecoderWidget::setup().

◆ loadEmbeddedPreview() [1/3]

bool Digikam::DRawDecoder::loadEmbeddedPreview ( QByteArray &  imgData,
const QBuffer &  inBuffer 
)
static

Get the embedded JPEG preview image from RAW image passed in QBuffer as a QByteArray which will include Exif Data. This is fast and non cancelable. This method does not require a class instance to run.

References Digikam::DRawDecoder::Private::loadEmbeddedPreview(), and rawFiles().

◆ loadEmbeddedPreview() [2/3]

bool Digikam::DRawDecoder::loadEmbeddedPreview ( QByteArray &  imgData,
const QString &  path 
)
static

Get the embedded JPEG preview image from RAW picture as a QByteArray which will include Exif Data. This is fast and non cancelable. This method does not require a class instance to run.

References Digikam::DRawDecoder::Private::loadEmbeddedPreview(), and rawFiles().

Referenced by loadEmbeddedPreview(), and loadRawPreview().

◆ loadEmbeddedPreview() [3/3]

bool Digikam::DRawDecoder::loadEmbeddedPreview ( QImage &  image,
const QString &  path 
)
static

Get the embedded JPEG preview image from RAW picture as a QImage. This is fast and non cancelable This method does not require a class instance to run.

References loadEmbeddedPreview().

◆ loadFullImage()

bool Digikam::DRawDecoder::loadFullImage ( QImage &  image,
const QString &  path,
const DRawDecoderSettings settings = DRawDecoderSettings() 
)
static

Get the full decoded RAW picture. This is a more slower than loadHalfPreview() method and non cancelable. This method does not require a class instance to run.

References rawFiles(), and Digikam::DRawDecoderSettings::sixteenBitsImage.

◆ loadHalfPreview() [1/3]

bool Digikam::DRawDecoder::loadHalfPreview ( QByteArray &  imgData,
const QBuffer &  inBuffer 
)
static

Get the half decoded RAW picture passed in QBuffer as JPEG data in QByteArray. This is slower than loadEmbeddedPreview() method and non cancelable. This method does not require a class instance to run.

References Digikam::DRawDecoder::Private::loadHalfPreview(), and rawFiles().

◆ loadHalfPreview() [2/3]

bool Digikam::DRawDecoder::loadHalfPreview ( QByteArray &  imgData,
const QString &  path 
)
static

Get the half decoded RAW picture as JPEG data in QByteArray. This is slower than loadEmbeddedPreview() method and non cancelable. This method does not require a class instance to run.

References Digikam::DRawDecoder::Private::loadHalfPreview(), and rawFiles().

◆ loadHalfPreview() [3/3]

bool Digikam::DRawDecoder::loadHalfPreview ( QImage &  image,
const QString &  path 
)
static

Get the half decoded RAW picture. This is slower than loadEmbeddedPreview() method and non cancelable. This method does not require a class instance to run.

References Digikam::DRawDecoder::Private::loadHalfPreview(), and rawFiles().

Referenced by loadRawPreview().

◆ loadRawPreview() [1/3]

static bool Digikam::DRawDecoder::loadRawPreview ( QByteArray &  imgData,
const QBuffer &  inBuffer 
)
static

Get the preview of RAW picture passed in QBuffer as a QByteArray holding JPEG data. It tries loadEmbeddedPreview() first and if it fails, calls loadHalfPreview().

◆ loadRawPreview() [2/3]

static bool Digikam::DRawDecoder::loadRawPreview ( QByteArray &  imgData,
const QString &  path 
)
static

Get the preview of RAW picture as a QByteArray holding JPEG data. It tries loadEmbeddedPreview() first and if it fails, calls loadHalfPreview().

◆ loadRawPreview() [3/3]

bool Digikam::DRawDecoder::loadRawPreview ( QImage &  image,
const QString &  path 
)
static

Get the preview of RAW picture as a QImage. It tries loadEmbeddedPreview() first and if it fails, calls loadHalfPreview().

References loadEmbeddedPreview(), and loadHalfPreview().

Referenced by Digikam::UMSCamera::getThumbnail(), and Digikam::BatchTool::loadToDImg().

◆ rawFileIdentify()

bool Digikam::DRawDecoder::rawFileIdentify ( DRawInfo identify,
const QString &  path 
)
static

Get the camera settings which have taken RAW file. Look into rawinfo.h for more details. This is a fast and non cancelable method which do not require a class instance to run.

References Digikam::DRawDecoder::Private::fillIndentifyInfo(), Digikam::DRawInfo::isDecodable, and rawFiles().

Referenced by Digikam::PreviewLoadingTask::execute(), Digikam::DRawDecoder::Private::loadFromLibraw(), Digikam::DMetadata::loadUsingRawEngine(), and DigikamGenericHtmlGalleryPlugin::GalleryElementFunctor::operator()().

◆ rawFiles()

◆ rawFilesList()

QStringList Digikam::DRawDecoder::rawFilesList ( )
static

Return the list of all RAW file type mime supported, as a QStringList, without wildcard and suffix dot.

References rawFiles().

Referenced by Digikam::ApplicationSettings::getRawFileFilter().

◆ rawFilesVersion()

int Digikam::DRawDecoder::rawFilesVersion ( )
static

Returns a version number for the list of supported RAW file types. This version is incremented if the list of supported formats has changed between library releases.

References Digikam::s_rawFileExtensionsVersion().

◆ setWaitingDataProgress()

void Digikam::DRawDecoder::setWaitingDataProgress ( double  value)
protectedvirtual

Re-implement this method to control the pseudo progress value during RAW decoding (when dcraw run with an internal loop without feedback) with your proper environment. By default, this method does nothing. Progress value average for this stage is 0%-n%, with 'n' == 40% max (see setWaitingDataProgress() method).

◆ supportedCamera()

QStringList Digikam::DRawDecoder::supportedCamera ( )
static

Provide a list of supported RAW Camera name.

Referenced by Digikam::RawCameraDlg::RawCameraDlg().

Friends And Related Function Documentation

◆ Private

friend class Private
friend

Member Data Documentation

◆ m_cancel

bool Digikam::DRawDecoder::m_cancel
protected

Used internally to cancel RAW decoding operation. Normally, you don't need to use it directly, excepted if you derivated this class. Usual way is to use cancel() method

Referenced by cancel(), checkToCancelWaitingData(), and extractRAWData().

◆ m_decoderSettings

DRawDecoderSettings Digikam::DRawDecoder::m_decoderSettings
protected

The settings container used to perform RAW pictures decoding. See 'drawdecodingsetting.h' for details.

Referenced by decodeHalfRAWImage(), decodeRAWImage(), DigikamRAWDImgPlugin::DImgRAWLoader::DImgRAWLoader(), DigikamRAWDImgPlugin::DImgRAWLoader::load(), and DigikamRAWDImgPlugin::DImgRAWLoader::sixteenBit().


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