KDcrawIface::KDcraw Class
The wrapper class. More...
| Header: | #include <kdcraw.h> |
| Inherits: | QObject |
Public Functions
| KDcraw() | |
| virtual | ~KDcraw() |
| void | cancel() |
| bool | decodeHalfRAWImage(const QString &filePath, const KDcrawIface::RawDecodingSettings &rawDecodingSettings, QByteArray &imageData, int &width, int &height, int &rgbmax) |
| bool | decodeRAWImage(const QString &filePath, const KDcrawIface::RawDecodingSettings &rawDecodingSettings, QByteArray &imageData, int &width, int &height, int &rgbmax) |
| bool | extractRAWData(const QString &filePath, QByteArray &rawData, KDcrawIface::DcrawInfoContainer &identify, unsigned int shotSelect = 0) |
Static Public Members
| int | librawUseGPL2DemosaicPack() |
| int | librawUseGPL3DemosaicPack() |
| int | librawUseGomp() |
| int | librawUseRawSpeed() |
| QString | librawVersion() |
| bool | loadEmbeddedPreview(QByteArray &imgData, const QBuffer &inBuffer) |
| bool | loadEmbeddedPreview(QByteArray &imgData, const QString &path) |
| bool | loadEmbeddedPreview(QImage &image, const QString &path) |
| bool | loadFullImage(QImage &image, const QString &path, const KDcrawIface::RawDecodingSettings &settings = RawDecodingSettings()) |
| bool | loadHalfPreview(QByteArray &imgData, const QBuffer &inBuffer) |
| bool | loadHalfPreview(QByteArray &imgData, const QString &path) |
| bool | loadHalfPreview(QImage &image, const QString &path) |
| bool | loadRawPreview(QByteArray &imgData, const QBuffer &inBuffer) |
| bool | loadRawPreview(QByteArray &imgData, const QString &path) |
| bool | loadRawPreview(QImage &image, const QString &path) |
| bool | rawFileIdentify(KDcrawIface::DcrawInfoContainer &identify, const QString &path) |
| const char * | rawFiles() |
| QStringList | rawFilesList() |
| int | rawFilesVersion() |
| QStringList | supportedCamera() |
| QString | version() |
Protected Functions
| virtual bool | checkToCancelWaitingData() |
| virtual void | setWaitingDataProgress(double value) |
Protected Variables
| bool | m_cancel |
| KDcrawIface::RawDecodingSettings | m_rawDecodingSettings |
Detailed Description
Member Function Documentation
KDcraw::KDcraw()
Standard constructor.
[virtual noexcept] KDcraw::~KDcraw()
Standard destructor.
void KDcraw::cancel()
To cancel decodeHalfRAWImage and decodeRAWImage methods running in a separate thread.
[virtual protected] bool KDcraw::checkToCancelWaitingData()
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 checks if m_cancel is true.
bool KDcraw::decodeHalfRAWImage(const QString &filePath, const KDcrawIface::RawDecodingSettings &rawDecodingSettings, QByteArray &imageData, int &width, int &height, int &rgbmax)
Extract a small size of decode RAW data from filePath picture file using rawDecodingSettings settings. This is a cancelable method which requires a class instance to run because RAW pictures decoding can take a while.
This method returns:
- 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.
falseis returned if decoding failed, elsetrue.
bool KDcraw::decodeRAWImage(const QString &filePath, const KDcrawIface::RawDecodingSettings &rawDecodingSettings, QByteArray &imageData, int &width, int &height, int &rgbmax)
Extract a full size of RAW data from filePath picture file using rawDecodingSettings settings. This is a cancelable method which requires a class instance to run because RAW pictures decoding can take a while.
This method returns:
- 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.
falseis returned if decoding failed, elsetrue.
bool KDcraw::extractRAWData(const QString &filePath, QByteArray &rawData, KDcrawIface::DcrawInfoContainer &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 returns:
- A byte array container rawData with raw data.
- All info about Raw image into identify container.
falseis returned if loading failed, elsetrue.
[static] int KDcraw::librawUseGPL2DemosaicPack()
Return true or false if LibRaw use Demosaic Pack GPL2 or not. Return -1 if undefined.
[static] int KDcraw::librawUseGPL3DemosaicPack()
Return true or false if LibRaw use Demosaic Pack GPL3 or not. Return -1 if undefined.
[static] int KDcraw::librawUseGomp()
Return true or false if LibRaw use parallel demosaicing or not (libgomp support). Return -1 if undefined.
[static] int KDcraw::librawUseRawSpeed()
Return true or false if LibRaw use RawSpeed codec or not. Return -1 if undefined.
[static] QString KDcraw::librawVersion()
Return LibRaw version string.
[static] bool KDcraw::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. This is fast and non cancelable. This method does not require a class instance to run.
[static] bool KDcraw::loadEmbeddedPreview(QByteArray &imgData, const QString &path)
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.
[static] bool KDcraw::loadEmbeddedPreview(QImage &image, const QString &path)
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.
[static] bool KDcraw::loadFullImage(QImage &image, const QString &path, const KDcrawIface::RawDecodingSettings &settings = RawDecodingSettings())
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.
[static] bool KDcraw::loadHalfPreview(QByteArray &imgData, const QBuffer &inBuffer)
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.
[static] bool KDcraw::loadHalfPreview(QByteArray &imgData, const QString &path)
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.
[static] bool KDcraw::loadHalfPreview(QImage &image, const QString &path)
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.
[static] bool KDcraw::loadRawPreview(QByteArray &imgData, const QBuffer &inBuffer)
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().
[static] bool KDcraw::loadRawPreview(QByteArray &imgData, const QString &path)
Get the preview of RAW picture as a QByteArray holding JPEG data. It tries loadEmbeddedPreview() first and if it fails, calls loadHalfPreview().
[static] bool KDcraw::loadRawPreview(QImage &image, const QString &path)
Get the preview of RAW picture as a QImage. It tries loadEmbeddedPreview() first and if it fails, calls loadHalfPreview().
[static] bool KDcraw::rawFileIdentify(KDcrawIface::DcrawInfoContainer &identify, const QString &path)
Get the camera settings which have taken RAW file. Look into dcrawinfocontainer.h for more details. This is a fast and non cancelable method which does not require a class instance to run.
[static] const char *KDcraw::rawFiles()
Return the string of all RAW file type mime supported.
[static] QStringList KDcraw::rawFilesList()
Return the list of all RAW file type mime supported, as a QStringList, without wildcard and suffix dot.
[static] int KDcraw::rawFilesVersion()
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.
[virtual protected] void KDcraw::setWaitingDataProgress(double value)
Re-implement this method to control the pseudo progress value during RAW decoding (when dcraw runs 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).
[static] QStringList KDcraw::supportedCamera()
Provide a list of supported RAW Camera names.
[static] QString KDcraw::version()
Return a string version of libkdcraw release
Member Variable Documentation
bool KDcraw::m_cancel
Used internally to cancel RAW decoding operation. Normally, you don't need to use it directly, except if you derivated this class. Usual way is to use cancel() method
KDcrawIface::RawDecodingSettings KDcraw::m_rawDecodingSettings
The settings container used to perform RAW pictures decoding. See 'rawdecodingsetting.h' for details.