digiKam Developer Documentation: Digikam::DRawDecoder Class Reference

| digiKam Developer Documentation Professional Photo Management with the Power of Open Source

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Digikam::DRawDecoder Class Reference
Inheritance diagram for Digikam::DRawDecoder:

## Public Member Functions
| DRawDecoder ()
| Standard constructor.
| ~DRawDecoder () override
| Standard destructor.
void | cancel ()
| To cancel 'decodeHalfRAWImage' and 'decodeRAWImage' methods running in a separate thread.
bool | 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.
bool | 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.
bool | 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.

## Static Public Member Functions
static bool | isRawFile (const QUrl &url)
static int | librawUseGomp ()
| Return true or false if LibRaw use parallel demosaicing or not (libgomp support).
static QString | librawVersion ()
| Return LibRaw version string.
static bool | loadEmbeddedPreview (QByteArray &imgData, const QBuffer &inBuffer)
| Get the embedded JPEG preview image from RAW image passed in QBuffer as a QByteArray which will include Exif Data.
static bool | loadEmbeddedPreview (QByteArray &imgData, const QString &path)
| Get the embedded JPEG preview image from RAW picture as a QByteArray which will include Exif Data.
static bool | loadEmbeddedPreview (QImage &image, const QString &path)
| Get the embedded JPEG preview image from RAW picture as a QImage.
static bool | loadFullImage (QImage &image, const QString &path, const DRawDecoderSettings &settings=DRawDecoderSettings())
| Get the full decoded RAW picture.
static bool | loadHalfPreview (QByteArray &imgData, const QBuffer &inBuffer)
| Get the half decoded RAW picture passed in QBuffer as JPEG data in QByteArray.
static bool | loadHalfPreview (QByteArray &imgData, const QString &path)
| Get the half decoded RAW picture as JPEG data in QByteArray.
static bool | loadHalfPreview (QImage &image, const QString &path, bool rotate=true)
| Get the half decoded RAW picture.
static bool | loadRawPreview (QByteArray &imgData, const QBuffer &inBuffer)
| Get the preview of RAW picture passed in QBuffer as a QByteArray holding JPEG data.
static bool | loadRawPreview (QByteArray &imgData, const QString &path)
| Get the preview of RAW picture as a QByteArray holding JPEG data.
static bool | loadRawPreview (QImage &image, const QString &path)
| Get the preview of RAW picture as a QImage.
static bool | rawFileIdentify (DRawInfo &identify, const QString &path)
| Get the camera settings which have taken RAW file.
static QString | rawFiles ()
| Return the string of all RAW file type mime supported.
static QStringList | rawFilesList ()
| Return the list of all RAW file type mime supported, as a QStringList, without wildcard and suffix dot.
static int | rawFilesVersion ()
| Returns a version number for the list of supported RAW file types.
static QStringList | supportedCamera ()
| Provide a list of supported RAW Camera name.

## Protected Member Functions
virtual bool | checkToCancelWaitingData ()
| Re-implement this method to control the cancelisation of loop which wait data from RAW decoding process with your proper environment.
virtual void | setWaitingDataProgress (double value)
| 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.

## Protected Attributes
bool | m_cancel = false
| Used internally to cancel RAW decoding operation.
DRawDecoderSettings | m_decoderSettings
| The settings container used to perform RAW pictures decoding.

## Friends
class | Private

## Member Function Documentation

## ◆ checkToCancelWaitingData()

bool Digikam::DRawDecoder::checkToCancelWaitingData | ( |  | ) |
| protectedvirtual

By default, this method check if m_cancel is true.

## ◆ decodeHalfRAWImage()

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

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'.

## ◆ decodeRAWImage()

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

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'.

## ◆ extractRAWData()

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

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'.

## ◆ librawUseGomp()

int Digikam::DRawDecoder::librawUseGomp | ( |  | ) |
| static

Return -1 if undefined.

## ◆ loadEmbeddedPreview() [1/3]

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

This is fast and non cancelable. This method does not require a class instance to run.

## ◆ loadEmbeddedPreview() [2/3]

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

This is fast and non cancelable. This method does not require a class instance to run.

## ◆ loadEmbeddedPreview() [3/3]

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

This is fast and non cancelable This method does not require a class instance to run.

## ◆ loadFullImage()

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

This is a more slower than loadHalfPreview() method and non cancelable. This method does not require a class instance to run.

## ◆ loadHalfPreview() [1/3]

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

This is slower than loadEmbeddedPreview() method and non cancelable. This method does not require a class instance to run.

## ◆ loadHalfPreview() [2/3]

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

This is slower than loadEmbeddedPreview() method and non cancelable. This method does not require a class instance to run.

## ◆ loadHalfPreview() [3/3]

bool Digikam::DRawDecoder::loadHalfPreview | ( | QImage & | image,
|  | const QString & | path,
|  | bool | rotate = `true`
| ) |  |
| static

This is slower than loadEmbeddedPreview() method and non cancelable. This method does not require a class instance to run.

## ◆ loadRawPreview() [1/3]

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

It tries loadEmbeddedPreview() first and if it fails, calls loadHalfPreview().

## ◆ loadRawPreview() [2/3]

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

It tries loadEmbeddedPreview() first and if it fails, calls loadHalfPreview().

## ◆ loadRawPreview() [3/3]

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

It tries loadEmbeddedPreview() first and if it fails, calls loadHalfPreview().

## ◆ rawFileIdentify()

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

Look into rawinfo.h for more details. This is a fast and non cancelable method which do not require a class instance to run.

## ◆ rawFilesVersion()

int Digikam::DRawDecoder::rawFilesVersion | ( |  | ) |
| static

This version is incremented if the list of supported formats has changed between library releases.

## ◆ setWaitingDataProgress()

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

By default, this method does nothing. Progress value average for this stage is 0%-n%, with 'n' == 40% max (see setWaitingDataProgress() method).

## Member Data Documentation

## ◆ m_cancel

bool Digikam::DRawDecoder::m_cancel = false
| protected

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

## ◆ m_decoderSettings

DRawDecoderSettings Digikam::DRawDecoder::m_decoderSettings
| protected

See 'drawdecodingsetting.h' for details.