24 #ifndef DIGIKAM_IMAGE_EDITOR_CORE_PRIVATE_H
25 #define DIGIKAM_IMAGE_EDITOR_CORE_PRIVATE_H
29 #include "digikam_config.h"
83 rotatedOrFlipped (false),
85 doSoftProofing (false),
95 displayingWidget (nullptr),
98 expoSettings (nullptr),
104 QMap<QString, QVariant> ioAttributes(
IOFileSettings*
const iofileSettings,
const QString& givenMimeType)
const;
108 void putImageData(uchar*
const data,
int w,
int h,
bool sixteenBit);
113 void saveAs(
const QString& file,
IOFileSettings*
const iofileSettings,
114 bool setExifOrientationTag,
const QString& givenMimeType,
159 qCWarning(DIGIKAM_GENERAL_LOG) <<
"d->image is NULL";
165 qCWarning(DIGIKAM_GENERAL_LOG) <<
"New image is NULL";
169 if ((w == -1) && (h == -1))
206 if (filesToSave.isEmpty() || (currentFileToSave >= filesToSave.size()))
211 FileToSave& file = filesToSave[currentFileToSave];
212 qCDebug(DIGIKAM_GENERAL_LOG) <<
"Saving file" << file.
filePath <<
"at" << file.
historyStep;
222 undoMan->putImageDataAndHistory(&file.
image, currentStep - file.
historyStep);
225 QMap<QString, QVariant>::const_iterator it;
247 undoMan->addAction(action);
259 image.setAttribute(QLatin1String(
"originalSize"), image.size());
264 const QString& mimeType)
const
266 QMap<QString, QVariant> attributes;
270 if ((mimeType.toUpper() == QLatin1String(
"JPG")) ||
271 (mimeType.toUpper() == QLatin1String(
"JPEG")) ||
272 (mimeType.toUpper() == QLatin1String(
"JPE")))
274 attributes.insert(QLatin1String(
"quality"), iofileSettings->
JPEGCompression);
275 attributes.insert(QLatin1String(
"subsampling"), iofileSettings->
JPEGSubSampling);
280 if (mimeType.toUpper() == QLatin1String(
"PNG"))
282 attributes.insert(QLatin1String(
"quality"), iofileSettings->
PNGCompression);
287 if ((mimeType.toUpper() == QLatin1String(
"TIFF")) ||
288 (mimeType.toUpper() == QLatin1String(
"TIF")))
290 attributes.insert(QLatin1String(
"compress"), iofileSettings->
TIFFCompression);
297 if ((mimeType.toUpper() == QLatin1String(
"JP2")) ||
298 (mimeType.toUpper() == QLatin1String(
"JPX")) ||
299 (mimeType.toUpper() == QLatin1String(
"JPC")) ||
300 (mimeType.toUpper() == QLatin1String(
"PGX")) ||
301 (mimeType.toUpper() == QLatin1String(
"J2K")))
305 attributes.insert(QLatin1String(
"quality"), 100);
319 if ((mimeType.toUpper() == QLatin1String(
"HEIC")) ||
320 (mimeType.toUpper() == QLatin1String(
"HEIF")))
324 attributes.insert(QLatin1String(
"quality"), 0);
328 attributes.insert(QLatin1String(
"quality"), iofileSettings->
HEIFCompression);
336 if (mimeType.toUpper() == QLatin1String(
"PGF"))
340 attributes.insert(QLatin1String(
"quality"), 0);
344 attributes.insert(QLatin1String(
"quality"), iofileSettings->
PGFCompression);
352 bool setExifOrientationTag,
const QString& givenMimeType,
361 currentFileToSave = 0;
363 QString mimeType = givenMimeType;
367 if (mimeType.isEmpty())
388 QMap<int, VersionFileInfo>::const_iterator it;
393 file.
fileName = it.value().fileName;
394 file.
filePath = it.value().filePath();
397 file.
ioAttributes = ioAttributes(iofileSettings, it.value().format);
402 qCDebug(DIGIKAM_GENERAL_LOG) <<
"Saving intermediate at history step" << file.
historyStep
413 primary.
ioAttributes = ioAttributes(iofileSettings, mimeType);
416 primary.
image = image;
417 filesToSave << primary;
419 qCDebug(DIGIKAM_GENERAL_LOG) <<
"Saving to :" << primary.
filePath <<
"(" << primary.
mimeType <<
")";
426 thread->load(currentDescription,
440 if (description != currentDescription)
443 currentDescription = description;
Definition: dimagehistory.h:49
int size() const
Returns the number of entries.
Definition: dimagehistory.cpp:134
Definition: dimgbuiltinfilter.h:44
FilterAction filterAction() const
Definition: dimgbuiltinfilter.cpp:235
void apply(DImg &image) const
Definition: dimgbuiltinfilter.cpp:169
bool isNull() const
Definition: dimg_props.cpp:31
QSize size() const
Definition: dimg_props.cpp:46
void setAttribute(const QString &key, const QVariant &value)
Definition: dimg_props.cpp:223
void putImageData(uint width, uint height, bool sixteenBit, bool alpha, uchar *const data, bool copyData=true)
Definition: dimg_data.cpp:70
void prepareMetadataToSave(const QString &intendedDestPath, const QString &destMimeType, const QString &originalFileName=QString(), PrepareMetadataFlags flags=PrepareMetadataFlagsAll)
Definition: dimg_metadata.cpp:126
bool hasAlpha() const
Definition: dimg_props.cpp:76
DImg copyMetaData() const
Definition: dimg_copy.cpp:46
Definition: dpluginrawimport.h:39
Definition: editorcore_p.h:65
QString filePath
Definition: editorcore_p.h:72
QString mimeType
Definition: editorcore_p.h:74
int historyStep
Definition: editorcore_p.h:69
QString intendedFilePath
Definition: editorcore_p.h:73
QString fileName
Definition: editorcore_p.h:71
bool setExifOrientationTag
Definition: editorcore_p.h:68
QMap< QString, QVariant > ioAttributes
Definition: editorcore_p.h:75
DImg image
Definition: editorcore_p.h:76
Definition: editorcore_p.h:60
LoadingDescription currentDescription
Definition: editorcore_p.h:152
void resetValues()
Definition: editorcore_p.h:188
bool valid
Definition: editorcore_p.h:119
QMap< QString, QVariant > ioAttributes(IOFileSettings *const iofileSettings, const QString &givenMimeType) const
Definition: editorcore_p.h:263
UndoManager * undoMan
Definition: editorcore_p.h:142
int currentFileToSave
Definition: editorcore_p.h:138
void applyBuiltinFilter(const DImgBuiltinFilter &filter, UndoAction *const action)
Definition: editorcore_p.h:245
SharedLoadSaveThread * thread
Definition: editorcore_p.h:148
int selH
Definition: editorcore_p.h:131
double zoom
Definition: editorcore_p.h:133
int selY
Definition: editorcore_p.h:129
int height
Definition: editorcore_p.h:125
ExposureSettingsContainer * expoSettings
Definition: editorcore_p.h:146
int width
Definition: editorcore_p.h:124
bool exifOrient
Definition: editorcore_p.h:121
ICCSettingsContainer cmSettings
Definition: editorcore_p.h:144
DImageHistory resolvedInitialHistory
Definition: editorcore_p.h:141
void loadCurrent()
Definition: editorcore_p.h:424
DPluginRawImport * rawPlugin
Definition: editorcore_p.h:150
int selX
Definition: editorcore_p.h:128
void saveAs(const QString &file, IOFileSettings *const iofileSettings, bool setExifOrientationTag, const QString &givenMimeType, const VersionFileOperation &operation, const QString &intendedFilePath)
Definition: editorcore_p.h:351
QWidget * displayingWidget
Definition: editorcore_p.h:135
void putImageData(uchar *const data, int w, int h, bool sixteenBit)
Definition: editorcore_p.h:155
int selW
Definition: editorcore_p.h:130
Private()
Definition: editorcore_p.h:81
bool doSoftProofing
Definition: editorcore_p.h:122
void applyReversibleBuiltinFilter(const DImgBuiltinFilter &filter)
Definition: editorcore_p.h:240
int origHeight
Definition: editorcore_p.h:127
int origWidth
Definition: editorcore_p.h:126
bool rotatedOrFlipped
Definition: editorcore_p.h:120
void saveNext()
Definition: editorcore_p.h:204
DImg image
Definition: editorcore_p.h:140
QList< FileToSave > filesToSave
Definition: editorcore_p.h:137
void load(const LoadingDescription &description)
Definition: editorcore_p.h:433
Definition: editorcore.h:58
int origWidth() const
Definition: editorcore.cpp:575
void setModified()
Definition: editorcore.cpp:520
int height() const
Definition: editorcore.cpp:570
void signalImageLoaded(const QString &filePath, bool success)
void signalSavingStarted(const QString &filename)
bool sixteenBit() const
Definition: editorcore.cpp:590
QString getImageFormat() const
Definition: editorcore.cpp:824
int origHeight() const
Definition: editorcore.cpp:580
static EditorCore * defaultInstance()
Definition: editorcore.cpp:53
void signalLoadingStarted(const QString &filename)
int width() const
Definition: editorcore.cpp:565
DImageHistory getItemHistory() const
Definition: editorcore.cpp:681
Definition: exposurecontainer.h:39
Definition: iccsettingscontainer.h:44
Definition: iofilesettings.h:36
int PGFCompression
PGF quality value.
Definition: iofilesettings.h:81
bool JPEG2000LossLess
JPEG2000 lossless compression.
Definition: iofilesettings.h:78
bool TIFFCompression
TIFF deflate compression.
Definition: iofilesettings.h:72
bool PGFLossLess
PGF lossless compression.
Definition: iofilesettings.h:84
int HEIFCompression
HEIF quality value.
Definition: iofilesettings.h:87
int JPEGCompression
JPEG quality value.
Definition: iofilesettings.h:58
int PNGCompression
PNG compression value.
Definition: iofilesettings.h:69
int JPEGSubSampling
JPEG chroma sub-sampling value.
Definition: iofilesettings.h:66
int JPEG2000Compression
JPEG2000 quality value.
Definition: iofilesettings.h:75
bool HEIFLossLess
HEIF lossless compression.
Definition: iofilesettings.h:90
@ AccessModeReadWrite
Definition: loadsavethread.h:135
Definition: loadingdescription.h:45
@ LoadingPolicyFirstRemovePrevious
Definition: managedloadsavethread.h:49
Definition: sharedloadsavethread.h:35
Definition: undoaction.h:100
Definition: undoaction.h:66
Definition: undomanager.h:47
QString path
Definition: versionfileoperation.h:64
QString fileName
Definition: versionfileoperation.h:65
Definition: versionfileoperation.h:72
VersionFileInfo saveFile
Definition: versionfileoperation.h:113
QMap< int, VersionFileInfo > intermediates
Definition: versionfileoperation.h:117
VersionFileInfo intermediateForLoadedFile
Definition: versionfileoperation.h:115
@ SaveAndDelete
Similar to Replace, but the new file name differs from the old one, which should be removed.
Definition: versionfileoperation.h:99
@ MoveToIntermediate
Move loadedFile to loadedFileToIntermediate.
Definition: versionfileoperation.h:101
@ Replace
loadedFile and saveFile are the same - replace. Excludes NewFile.
Definition: versionfileoperation.h:97
Tasks tasks
Definition: versionfileoperation.h:109
Definition: piwigotalker.h:48
Definition: datefolderview.cpp:43