digiKam
|
Public Types | |
enum | ANGLE { ROT90 = 0 , ROT180 , ROT270 , ROTNONE } |
enum | COLORMODEL { COLORMODELUNKNOWN = 0 , RGB , GRAYSCALE , MONOCHROME , INDEXED , YCBCR , CMYK , CIELAB , COLORMODELRAW } |
enum | FLIP { HORIZONTAL = 0 , VERTICAL } |
enum | FORMAT { NONE = 0 , JPEG , PNG , TIFF , JP2K , PGF , HEIF , RAW , QIMAGE } |
enum | PrepareMetadataFlag { RemoveOldMetadataPreviews = 1 << 0 , CreateNewMetadataPreview = 1 << 1 , ResetExifOrientationTag = 1 << 2 , CreateNewImageHistoryUUID = 1 << 3 , PrepareMetadataFlagsAll } |
Public Member Functions | |
void | addAsReferredImage (const HistoryImageId &id) |
HistoryImageId | addAsReferredImage (const QString &filePath, HistoryImageId::Type type=HistoryImageId::Intermediate) |
void | addCurrentUniqueImageId (const QString &uuid) |
void | addFilterAction (const FilterAction &action) |
QVariant | attribute (const QString &key) const |
void | bitBlendImage (DColorComposer *const composer, const DImg *const src, int sx, int sy, int w, int h, int dx, int dy, DColorComposer::MultiplicationFlags multiplicationFlags=DColorComposer::NoMultiplication) |
void | bitBlendImageOnColor (const DColor &color) |
void | bitBlendImageOnColor (const DColor &color, int x, int y, int w, int h) |
void | bitBlendImageOnColor (DColorComposer *const composer, const DColor &color, int x, int y, int w, int h, DColorComposer::MultiplicationFlags multiplicationFlags=DColorComposer::NoMultiplication) |
void | bitBltImage (const DImg *const src, int dx, int dy) |
void | bitBltImage (const DImg *const src, int sx, int sy, int dx, int dy) |
void | bitBltImage (const DImg *const src, int sx, int sy, int w, int h, int dx, int dy) |
void | bitBltImage (const uchar *const src, int sx, int sy, int w, int h, int dx, int dy, uint swidth, uint sheight, int sdepth) |
uchar * | bits () const |
int | bitsDepth () const |
int | bytesDepth () const |
void | convertDepth (int depth) |
void | convertToDepthOfImage (const DImg *const otherImage) |
void | convertToEightBit () |
QPixmap | convertToPixmap () const |
QPixmap | convertToPixmap (IccTransform &monitorICCtrans) const |
void | convertToSixteenBit () |
DImg | copy () const |
DImg | copy (const QRect &rect) const |
DImg | copy (const QRectF &relativeRect) const |
DImg | copy (int x, int y, int w, int h) const |
uchar * | copyBits () const |
DImg | copyImageData () const |
DImg | copyMetaData () const |
QImage | copyQImage () const |
QImage | copyQImage (const QRect &rect) const |
QImage | copyQImage (const QRectF &relativeRect) const |
QImage | copyQImage (int x, int y, int w, int h) const |
HistoryImageId | createHistoryImageId (const QString &filePath, HistoryImageId::Type type) |
QByteArray | createImageUniqueId () |
void | crop (const QRect &rect) |
void | crop (int x, int y, int w, int h) |
void | detach () |
FORMAT | detectedFormat () const |
DImg () | |
DImg (const DImg &image) | |
DImg (const QByteArray &filePath, DImgLoaderObserver *const observer=nullptr, const DRawDecoding &rawDecodingSettings=DRawDecoding()) | |
DImg (const QImage &image) | |
DImg (const QString &filePath, DImgLoaderObserver *const observer=nullptr, const DRawDecoding &rawDecodingSettings=DRawDecoding()) | |
DImg (uint width, uint height, bool sixteenBit, bool alpha=false, uchar *const data=nullptr, bool copyData=true) | |
QString | embeddedText (const QString &key) const |
int | exifOrientation (const QString &filePath) |
bool | exifRotate (const QString &filePath) |
QVariant | fileOriginData () const |
void | fill (const DColor &color) |
void | flip (FLIP direction) |
QString | format () const |
IccProfile | getIccProfile () const |
DImageHistory & | getItemHistory () |
const DImageHistory & | getItemHistory () const |
MetaEngineData | getMetadata () const |
DImageHistory | getOriginalImageHistory () const |
DColor | getPixelColor (uint x, uint y) const |
DColor | getSubPixelColor (float x, float y) const |
DColor | getSubPixelColorFast (float x, float y) const |
QByteArray | getUniqueHash () |
QByteArray | getUniqueHashV2 () |
bool | hasAlpha () const |
bool | hasAttribute (const QString &key) const |
bool | hasImageHistory () const |
bool | hasTransparentPixels () const |
uint | height () const |
void | imageSavedAs (const QString &savePath) |
void | insertAsReferredImage (int afterHistoryStep, const HistoryImageId &otherImagesId) |
bool | isNull () const |
bool | isReadOnly () const |
QVariant | lastSavedFileOriginData () const |
QString | lastSavedFilePath () const |
bool | load (const QString &filePath, bool loadMetadata, bool loadICCData, bool loadUniqueHash, bool loadHistory, DImgLoaderObserver *const observer=nullptr, const DRawDecoding &rawDecodingSettings=DRawDecoding()) |
bool | load (const QString &filePath, DImgLoaderObserver *const observer=nullptr, const DRawDecoding &rawDecodingSettings=DRawDecoding()) |
bool | load (const QString &filePath, int loadFlags, DImgLoaderObserver *const observer, const DRawDecoding &rawDecodingSettings=DRawDecoding()) |
bool | loadItemInfo (const QString &filePath, bool loadMetadata=true, bool loadICCData=true, bool loadUniqueHash=true, bool loadImageHistory=true) |
quint64 | numBytes () const |
quint64 | numPixels () const |
DImg & | operator= (const DImg &image) |
bool | operator== (const DImg &image) const |
int | orientation () const |
int | originalBitDepth () const |
COLORMODEL | originalColorModel () const |
QString | originalFilePath () const |
QSize | originalRatioSize () const |
QSize | originalSize () const |
void | prepareMetadataToSave (const QString &intendedDestPath, const QString &destMimeType, bool resetExifOrientationTag) |
void | prepareMetadataToSave (const QString &intendedDestPath, const QString &destMimeType, const QString &originalFileName=QString(), PrepareMetadataFlags flags=PrepareMetadataFlagsAll) |
void | prepareSubPixelAccess () |
Private () | |
QImage | pureColorMask (ExposureSettingsContainer *const expoSettings) const |
void | putImageData (uchar *const data, bool copyData=true) |
void | putImageData (uint width, uint height, bool sixteenBit, bool alpha, uchar *const data, bool copyData=true) |
DRawDecoding | rawDecodingSettings () const |
void | removeAlphaChannel () |
void | removeAlphaChannel (const DColor &destColor) |
void | removeAttribute (const QString &key) |
void | reset () |
void | resetMetaData () |
void | resize (int w, int h) |
bool | reverseExifRotate (const QString &filePath) |
bool | reverseRotateAndFlip (int orientation) |
void | rotate (ANGLE angle) |
bool | rotateAndFlip (int orientation) |
bool | save (const QString &filePath, const QString &format, DImgLoaderObserver *const observer=nullptr) |
bool | save (const QString &filePath, FORMAT frm, DImgLoaderObserver *const observer=nullptr) |
QString | savedFormat () const |
uchar * | scanLine (uint i) const |
void | setAttribute (const QString &key, const QVariant &value) |
void | setEmbeddedText (const QString &key, const QString &text) |
void | setFileOriginData (const QVariant &data) |
void | setHistoryBranch (bool isBranch=true) |
void | setHistoryBranchAfter (const DImageHistory &historyBeforeBranch, bool isBranch=true) |
void | setHistoryBranchForLastSteps (int numberOfLastHistorySteps, bool isBranch=true) |
void | setIccProfile (const IccProfile &profile) |
void | setItemHistory (const DImageHistory &history) |
void | setMetadata (const MetaEngineData &data) |
void | setPixelColor (uint x, uint y, const DColor &color) |
bool | sixteenBit () const |
QSize | size () const |
DImg | smoothScale (const QSize &destSize, Qt::AspectRatioMode aspectRatioMode=Qt::IgnoreAspectRatio) const |
DImg | smoothScale (int width, int height, Qt::AspectRatioMode aspectRatioMode=Qt::IgnoreAspectRatio) const |
DImg | smoothScaleClipped (const QSize &destSize, const QRect &clip) const |
DImg | smoothScaleClipped (int width, int height, int clipx, int clipy, int clipwidth, int clipheight) const |
DImg | smoothScaleSection (const QRect &sourceRect, const QSize &destSize) const |
DImg | smoothScaleSection (int sx, int sy, int sw, int sh, int dw, int dh) const |
uchar * | stripImageData () |
void | switchOriginToLastSaved () |
bool | transform (int transformAction) |
bool | wasExifRotated () |
uint | width () const |
~DImg () | |
~Private () | |
Static Public Member Functions | |
static QString | colorModelToString (COLORMODEL colorModel) |
static FORMAT | fileFormat (const QString &filePath) |
static QString | formatToMimeType (FORMAT frm) |
static QByteArray | getUniqueHash (const QString &filePath) |
static QByteArray | getUniqueHashV2 (const QString &filePath) |
static bool | isAnimatedImage (const QString &filePath) |
Public Attributes | |
bool | alpha |
QMap< QString, QVariant > | attributes |
unsigned char * | data |
QMap< QString, QString > | embeddedText |
unsigned int | height |
IccProfile | iccProfile |
DImageHistory | imageHistory |
LANCZOS_DATA_TYPE * | lanczos_func |
MetaEngineData | metaData |
bool | null |
bool | sixteenBit |
unsigned int | width |
Friends | |
class | DImgLoader |
enum Digikam::DImg::ANGLE |
enum Digikam::DImg::FLIP |
When saving, several changes to the image metadata are necessary before it can safely be written to the new file. This method updates the stored meta engine object in preparation to a subsequent call to save() with the same target file. 'intendedDestPath' is the finally intended file name. Do not give the temporary file name if you are going to save() to a temp file. 'destMimeType' is destination type mime. In some cases, metadata is updated depending on this value. 'originalFileName' is the original file's name, for simplistic history tracking in metadata. This is completely independent from the DImageHistory framework. For the 'flags' see below. Not all steps are optional and can be controlled with flags.
Digikam::DImg::DImg | ( | ) |
Create null image
DImg is a framework to support 16bits color depth image. it doesn't aim to be a complete imaging library; it uses QImage/ImageMagick for load/save files which are not supported natively by it. some of the features:
for 8 bits images: you can access individual color components like this:
uchar* const pixels = image.bits();
for (int i = 0 ; i < image.width() * image.height() ; ++i) { pixel[0] // blue pixel[1] // green pixel[2] // red pixel[3] // alpha
pixel += 4; // go to next pixel }
and for 16 bits images:
ushort* const pixels = (ushort*)image.bits();
for (int i = 0 ; i < image.width() * image.height() ; ++i) { pixel[0] // blue pixel[1] // green pixel[2] // red pixel[3] // alpha
pixel += 4; // go to next pixel }
The above is true for both big and little endian platforms. What this also means is that the pixel format is different from that of QImage for big endian machines. Functions are provided if you want to get a copy of the DImg as a QImage.
Referenced by copy().
|
explicit |
Load image using QByteArray as file path
References load(), and rawDecodingSettings().
|
explicit |
Load image using QString as file path
References load(), and rawDecodingSettings().
Digikam::DImg::DImg | ( | const DImg & | image | ) |
|
explicit |
Copy image: Creates a copy of a QImage object. If the QImage is null, a null DImg will be created.
References numPixels().
Digikam::DImg::DImg | ( | uint | width, |
uint | height, | ||
bool | sixteenBit, | ||
bool | alpha = false , |
||
uchar *const | data = nullptr , |
||
bool | copyData = true |
||
) |
Create image from data. If data is 0, a new buffer will be allocated, otherwise the given data will be used: If copydata is true, the data will be copied to a newly allocated buffer. If copyData is false, this DImg object will take ownership of the data pointer. If there is an alpha channel, the data shall be in non-premultiplied form (unassociated alpha).
References alpha, data, height, putImageData(), sixteenBit, and width.
Digikam::DImg::~DImg | ( | ) |
|
inline |
void Digikam::DImg::addAsReferredImage | ( | const HistoryImageId & | id | ) |
HistoryImageId Digikam::DImg::addAsReferredImage | ( | const QString & | filePath, |
HistoryImageId::Type | type = HistoryImageId::Intermediate |
||
) |
If you have saved this DImg to filePath, and want to continue using this DImg object to add further changes to the image history, you can call this method to add to the image history a reference to the just saved image. First call updateMetadata(), then call save(), then call addAsReferredImage(). Do not call this directly after loading, before applying any changes: The history is correctly initialized when loading. If you need to insert the referred file to an entry which is not the last entry, which may happen if the added image was saved after this image's history was created, you can use insertAsReferredImage. The added id is returned.
References createHistoryImageId().
Referenced by imageSavedAs(), and Digikam::EditorCore::slotImageSaved().
void Digikam::DImg::addCurrentUniqueImageId | ( | const QString & | uuid | ) |
In the history, adjusts the UUID of the ImageHistoryId of the current file. Call this if you have associated a UUID with this file which is not written to the metadata. If there is already a UUID present, read from metadata, it will not be replaced.
Referenced by Digikam::EditorCore::ensureHasCurrentUuid(), and Digikam::EditorCore::provideCurrentUuid().
void Digikam::DImg::addFilterAction | ( | const FilterAction & | action | ) |
Referenced by Digikam::EditorCore::putImg(), and Digikam::EditorCore::putImgSelection().
QVariant Digikam::DImg::attribute | ( | const QString & | key | ) | const |
Referenced by detectedFormat(), exifOrientation(), fileOriginData(), format(), getOriginalImageHistory(), getUniqueHash(), getUniqueHashV2(), Digikam::DImgLoader::imageGetAttribute(), isReadOnly(), lastSavedFileOriginData(), lastSavedFilePath(), Digikam::FaceGroup::load(), Digikam::FocusPointGroup::load(), originalBitDepth(), originalColorModel(), originalFilePath(), originalSize(), rawDecodingSettings(), savedFormat(), and wasExifRotated().
void Digikam::DImg::bitBlendImage | ( | DColorComposer *const | composer, |
const DImg *const | src, | ||
int | sx, | ||
int | sy, | ||
int | w, | ||
int | h, | ||
int | dx, | ||
int | dy, | ||
DColorComposer::MultiplicationFlags | multiplicationFlags = DColorComposer::NoMultiplication |
||
) |
Blend src image on this image (this is dest) with the specified composer and multiplication flags. See documentation of DColorComposer for more info. For the other arguments, see documentation of bitBltImage above.
References bits(), bytesDepth(), height, isNull(), sixteenBit, and width.
Referenced by DigikamEditorInsertTextToolPlugin::InsertTextWidget::composeImage().
void Digikam::DImg::bitBlendImageOnColor | ( | const DColor & | color | ) |
References bitBlendImageOnColor(), height, and width.
void Digikam::DImg::bitBlendImageOnColor | ( | const DColor & | color, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h | ||
) |
void Digikam::DImg::bitBlendImageOnColor | ( | DColorComposer *const | composer, |
const DColor & | color, | ||
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
DColorComposer::MultiplicationFlags | multiplicationFlags = DColorComposer::NoMultiplication |
||
) |
For the specified region, blend this image on the given color with the specified composer and multiplication flags. See documentation of DColorComposer for more info. Note that the result pixel is again written to this image, which is, for the blending, source.
References bits(), bytesDepth(), Digikam::DColor::convertToEightBit(), Digikam::DColor::convertToSixteenBit(), height, isNull(), sixteenBit, and width.
Referenced by bitBlendImageOnColor(), and removeAlphaChannel().
void Digikam::DImg::bitBltImage | ( | const DImg *const | src, |
int | dx, | ||
int | dy | ||
) |
Copy a region of pixels from a source image to this image. Parameters: sx|sy Coordinates in the source image of the rectangle to be copied w h Width and height of the rectangle (Default, or when both are -1: whole source image) dx|dy Coordinates in this image of the rectangle in which the region will be copied (Default: 0|0) The bit depth of source and destination must be identical.
Referenced by bitBltImage(), DigikamEditorInsertTextToolPlugin::InsertTextWidget::composeImage(), copy(), Digikam::LensDistortionPixelAccess::pixelAccessReposition(), and Digikam::EditorCore::putImgSelection().
void Digikam::DImg::bitBltImage | ( | const DImg *const | src, |
int | sx, | ||
int | sy, | ||
int | dx, | ||
int | dy | ||
) |
References bitBltImage(), height, and width.
void Digikam::DImg::bitBltImage | ( | const DImg *const | src, |
int | sx, | ||
int | sy, | ||
int | w, | ||
int | h, | ||
int | dx, | ||
int | dy | ||
) |
References bits(), bytesDepth(), height, isNull(), sixteenBit, and width.
void Digikam::DImg::bitBltImage | ( | const uchar *const | src, |
int | sx, | ||
int | sy, | ||
int | w, | ||
int | h, | ||
int | dx, | ||
int | dy, | ||
uint | swidth, | ||
uint | sheight, | ||
int | sdepth | ||
) |
References bits(), bytesDepth(), height, isNull(), sixteenBit, and width.
uchar * Digikam::DImg::bits | ( | ) | const |
Referenced by Digikam::BatchTool::applyFilter(), Digikam::BatchTool::applyFilterChangedProperties(), bitBlendImage(), bitBlendImageOnColor(), bitBltImage(), Digikam::ContentAwareFilter::ContentAwareFilter(), convertDepth(), copyBits(), copyImageData(), copyQImage(), crop(), Digikam::DImgScale::dimgCalcScaleInfo(), Digikam::Haar::ImageData::fillPixelData(), Digikam::WBFilter::filterImage(), flip(), Digikam::UndoCache::getData(), getSubPixelColor(), getSubPixelColorFast(), Digikam::DetectorDistortion::prepareForDetection(), Digikam::OpenCVDNNFaceDetector::prepareForDetection(), pureColorMask(), Digikam::UndoCache::putData(), Digikam::EditorCore::putImg(), Digikam::EditorCore::putImgSelection(), DigikamEditorRatioCropToolPlugin::RatioCropWidget::resizeEvent(), rotate(), scanLine(), Digikam::ImageIface::setPreview(), Digikam::EditorCore::setUndoImg(), Digikam::SharpenFilter::SharpenFilter(), smoothScaleClipped(), and smoothScaleSection().
int Digikam::DImg::bitsDepth | ( | ) | const |
Return the number of bits depth of one color component for one pixel : 8 (non sixteenBit) or 16 (sixteen)
Referenced by Digikam::DImgLoader::imageBitsDepth().
int Digikam::DImg::bytesDepth | ( | ) | const |
Return the number of bytes depth of one pixel : 4 (non sixteenBit) or 8 (sixteen)
Referenced by bitBlendImage(), bitBlendImageOnColor(), bitBltImage(), Digikam::EditorCore::bytesDepth(), crop(), getPixelColor(), getSubPixelColor(), getSubPixelColorFast(), Digikam::DImgLoader::imageBytesDepth(), numBytes(), Digikam::EditorCore::putImgSelection(), scanLine(), and setPixelColor().
|
static |
Helper method to translate enum values to user presentable strings
References CIELAB, CMYK, COLORMODELRAW, COLORMODELUNKNOWN, GRAYSCALE, INDEXED, MONOCHROME, RGB, and YCBCR.
Referenced by Digikam::SearchField::createField(), Digikam::ItemScanner::fillCommonContainer(), and Digikam::ItemPropertiesSideBar::setImagePropertiesInformation().
void Digikam::DImg::convertDepth | ( | int | depth | ) |
Convert depth of image. Depth is bytesDepth * bitsDepth. If depth is 32, converts to 8 bits, if depth is 64, converts to 16 bits.
References bits(), data, height, isNull(), Digikam::RandomNumberGenerator::number(), sixteenBit, and width.
Referenced by convertToEightBit(), convertToSixteenBit(), and copyQImage().
void Digikam::DImg::convertToDepthOfImage | ( | const DImg *const | otherImage | ) |
References convertToEightBit(), convertToSixteenBit(), and sixteenBit.
Referenced by DigikamEditorInsertTextToolPlugin::InsertTextWidget::composeImage().
void Digikam::DImg::convertToEightBit | ( | ) |
QPixmap Digikam::DImg::convertToPixmap | ( | ) | const |
Referenced by DigikamEditorInsertTextToolPlugin::InsertTextWidget::composeImage(), Digikam::EditorCore::convertToPixmap(), convertToPixmap(), Digikam::ImagePreviewItem::paint(), Digikam::ImageRegionItem::paint(), Digikam::GraphicsDImgItem::paint(), and DigikamEditorRatioCropToolPlugin::RatioCropWidget::resizeEvent().
QPixmap Digikam::DImg::convertToPixmap | ( | IccTransform & | monitorICCtrans | ) | const |
void Digikam::DImg::convertToSixteenBit | ( | ) |
Wrapper methods for convertDepth
References convertDepth().
Referenced by Digikam::DImgBuiltinFilter::apply(), and convertToDepthOfImage().
DImg Digikam::DImg::copy | ( | ) | const |
Return a deep copy of full image
References detach().
Referenced by Digikam::FaceGroup::applyItemGeometryChanges(), DigikamEditorPerspectiveToolPlugin::PerspectiveWidget::applyPerspectiveAdjustment(), DigikamEditorInsertTextToolPlugin::InsertTextWidget::composeImage(), convertToPixmap(), copy(), copyQImage(), Digikam::SharedLoadingTask::execute(), Digikam::PreviewLoadingTask::execute(), Digikam::EditorCore::getImgSelection(), Digikam::LensDistortionPixelAccess::LensDistortionPixelAccess(), Digikam::NREstimate::NREstimate(), Digikam::BlackFrameParser::parseBlackFrame(), prepareMetadataToSave(), DigikamRawImportNativePlugin::RawPostProcessing::RawPostProcessing(), save(), Digikam::ItemPropertiesColorsTab::setData(), Digikam::FaceGroup::slotAddItemFinished(), and Digikam::FocusPointGroup::slotAddItemFinished().
DImg Digikam::DImg::copy | ( | const QRectF & | relativeRect | ) | const |
DImg Digikam::DImg::copy | ( | int | x, |
int | y, | ||
int | w, | ||
int | h | ||
) | const |
References bitBltImage(), DImg(), and isNull().
uchar * Digikam::DImg::copyBits | ( | ) | const |
References bits(), data, and numBytes().
DImg Digikam::DImg::copyImageData | ( | ) | const |
Return a deep copy of the image, but do not include metadata.
References bits(), hasAlpha(), height, sixteenBit, and width.
Referenced by copyMetaData(), detach(), Digikam::DImgThreadedFilter::DImgThreadedFilter(), and Digikam::GreycstorationFilter::GreycstorationFilter().
DImg Digikam::DImg::copyMetaData | ( | ) | const |
Return an image that contains a deep copy of this image's metadata and the information associated with the image data (width, height, hasAlpha, sixteenBit), but no image data, i.e. isNull() is true.
References copyImageData(), and copyMetaData().
Referenced by copyMetaData(), detach(), and Digikam::EditorCore::Private::saveAs().
QImage Digikam::DImg::copyQImage | ( | ) | const |
QImage wrapper methods
References bits(), convertDepth(), copyQImage(), detach(), height, isNull(), sixteenBit, size(), and width.
Referenced by copyQImage(), Digikam::FaceItemRetriever::getDetails(), Digikam::UMSCamera::getThumbnail(), Digikam::JPEGUtils::jpegConvert(), Digikam::DPreviewImage::load(), Digikam::FrameUtils::makeFramedImage(), prepareMetadataToSave(), DigikamEditorPrintToolPlugin::PrintHelper::print(), Digikam::FingerprintsTask::run(), Digikam::ImageQualityTask::run(), DigikamQImageDImgPlugin::DImgQImageLoader::save(), DigikamTIFFDImgPlugin::DImgTIFFLoader::save(), Digikam::DetectionWorker::scaleForDetection(), DigikamGenericMediaServerPlugin::DLNAMediaServerDelegate::ServeFile(), Digikam::PanIconWidget::setImage(), Digikam::Canvas::slotCopy(), Digikam::AutoCrop::startAnalyse(), and Digikam::FaceUtils::storeThumbnails().
QImage Digikam::DImg::copyQImage | ( | const QRect & | rect | ) | const |
References copyQImage().
QImage Digikam::DImg::copyQImage | ( | const QRectF & | relativeRect | ) | const |
References copyQImage(), and isNull().
QImage Digikam::DImg::copyQImage | ( | int | x, |
int | y, | ||
int | w, | ||
int | h | ||
) | const |
References convertDepth(), copy(), copyQImage(), isNull(), and sixteenBit.
HistoryImageId Digikam::DImg::createHistoryImageId | ( | const QString & | filePath, |
HistoryImageId::Type | type | ||
) |
Create a HistoryImageId for this image already saved at the given file path.
References getMetadata(), and getUniqueHashV2().
Referenced by addAsReferredImage(), and Digikam::DImgLoader::readMetadata().
QByteArray Digikam::DImg::createImageUniqueId | ( | ) |
This method creates a new 256-bit UUID meant to be globally unique. The UUID will be returned as a 64-byte hexadecimal string. At least 128bits of the UUID will be created by the platform random number generator. The rest may be created from a content-based hash similar to the uniqueHash, see above. This method only generates a new UUID for this image without in any way changing this image object or saving the UUID anywhere.
References getUniqueHashV2().
Referenced by Digikam::EditorCore::ensureHasCurrentUuid(), and prepareMetadataToSave().
void Digikam::DImg::crop | ( | const QRect & | rect | ) |
Crop image to the specified region
Referenced by Digikam::DImgBuiltinFilter::apply().
void Digikam::DImg::crop | ( | int | x, |
int | y, | ||
int | w, | ||
int | h | ||
) |
References bits(), bytesDepth(), height, isNull(), sixteenBit, stripImageData(), and width.
void Digikam::DImg::detach | ( | ) |
Detaches from shared data and makes sure that this image is the only one referring to the data. If multiple images share common data, this image makes a copy of the data and detaches itself from the sharing mechanism. Nothing is done if there is just a single reference.
References copyImageData(), copyMetaData(), Private(), and size().
Referenced by copy(), copyQImage(), Digikam::SharedLoadingTask::execute(), Digikam::PreviewLoadingTask::execute(), and Digikam::EditorCore::getImgSelection().
DImg::FORMAT Digikam::DImg::detectedFormat | ( | ) | const |
Returns the file format in form of the FORMAT enum that was detected in the load() method. Other than the format attribute which is written by the DImgLoader, this can include the QIMAGE or NONE values. Returns NONE for images that have not been loaded. For unknown image formats, a value of QIMAGE can be returned to indicate that the QImage-based loader will have been used. To find out if this has worked, check the return value you got from load().
References attribute(), hasAttribute(), and NONE.
Referenced by Digikam::ItemScanner::detectImageFormat(), exifOrientation(), Digikam::FaceGroup::load(), Digikam::FocusPointGroup::load(), Digikam::EditorCore::slotImageLoaded(), and Digikam::FileActionMngrFileWorker::transform().
QString Digikam::DImg::embeddedText | ( | const QString & | key | ) | const |
int Digikam::DImg::exifOrientation | ( | const QString & | filePath | ) |
Retrieves the Exif orientation, either from the LoadSaveThread info provider if available, or from the metadata
References attribute(), detectedFormat(), Digikam::LoadSaveThread::exifOrientation(), getMetadata(), and RAW.
Referenced by exifRotate(), reverseExifRotate(), and Digikam::EditorCore::slotImageLoaded().
bool Digikam::DImg::exifRotate | ( | const QString & | filePath | ) |
References exifOrientation(), rotateAndFlip(), setAttribute(), and wasExifRotated().
Referenced by Digikam::PreviewLoadingTask::execute(), and Digikam::FrameUtils::makeFramedImage().
|
static |
Identify file format
References format(), Digikam::DPluginDImg::loaderName(), Digikam::DImgStaticPriv::loaderNameToFormat(), NONE, and Digikam::DImgStaticPriv::pluginForFile().
Referenced by Digikam::PreviewLoadThread::createLoadingDescription(), Digikam::PreviewLoadingTask::execute(), Digikam::EditorCore::load(), and Digikam::FileActionMngrFileWorker::transform().
QVariant Digikam::DImg::fileOriginData | ( | ) | const |
When loaded from a file, some attributes like format and isReadOnly still depend on this originating file. When saving in a different format to a different file, you may wish to switch these attributes to the new file.
Example: an image loaded from a RAW and saved to PNG will be read-only and format RAW. After calling switchOriginToLastSaved, it will not be read-only, format will be PNG, and rawDecodingSettings will be null. detectedFormat() will not change. In the history, the last referred image that was added (as intermediate) is made the new Current image. NOTE: Set the saved image path with imageSavedAs() before!
References attribute(), and Digikam::DImgStaticPriv::fileOriginAttributes().
void Digikam::DImg::fill | ( | const DColor & | color | ) |
Fill whole image with specified color. The bit depth of the color must be identical to the depth of this image.
References Digikam::DColor::alpha(), alpha, Digikam::DColor::blue(), Digikam::DColor::green(), height, isNull(), Digikam::DColor::red(), sixteenBit, and width.
Referenced by DigikamEditorInsertTextToolPlugin::InsertTextWidget::composeImage(), and Digikam::LensDistortionPixelAccess::pixelAccessReposition().
void Digikam::DImg::flip | ( | FLIP | direction | ) |
References bits(), data, height, HORIZONTAL, isNull(), sixteenBit, VERTICAL, and width.
Referenced by Digikam::DImgBuiltinFilter::apply(), reverseRotateAndFlip(), rotateAndFlip(), and transform().
QString Digikam::DImg::format | ( | ) | const |
Returns the format string as written by the image loader this image was originally loaded from. Format strings used include JPEG, PNG, TIFF, PGF, JP2K, RAW, PPM. For images loaded with the platform QImage loader, the file suffix is used. Returns null if this DImg was not loaded from a file, but created in memory.
References attribute().
Referenced by fileFormat(), formatToMimeType(), Digikam::EditorCore::getImageFormat(), load(), save(), and Digikam::FileActionMngrFileWorker::transform().
|
static |
IccProfile Digikam::DImg::getIccProfile | ( | ) | const |
Referenced by Digikam::UndoMetadataContainer::changesIccProfile(), DigikamEditorProfileConversionToolPlugin::ProfileConversionTool::fastConversion(), Digikam::UndoMetadataContainer::fromImage(), Digikam::EditorCore::getEmbeddedICC(), Digikam::IccManager::isSRGB(), DigikamImageMagickDImgPlugin::DImgImageMagickLoader::save(), DigikamJPEGDImgPlugin::DImgJPEGLoader::save(), DigikamJPEG2000DImgPlugin::DImgJPEG2000Loader::save(), DigikamQImageDImgPlugin::DImgQImageLoader::save(), DigikamTIFFDImgPlugin::DImgTIFFLoader::save(), Digikam::IccTransform::setEmbeddedProfile(), and Digikam::DImgLoader::storeColorProfileInMetadata().
DImageHistory & Digikam::DImg::getItemHistory | ( | ) |
const DImageHistory & Digikam::DImg::getItemHistory | ( | ) | const |
MetaEngineData Digikam::DImg::getMetadata | ( | ) | const |
Metadata manipulation methods
Referenced by Digikam::DImgLoader::checkExifWorkingColorSpace(), createHistoryImageId(), exifOrientation(), Digikam::EditorCore::getMetadata(), getUniqueHash(), Digikam::JPEGUtils::jpegConvert(), DigikamEditorLensAutoFixToolPlugin::LensAutoFixTool::LensAutoFixTool(), orientation(), Digikam::ImageIface::originalMetadata(), prepareMetadataToSave(), Digikam::DImgLoader::purgeExifWorkingColorSpace(), DigikamTIFFDImgPlugin::DImgTIFFLoader::save(), Digikam::DImgLoader::saveMetadata(), Digikam::DImgLoader::storeColorProfileInMetadata(), and Digikam::MetadataHub::write().
DImageHistory Digikam::DImg::getOriginalImageHistory | ( | ) | const |
References attribute().
Referenced by Digikam::EditorCore::getInitialImageHistory(), setHistoryBranch(), Digikam::EditorCore::slotImageLoaded(), and Digikam::EditorCore::switchToLastSaved().
DColor Digikam::DImg::getPixelColor | ( | uint | x, |
uint | y | ||
) | const |
Access a single pixel of the image. These functions add some safety checks and then use the methods from DColor. In optimized code working directly on the data, better use the inline methods from DColor.
References bytesDepth(), and data.
Referenced by Digikam::ImageIface::colorInfoFromOriginal().
DColor Digikam::DImg::getSubPixelColor | ( | float | x, |
float | y | ||
) | const |
References bits(), Digikam::DColor::blue(), bytesDepth(), data, Digikam::DColor::green(), height, isNull(), LANCZOS_DATA_TYPE, lanczos_func, LANCZOS_SUPPORT, LANCZOS_TABLE_RES, Digikam::DColor::red(), Digikam::DColor::setBlue(), Digikam::DColor::setColor(), Digikam::DColor::setGreen(), Digikam::DColor::setRed(), sixteenBit, and width.
DColor Digikam::DImg::getSubPixelColorFast | ( | float | x, |
float | y | ||
) | const |
QByteArray Digikam::DImg::getUniqueHash | ( | ) |
This methods return a 128-bit MD5 hex digest which is meant to uniquely identify the file. The hash is calculated on parts of the file and the file metadata. It cannot be used to find similar images. It is not calculated from the image data. The hash will be returned as a 32-byte hexadecimal string.
If you already have a DImg object of the file, use the member method. The object does not need to have the full image data loaded, but it shall at least have been loaded with loadItemInfo with loadMetadata = true, or have the metadata set later with setComments, setExif, setIptc, setXmp. If the object does not have the metadata loaded, a non-null, but invalid hash will be returned! In this case, use the static method. If the image has been loaded with loadUniqueHash = true, the hash can be retrieved with the member method.
You do not need a DImg object of the file to retrieve the unique hash; Use the static method and pass just the file path.
References attribute(), getMetadata(), hasAttribute(), and setAttribute().
Referenced by Digikam::ItemScanner::uniqueHash().
|
static |
QByteArray Digikam::DImg::getUniqueHashV2 | ( | ) |
This methods return a 128-bit MD5 hex digest which is meant to uniquely identify the file. The hash is calculated on parts of the file. It cannot be used to find similar images. It is not calculated from the image data. The hash will be returned as a 32-byte hexadecimal string.
If you already have a DImg object loaded from the file, use the member method. If the image has been loaded with loadUniqueHash = true, the hash will already be available.
You do not need a DImg object of the file to retrieve the unique hash; Use the static method and pass just the file path.
References attribute(), hasAttribute(), and setAttribute().
Referenced by createHistoryImageId(), createImageUniqueId(), and Digikam::ItemScanner::uniqueHash().
|
static |
bool Digikam::DImg::hasAlpha | ( | ) | const |
Referenced by Digikam::BatchTool::applyFilterChangedProperties(), DigikamEditorPerspectiveToolPlugin::PerspectiveWidget::applyPerspectiveAdjustment(), copyImageData(), Digikam::EditorCore::hasAlpha(), Digikam::DImgLoader::imageHasAlpha(), Digikam::DImgThreadedFilter::prepareDestImage(), Digikam::OpenCVDNNFaceDetector::prepareForDetection(), Digikam::UndoCache::putData(), Digikam::EditorCore::Private::putImageData(), Digikam::UndoManager::putImageDataAndHistory(), Digikam::RefocusFilter::RefocusFilter(), removeAlphaChannel(), Digikam::ImageIface::setPreview(), Digikam::ImageIface::setSelection(), and Digikam::GreycstorationFilter::setup().
bool Digikam::DImg::hasAttribute | ( | const QString & | key | ) | const |
bool Digikam::DImg::hasImageHistory | ( | ) | const |
bool Digikam::DImg::hasTransparentPixels | ( | ) | const |
If the image has an alpha channel, check if there exist pixels which actually have non-opaque color, that is alpha < 1.0. Note that all pixels are scanned to reach a return value of "false". If hasAlpha() is false, always returns false.
Referenced by prepareMetadataToSave(), and save().
uint Digikam::DImg::height | ( | ) | const |
void Digikam::DImg::imageSavedAs | ( | const QString & | savePath | ) |
It is common that images are not directly saved to the destination path. For this reason, save() does not call addAsReferredImage(), and the stored save path may be wrong. Call this method after save() with the final destination path. This path will be stored in the image history as well.
References addAsReferredImage(), and setAttribute().
Referenced by Digikam::EditorCore::setLastSaved().
void Digikam::DImg::insertAsReferredImage | ( | int | afterHistoryStep, |
const HistoryImageId & | otherImagesId | ||
) |
|
static |
Return true if image file is an animation, as GIFa or NMG
Referenced by Digikam::StackedView::setPreviewItem().
bool Digikam::DImg::isNull | ( | ) | const |
Referenced by Digikam::HaarIface::bestMatchesForImageWithThreshold(), bitBlendImage(), bitBlendImageOnColor(), bitBltImage(), Digikam::BWSepiaSettings::BWSepiaSettings(), Digikam::EditorWindow::colorManage(), DigikamEditorInsertTextToolPlugin::InsertTextWidget::composeImage(), convertDepth(), convertToPixmap(), copy(), copyQImage(), crop(), Digikam::CurvesSettings::CurvesSettings(), Digikam::FaceDetector::detectFaces(), Digikam::SharedLoadingTask::execute(), Digikam::PreviewLoadingTask::execute(), fill(), flip(), Digikam::UndoCache::getData(), Digikam::EditorCore::getImageFormat(), Digikam::EditorCore::getImg(), Digikam::EditorCore::getImgSelection(), getSubPixelColor(), getSubPixelColorFast(), Digikam::UMSCamera::getThumbnail(), Digikam::HaarIface::indexImage(), Digikam::EditorCore::isReadOnly(), Digikam::IccManager::isSRGB(), Digikam::DImgThreadedFilter::prepareDestImage(), Digikam::DetectorDistortion::prepareForDetection(), Digikam::OpenCVDNNFaceDetector::prepareForDetection(), prepareMetadataToSave(), pureColorMask(), Digikam::EditorCore::putIccProfile(), Digikam::EditorCore::Private::putImageData(), Digikam::EditorCore::putImgSelection(), removeAlphaChannel(), resize(), rotate(), Digikam::FingerprintsTask::run(), Digikam::ImageQualityTask::run(), save(), DigikamGenericMediaServerPlugin::DLNAMediaServerDelegate::ServeFile(), Digikam::ImageIface::setOriginal(), Digikam::ImageIface::setSelection(), Digikam::EditorCore::slotImageLoaded(), and Digikam::HistogramWidget::updateData().
bool Digikam::DImg::isReadOnly | ( | ) | const |
Return true if the original image file format cannot be saved. This is depending of DImgLoader::save() implementation. For example RAW file formats are supported by DImg using dcraw than cannot support writing operations.
References attribute().
Referenced by Digikam::EditorCore::isReadOnly().
QVariant Digikam::DImg::lastSavedFileOriginData | ( | ) | const |
QString Digikam::DImg::lastSavedFilePath | ( | ) | const |
Returns the file path to which this DImg was saved. Returns the file path set with imageSavedAs(), if that was not called, save(), if that was not called, a null string.
References attribute().
Referenced by Digikam::MetadataHub::write().
bool Digikam::DImg::load | ( | const QString & | filePath, |
bool | loadMetadata, | ||
bool | loadICCData, | ||
bool | loadUniqueHash, | ||
bool | loadHistory, | ||
DImgLoaderObserver *const | observer = nullptr , |
||
const DRawDecoding & | rawDecodingSettings = DRawDecoding() |
||
) |
bool Digikam::DImg::load | ( | const QString & | filePath, |
DImgLoaderObserver *const | observer = nullptr , |
||
const DRawDecoding & | rawDecodingSettings = DRawDecoding() |
||
) |
bool Digikam::DImg::load | ( | const QString & | filePath, |
int | loadFlags, | ||
DImgLoaderObserver *const | observer, | ||
const DRawDecoding & | rawDecodingSettings = DRawDecoding() |
||
) |
References Digikam::DImgLoaderObserver::continueQuery(), format(), Digikam::DImgLoader::hasAlpha(), Digikam::DImgLoader::hasLoadedData(), Digikam::DImgLoader::isReadOnly(), Digikam::DImgLoader::load(), Digikam::DPluginDImg::loader(), Digikam::DPluginDImg::loaderName(), Digikam::DImgStaticPriv::loaderNameToFormat(), Digikam::DImgLoader::LoadPreview, Digikam::DImgStaticPriv::pluginForFile(), Digikam::DPluginDImg::previewSupported(), rawDecodingSettings(), setAttribute(), Digikam::DImgLoader::setLoadFlags(), and Digikam::DImgLoader::sixteenBit().
bool Digikam::DImg::loadItemInfo | ( | const QString & | filePath, |
bool | loadMetadata = true , |
||
bool | loadICCData = true , |
||
bool | loadUniqueHash = true , |
||
bool | loadImageHistory = true |
||
) |
Loads most parts of the meta information, but never the image data. If loadMetadata is true, the metadata will be available with getComments, getExif, getIptc, getXmp . If loadICCData is true, the ICC profile will be available with getICCProfile.
References load(), Digikam::DImgLoader::LoadICCData, Digikam::DImgLoader::LoadImageHistory, Digikam::DImgLoader::LoadItemInfo, Digikam::DImgLoader::LoadMetadata, and Digikam::DImgLoader::LoadUniqueHash.
Referenced by Digikam::ItemScanner::loadFromDisk(), and Digikam::ItemPropertiesSideBar::setImagePropertiesInformation().
quint64 Digikam::DImg::numBytes | ( | ) | const |
References bytesDepth(), height, and width.
Referenced by copyBits(), Digikam::UndoCache::getData(), Digikam::DImgLoader::imageNumBytes(), Digikam::LoadingCache::isCacheable(), Digikam::UndoCache::putData(), Digikam::LoadingCache::putImage(), putImageData(), and Digikam::SharpenFilter::SharpenFilter().
quint64 Digikam::DImg::numPixels | ( | ) | const |
Referenced by DImg(), and Digikam::NREstimate::startAnalyse().
bool Digikam::DImg::operator== | ( | const DImg & | image | ) | const |
Returns whether two images are equal. Two images are equal if and only if they refer to the same shared data. (Thus, DImg() == DImg() is not true, both instances refer two their own shared data. image == DImg(image) is true.) If two or more images refer to the same data, they have the same image data, bits() returns the same data, they have the same metadata, and a change to one image also affects the others. Call detach() to split one image from the group of equal images.
int Digikam::DImg::orientation | ( | ) | const |
Returns current DMetadata::Orientation from DImg
References getMetadata().
Referenced by Digikam::ItemScanner::commitFaces(), reverseRotateAndFlip(), and rotateAndFlip().
int Digikam::DImg::originalBitDepth | ( | ) | const |
Returns the bit depth (in bits per channel, e.g. 8 or 16) of the original file.
References attribute().
Referenced by Digikam::ItemScanner::scanItemInformation(), and Digikam::ItemPropertiesSideBar::setImagePropertiesInformation().
DImg::COLORMODEL Digikam::DImg::originalColorModel | ( | ) | const |
Returns the color model in which the image was stored in the file. The color space of the loaded image data is always RGB.
References attribute(), COLORMODELUNKNOWN, and hasAttribute().
Referenced by Digikam::ItemScanner::scanItemInformation(), and Digikam::ItemPropertiesSideBar::setImagePropertiesInformation().
QString Digikam::DImg::originalFilePath | ( | ) | const |
Returns the file path from which this DImg was originally loaded. Returns a null string if the DImg was not loaded from a file.
References attribute().
Referenced by Digikam::BlurDetector::BlurDetector(), Digikam::EditorCore::getImageFilePath(), prepareMetadataToSave(), and Digikam::MetadataHub::write().
QSize Digikam::DImg::originalRatioSize | ( | ) | const |
Returns the size of the original file in the same aspect ratio as size().
References height, originalSize(), size(), and width.
Referenced by Digikam::TagRegion::mapFromOriginalSize(), Digikam::TagRegion::mapToOriginalSize(), and Digikam::TagRegion::relativeToAbsolute().
QSize Digikam::DImg::originalSize | ( | ) | const |
Returns the size of the original file.
References attribute(), hasAttribute(), and size().
Referenced by originalRatioSize(), and Digikam::GraphicsDImgItem::setImage().
void Digikam::DImg::prepareMetadataToSave | ( | const QString & | intendedDestPath, |
const QString & | destMimeType, | ||
bool | resetExifOrientationTag | ||
) |
For convenience: Including all flags, except for ResetExifOrientationTag which can be selected. Uses originalFilePath() to fill the original file name.
References originalFilePath(), PrepareMetadataFlagsAll, prepareMetadataToSave(), and ResetExifOrientationTag.
void Digikam::DImg::prepareMetadataToSave | ( | const QString & | intendedDestPath, |
const QString & | destMimeType, | ||
const QString & | originalFileName = QString() , |
||
PrepareMetadataFlags | flags = PrepareMetadataFlagsAll |
||
) |
References Digikam::DImageHistory::adjustReferredImages(), copy(), copyQImage(), createImageUniqueId(), CreateNewImageHistoryUUID, CreateNewMetadataPreview, getMetadata(), hasTransparentPixels(), height, isNull(), Digikam::IccManager::isSRGB(), Digikam::MetaEngine::ORIENTATION_NORMAL, Digikam::DImageHistory::purgePathFromReferredImages(), RemoveOldMetadataPreviews, ResetExifOrientationTag, setMetadata(), size(), smoothScale(), Digikam::DImageHistory::toXml(), Digikam::IccManager::transformToSRGB(), and width.
Referenced by prepareMetadataToSave(), Digikam::EditorCore::Private::saveNext(), and Digikam::FileActionMngrFileWorker::transform().
void Digikam::DImg::prepareSubPixelAccess | ( | ) |
References LANCZOS_DATA_ONE, LANCZOS_DATA_TYPE, lanczos_func, LANCZOS_SUPPORT, and LANCZOS_TABLE_RES.
QImage Digikam::DImg::pureColorMask | ( | ExposureSettingsContainer *const | expoSettings | ) | const |
Return a mask image where pure white and pure black pixels are over-colored. This way is used to identify over and under exposed pixels.
References bits(), Digikam::ExposureSettingsContainer::exposureIndicatorMode, isNull(), Digikam::ExposureSettingsContainer::overExposureColor, Digikam::ExposureSettingsContainer::overExposureIndicator, Digikam::ExposureSettingsContainer::overExposurePercent, sixteenBit, size(), Digikam::ExposureSettingsContainer::underExposureColor, Digikam::ExposureSettingsContainer::underExposureIndicator, and Digikam::ExposureSettingsContainer::underExposurePercent.
Referenced by Digikam::EditorCore::convertToPixmap(), Digikam::ImagePreviewItem::paint(), and Digikam::ImageRegionItem::paint().
void Digikam::DImg::putImageData | ( | uchar *const | data, |
bool | copyData = true |
||
) |
Overloaded function, provided for convenience, behaves essentially like the function above if data is not 0. Uses current width, height, sixteenBit, and alpha values. If data is 0, the current data is deleted and the image is set to null (But metadata unchanged).
References data, and numBytes().
void Digikam::DImg::putImageData | ( | uint | width, |
uint | height, | ||
bool | sixteenBit, | ||
bool | alpha, | ||
uchar *const | data, | ||
bool | copyData = true |
||
) |
Replaces image data of this object. Metadata is unchanged. Parameters like constructor above.
References alpha, data, height, sixteenBit, size(), and width.
Referenced by DImg(), Digikam::EditorCore::Private::putImageData(), and Digikam::UndoManager::putImageDataAndHistory().
DRawDecoding Digikam::DImg::rawDecodingSettings | ( | ) | const |
Returns the DRawDecoding options that this DImg was loaded with. If this is not a RAW image or no options were specified, returns DRawDecoding().
References attribute(), and hasAttribute().
Referenced by DImg(), Digikam::SharedLoadingTask::execute(), Digikam::PreviewLoadingTask::execute(), and load().
void Digikam::DImg::removeAlphaChannel | ( | ) |
void Digikam::DImg::removeAlphaChannel | ( | const DColor & | destColor | ) |
If the image has an alpha channel and transparent pixels, it will be blended on the specified color and the alpha channel will be removed. This is a no-op if hasTransparentPixels() is false, but this method can be expensive, therefore it is not checked inside removeAlphaChannel(). (the trivial hasAlpha() is checked)
References bitBlendImageOnColor(), hasAlpha(), and isNull().
Referenced by save().
void Digikam::DImg::removeAttribute | ( | const QString & | key | ) |
void Digikam::DImg::reset | ( | ) |
Reset metadata and image data to null image
References Private().
Referenced by Digikam::DImgThreadedFilter::prepareDestImage(), and Digikam::EditorCore::resetImage().
void Digikam::DImg::resetMetaData | ( | ) |
Reset metadata, but do not change image data
void Digikam::DImg::resize | ( | int | w, |
int | h | ||
) |
Set width and height of this image, smoothScale it to the given size
References isNull(), smoothScale(), and stripImageData().
Referenced by Digikam::DImgBuiltinFilter::apply(), and Digikam::ImageRegionWidget::getOriginalRegionImage().
bool Digikam::DImg::reverseExifRotate | ( | const QString & | filePath | ) |
Reverses the previous function
References exifOrientation(), and reverseRotateAndFlip().
bool Digikam::DImg::reverseRotateAndFlip | ( | int | orientation | ) |
Reverses the previous function.
References flip(), HORIZONTAL, orientation(), Digikam::MetaEngine::ORIENTATION_HFLIP, Digikam::MetaEngine::ORIENTATION_NORMAL, Digikam::MetaEngine::ORIENTATION_ROT_180, Digikam::MetaEngine::ORIENTATION_ROT_270, Digikam::MetaEngine::ORIENTATION_ROT_90, Digikam::MetaEngine::ORIENTATION_ROT_90_HFLIP, Digikam::MetaEngine::ORIENTATION_ROT_90_VFLIP, Digikam::MetaEngine::ORIENTATION_UNSPECIFIED, Digikam::MetaEngine::ORIENTATION_VFLIP, ROT180, ROT270, ROT90, rotate(), and VERTICAL.
Referenced by reverseExifRotate().
void Digikam::DImg::rotate | ( | ANGLE | angle | ) |
References bits(), data, height, isNull(), ROT180, ROT270, ROT90, sixteenBit, size(), and width.
Referenced by Digikam::DImgBuiltinFilter::apply(), reverseRotateAndFlip(), rotateAndFlip(), and transform().
bool Digikam::DImg::rotateAndFlip | ( | int | orientation | ) |
Rotates and/or flip the DImg according to the given DMetadata::Orientation, so that the current state is orientation and the resulting step is normal orientation. Returns true if the image was actually rotated or flipped (e.g. if ORIENTATION_NORMAL is given, returns false, because no action is taken).
References flip(), HORIZONTAL, orientation(), Digikam::MetaEngine::ORIENTATION_HFLIP, Digikam::MetaEngine::ORIENTATION_NORMAL, Digikam::MetaEngine::ORIENTATION_ROT_180, Digikam::MetaEngine::ORIENTATION_ROT_270, Digikam::MetaEngine::ORIENTATION_ROT_90, Digikam::MetaEngine::ORIENTATION_ROT_90_HFLIP, Digikam::MetaEngine::ORIENTATION_ROT_90_VFLIP, Digikam::MetaEngine::ORIENTATION_UNSPECIFIED, Digikam::MetaEngine::ORIENTATION_VFLIP, ROT180, ROT270, ROT90, rotate(), and VERTICAL.
Referenced by Digikam::FaceGroup::applyItemGeometryChanges(), exifRotate(), Digikam::FaceGroup::slotAddItemFinished(), Digikam::FocusPointGroup::slotAddItemFinished(), Digikam::EditorCore::slotImageLoaded(), and Digikam::FileActionMngrFileWorker::transform().
bool Digikam::DImg::save | ( | const QString & | filePath, |
const QString & | format, | ||
DImgLoaderObserver *const | observer = nullptr |
||
) |
bool Digikam::DImg::save | ( | const QString & | filePath, |
FORMAT | frm, | ||
DImgLoaderObserver *const | observer = nullptr |
||
) |
QString Digikam::DImg::savedFormat | ( | ) | const |
Returns the format string of the format that this image was last saved to. An image can be loaded from a file - retrieve that format with fileFormat() and loadedFormat() - and can the multiple times be saved to different formats. Format strings used include JPG, PGF, PNG, TIFF and JP2K. If this file was not save, a null string is returned.
References attribute().
uchar * Digikam::DImg::scanLine | ( | uint | i | ) | const |
References bits(), bytesDepth(), data, height, and width.
Referenced by Digikam::LensDistortionPixelAccess::pixelAccessDoEdge().
void Digikam::DImg::setAttribute | ( | const QString & | key, |
const QVariant & | value | ||
) |
References value.
Referenced by Digikam::PreviewLoadingTask::execute(), exifRotate(), Digikam::JPEGUtils::JpegRotator::exifTransform(), getUniqueHash(), getUniqueHashV2(), imageSavedAs(), Digikam::DImgLoader::imageSetAttribute(), Digikam::JPEGUtils::jpegConvert(), load(), Digikam::EditorCore::Private::putImageData(), save(), Digikam::EditorCore::Private::saveNext(), setFileOriginData(), and Digikam::EditorCore::slotImageLoaded().
void Digikam::DImg::setEmbeddedText | ( | const QString & | key, |
const QString & | text | ||
) |
Referenced by Digikam::DImgLoader::imageSetEmbbededText().
void Digikam::DImg::setFileOriginData | ( | const QVariant & | data | ) |
References data, Digikam::DImgStaticPriv::fileOriginAttributes(), removeAttribute(), and setAttribute().
Referenced by Digikam::EditorCore::setFileOriginData(), and switchOriginToLastSaved().
void Digikam::DImg::setHistoryBranch | ( | bool | isBranch = true | ) |
References getOriginalImageHistory(), and setHistoryBranchAfter().
void Digikam::DImg::setHistoryBranchAfter | ( | const DImageHistory & | historyBeforeBranch, |
bool | isBranch = true |
||
) |
Sets a step in the history to constitute the beginning of a branch. Use setHistoryBranch() to take getOriginalImageHistory() and set the first added step as a branch. Use setHistoryBranchForLastSteps(n) to start the branch before the last n steps in the history. (Assume the history had 3 steps and you added 2, call setHistoryBranchForLastSteps(2)) Use setHistoryBranchAfter() if have a copy of the history before branching, the first added step on top of that history will be made a branch.
References setHistoryBranchForLastSteps(), and Digikam::DImageHistory::size().
Referenced by setHistoryBranch(), and Digikam::EditorCore::setHistoryIsBranch().
void Digikam::DImg::setHistoryBranchForLastSteps | ( | int | numberOfLastHistorySteps, |
bool | isBranch = true |
||
) |
References Digikam::FilterAction::ExplicitBranch, imageHistory, and Digikam::DImageHistory::size().
Referenced by setHistoryBranchAfter().
void Digikam::DImg::setIccProfile | ( | const IccProfile & | profile | ) |
Referenced by Digikam::IccTransform::apply(), Digikam::DImgLoader::checkExifWorkingColorSpace(), Digikam::IccTransformFilter::filterImage(), Digikam::RawProcessingFilter::filterImage(), Digikam::DImgLoader::imageSetIccProfile(), DigikamEditorInsertTextToolPlugin::InsertTextWidget::makePixmap(), Digikam::SharedLoadingTask::postProcess(), Digikam::EditorCore::putIccProfile(), and Digikam::UndoMetadataContainer::toImage().
void Digikam::DImg::setItemHistory | ( | const DImageHistory & | history | ) |
void Digikam::DImg::setMetadata | ( | const MetaEngineData & | data | ) |
References data.
Referenced by Digikam::JPEGUtils::jpegConvert(), Digikam::ItemScanner::loadFromDisk(), prepareMetadataToSave(), Digikam::DImgLoader::purgeExifWorkingColorSpace(), Digikam::DImgLoader::readMetadata(), Digikam::EditorCore::readMetadataFromFile(), Digikam::ImageIface::setOriginalMetadata(), and Digikam::DImgLoader::storeColorProfileInMetadata().
void Digikam::DImg::setPixelColor | ( | uint | x, |
uint | y, | ||
const DColor & | color | ||
) |
References bytesDepth(), data, Digikam::DColor::setPixel(), and Digikam::DColor::sixteenBit().
bool Digikam::DImg::sixteenBit | ( | ) | const |
QSize Digikam::DImg::size | ( | ) | const |
Referenced by Digikam::ItemScanner::commitFaces(), copyQImage(), detach(), Digikam::FaceDetector::detectFaces(), Digikam::PreviewLoadingTask::execute(), Digikam::TagRegion::mapFromOriginalSize(), Digikam::TagRegion::mapToOriginalSize(), originalRatioSize(), originalSize(), Digikam::DetectorDistortion::prepareForDetection(), Digikam::OpenCVDNNFaceDetector::prepareForDetection(), prepareMetadataToSave(), DigikamEditorPrintToolPlugin::PrintHelper::print(), pureColorMask(), Digikam::EditorCore::Private::putImageData(), putImageData(), rotate(), Digikam::DetectionWorker::scaleForDetection(), Digikam::ItemScanner::scanFaces(), Digikam::ItemScanner::scanItemInformation(), Digikam::GraphicsDImgItem::setImage(), Digikam::PanIconWidget::setImage(), Digikam::ImageIface::setSelection(), Digikam::EditorCore::slotImageLoaded(), and DigikamGenericPrintCreatorPlugin::AdvPrintPhoto::updateCropRegion().
DImg Digikam::DImg::smoothScale | ( | const QSize & | destSize, |
Qt::AspectRatioMode | aspectRatioMode = Qt::IgnoreAspectRatio |
||
) | const |
DImg Digikam::DImg::smoothScale | ( | int | width, |
int | height, | ||
Qt::AspectRatioMode | aspectRatioMode = Qt::IgnoreAspectRatio |
||
) | const |
Return a version of this image scaled to the specified size with the specified mode. See QSize documentation for information on available modes
Referenced by DigikamEditorAutoCorrectionToolPlugin::AutoCorrectionTool::AutoCorrectionTool(), Digikam::BWSepiaSettings::BWSepiaSettings(), Digikam::ColorFXSettings::ColorFXSettings(), Digikam::PreviewLoadingTask::execute(), Digikam::Haar::ImageData::fillPixelData(), Digikam::JPEGUtils::jpegConvert(), Digikam::IccPostLoadingManager::postLoadingManage(), prepareMetadataToSave(), resize(), Digikam::FingerprintsTask::run(), Digikam::ImageQualityTask::run(), DigikamTIFFDImgPlugin::DImgTIFFLoader::save(), Digikam::DetectionWorker::scaleForDetection(), Digikam::PanIconWidget::setImage(), and Digikam::FacePreviewLoader::slotImageLoaded().
DImg Digikam::DImg::smoothScaleClipped | ( | const QSize & | destSize, |
const QRect & | clip | ||
) | const |
References smoothScaleClipped().
DImg Digikam::DImg::smoothScaleClipped | ( | int | width, |
int | height, | ||
int | clipx, | ||
int | clipy, | ||
int | clipwidth, | ||
int | clipheight | ||
) | const |
Executes the same scaling as smoothScale(width, height), but from the result of this call, returns only the section specified by clipx, clipy, clipwidth, clipheight. This is thus equivalent to calling Dimg scaled = smoothScale(width, height); scaled.crop(clipx, clipy, clipwidth, clipheight); but potentially much faster. In smoothScaleSection, you specify the source region, here, the result region. It will often not be possible to find integer source coordinates for a result region!
References bits(), Digikam::DImgScale::dimgCalcScaleInfo(), Digikam::DImgScale::dimgScaleAARGB(), Digikam::DImgScale::dimgScaleAARGB16(), Digikam::DImgScale::dimgScaleAARGBA(), and Digikam::DImgScale::dimgScaleAARGBA16().
Referenced by Digikam::ImagePreviewItem::paint(), Digikam::ImageRegionItem::paint(), Digikam::GraphicsDImgItem::paint(), and smoothScaleClipped().
DImg Digikam::DImg::smoothScaleSection | ( | const QRect & | sourceRect, |
const QSize & | destSize | ||
) | const |
DImg Digikam::DImg::smoothScaleSection | ( | int | sx, |
int | sy, | ||
int | sw, | ||
int | sh, | ||
int | dw, | ||
int | dh | ||
) | const |
Take the region specified by the rectangle sx|sy, width and height sw * sh, and scale it to an image with size dw * dh
References bits(), Digikam::DImgScale::dimgCalcScaleInfo(), Digikam::DImgScale::dimgScaleAARGB(), Digikam::DImgScale::dimgScaleAARGB16(), Digikam::DImgScale::dimgScaleAARGBA(), and Digikam::DImgScale::dimgScaleAARGBA16().
uchar * Digikam::DImg::stripImageData | ( | ) |
Returns the data of this image. Ownership of the buffer is passed to the caller, this image will be null afterwards.
References data.
Referenced by crop(), Digikam::UndoManager::putImageDataAndHistory(), and resize().
void Digikam::DImg::switchOriginToLastSaved | ( | ) |
References lastSavedFileOriginData(), and setFileOriginData().
Referenced by Digikam::EditorCore::switchToLastSaved().
bool Digikam::DImg::transform | ( | int | transformAction | ) |
Rotates and/or flip the DImg according to the given transform action, which is a MetaEngineRotation::TransformAction. Returns true if the image was actually rotated or flipped.
References flip(), Digikam::MetaEngineRotation::FlipHorizontal, Digikam::MetaEngineRotation::FlipVertical, HORIZONTAL, Digikam::MetaEngineRotation::NoTransformation, ROT180, ROT270, ROT90, rotate(), Digikam::MetaEngineRotation::Rotate180, Digikam::MetaEngineRotation::Rotate270, Digikam::MetaEngineRotation::Rotate90, and VERTICAL.
Referenced by Digikam::JPEGUtils::JpegRotator::exifTransform(), and Digikam::FileActionMngrFileWorker::transform().
bool Digikam::DImg::wasExifRotated | ( | ) |
Utility to make sure that an image is rotated according to Exif tag. Detects if an image has previously already been rotated: You can call this method more than one time on the same image. Returns true if the image has actually been rotated or flipped. Returns false if a rotation was not needed.
References attribute().
Referenced by Digikam::PreviewLoadingTask::execute(), exifRotate(), and Digikam::EditorCore::slotImageLoaded().
uint Digikam::DImg::width | ( | ) | const |
|
friend |
bool Digikam::DImg::alpha |
Referenced by DImg(), fill(), and putImageData().
QMap<QString, QVariant> Digikam::DImg::attributes |
unsigned char* Digikam::DImg::data |
QString Digikam::DImg::embeddedText |
Referenced by Digikam::DImgLoader::imageGetEmbbededText().
uint Digikam::DImg::height |
Referenced by Digikam::BatchTool::applyFilterChangedProperties(), DigikamEditorPerspectiveToolPlugin::PerspectiveWidget::applyPerspectiveAdjustment(), Digikam::WBFilter::autoExposureAdjustement(), bitBlendImage(), bitBlendImageOnColor(), bitBltImage(), DigikamEditorInsertTextToolPlugin::InsertTextWidget::composeImage(), Digikam::ContentAwareFilter::ContentAwareFilter(), convertDepth(), copyImageData(), copyQImage(), crop(), DImg(), Digikam::DImgScale::dimgCalcScaleInfo(), fill(), Digikam::WBFilter::filterImage(), flip(), getSubPixelColor(), getSubPixelColorFast(), Digikam::EditorCore::imageUndoChanged(), Digikam::NREstimate::NREstimate(), numBytes(), numPixels(), originalRatioSize(), Digikam::DImgThreadedFilter::prepareDestImage(), Digikam::DetectorDistortion::prepareForDetection(), Digikam::OpenCVDNNFaceDetector::prepareForDetection(), prepareMetadataToSave(), Digikam::UndoCache::putData(), putImageData(), Digikam::UndoManager::putImageDataAndHistory(), Digikam::EditorCore::putImg(), Digikam::RefocusFilter::RefocusFilter(), rotate(), Digikam::DetectionWorker::scaleForDetection(), scanLine(), Digikam::EditorCore::setUndoImg(), Digikam::GreycstorationFilter::setup(), Digikam::SharpenFilter::SharpenFilter(), Digikam::FacePreviewLoader::slotImageLoaded(), Digikam::EditorCore::slotImageLoaded(), Digikam::DImgThreadedFilter::startFilter(), and Digikam::DImgThreadedFilter::startFilterDirectly().
IccProfile Digikam::DImg::iccProfile |
DImageHistory Digikam::DImg::imageHistory |
Referenced by setHistoryBranchForLastSteps().
LANCZOS_DATA_TYPE* Digikam::DImg::lanczos_func |
Referenced by getSubPixelColor(), and prepareSubPixelAccess().
MetaEngineData Digikam::DImg::metaData |
bool Digikam::DImg::null |
bool Digikam::DImg::sixteenBit |
Referenced by Digikam::BatchTool::applyFilterChangedProperties(), DigikamEditorPerspectiveToolPlugin::PerspectiveWidget::applyPerspectiveAdjustment(), Digikam::WBFilter::autoExposureAdjustement(), bitBlendImage(), bitBlendImageOnColor(), bitBltImage(), DigikamEditorInsertTextToolPlugin::InsertTextWidget::composeImage(), Digikam::ContentAwareFilter::ContentAwareFilter(), convertDepth(), convertToDepthOfImage(), copyImageData(), copyQImage(), crop(), Digikam::CurvesBox::CurvesBox(), Digikam::CurvesSettings::CurvesSettings(), DImg(), Digikam::DImgScale::dimgCalcScaleInfo(), fill(), Digikam::WBFilter::filterImage(), flip(), getSubPixelColor(), getSubPixelColorFast(), Digikam::DImgLoader::imageSixteenBit(), Digikam::DImgThreadedFilter::prepareDestImage(), Digikam::DetectorDistortion::prepareForDetection(), Digikam::OpenCVDNNFaceDetector::prepareForDetection(), pureColorMask(), Digikam::UndoCache::putData(), putImageData(), Digikam::UndoManager::putImageDataAndHistory(), Digikam::EditorCore::putImg(), Digikam::RefocusFilter::RefocusFilter(), rotate(), Digikam::ImageIface::setPreview(), Digikam::ImageIface::setSelection(), Digikam::EditorCore::setUndoImg(), Digikam::GreycstorationFilter::setup(), Digikam::SharpenFilter::SharpenFilter(), Digikam::EditorCore::sixteenBit(), Digikam::NREstimate::startAnalyse(), Digikam::CurvesWidget::updateData(), and Digikam::HistogramWidget::updateData().
uint Digikam::DImg::width |
Referenced by Digikam::BatchTool::applyFilterChangedProperties(), DigikamEditorPerspectiveToolPlugin::PerspectiveWidget::applyPerspectiveAdjustment(), Digikam::WBFilter::autoExposureAdjustement(), bitBlendImage(), bitBlendImageOnColor(), bitBltImage(), DigikamEditorInsertTextToolPlugin::InsertTextWidget::composeImage(), Digikam::ContentAwareFilter::ContentAwareFilter(), convertDepth(), copyImageData(), copyQImage(), crop(), DImg(), Digikam::DImgScale::dimgCalcScaleInfo(), fill(), Digikam::WBFilter::filterImage(), flip(), getSubPixelColor(), getSubPixelColorFast(), Digikam::EditorCore::imageUndoChanged(), Digikam::NREstimate::NREstimate(), numBytes(), numPixels(), originalRatioSize(), Digikam::DImgThreadedFilter::prepareDestImage(), Digikam::DetectorDistortion::prepareForDetection(), Digikam::OpenCVDNNFaceDetector::prepareForDetection(), prepareMetadataToSave(), Digikam::UndoCache::putData(), putImageData(), Digikam::UndoManager::putImageDataAndHistory(), Digikam::EditorCore::putImg(), Digikam::RefocusFilter::RefocusFilter(), rotate(), Digikam::DetectionWorker::scaleForDetection(), scanLine(), Digikam::EditorCore::setUndoImg(), Digikam::GreycstorationFilter::setup(), Digikam::SharpenFilter::SharpenFilter(), Digikam::FacePreviewLoader::slotImageLoaded(), Digikam::EditorCore::slotImageLoaded(), Digikam::DImgThreadedFilter::startFilter(), and Digikam::DImgThreadedFilter::startFilterDirectly().