digiKam
|
Public Types | |
enum | PreviewType { FullImage , ImageSelection } |
Public Member Functions | |
DColor | colorInfoFromOriginal (const QPoint &point) const |
DColor | colorInfoFromPreview (const QPoint &point) const |
DColor | colorInfoFromTargetPreview (const QPoint &point) const |
void | convertOriginalColorDepth (int depth) |
QPixmap | convertToPixmap (const DImg &img) const |
void | crop (const QRect ®ion) |
ImageIface (const QSize &size=QSize(0, 0)) | |
DImg * | original () const |
bool | originalHasAlpha () const |
IccProfile | originalIccProfile () const |
MetaEngineData | originalMetadata () const |
PhotoInfoContainer | originalPhotoInfo () const |
bool | originalSixteenBit () const |
QSize | originalSize () const |
void | paint (QPaintDevice *const device, const QRect &rect, QPainter *const painter=nullptr) |
DImg | preview () const |
bool | previewHasAlpha () const |
DImg * | previewReference () |
bool | previewSixteenBit () const |
QSize | previewSize () const |
PreviewType | previewType () const |
DImg | selection () const |
QRect | selectionRect () const |
void | setOriginal (const QString &caller, const FilterAction &action, const DImg &img) |
void | setOriginalIccProfile (const IccProfile &profile) |
void | setOriginalMetadata (const MetaEngineData &meta) |
void | setPreview (const DImg &img) |
void | setPreviewIccProfile (const IccProfile &profile) |
DImg | setPreviewSize (const QSize &size) const |
void | setPreviewType (PreviewType type=FullImage) |
void | setSelection (const QString &caller, const FilterAction &action, const DImg &img) |
~ImageIface () | |
|
explicit |
Standard constructor. Size is the constrain dimension of preview. This can be null size.
Digikam::ImageIface::~ImageIface | ( | ) |
DColor Digikam::ImageIface::colorInfoFromOriginal | ( | const QPoint & | point | ) | const |
Get colors from original, (unchanged) preview or target preview (set by setPreviewImage) image.
References Digikam::DImg::getPixelColor(), original(), and originalSize().
DColor Digikam::ImageIface::colorInfoFromPreview | ( | const QPoint & | point | ) | const |
DColor Digikam::ImageIface::colorInfoFromTargetPreview | ( | const QPoint & | point | ) | const |
void Digikam::ImageIface::convertOriginalColorDepth | ( | int | depth | ) |
Convert depth of original image.
QPixmap Digikam::ImageIface::convertToPixmap | ( | const DImg & | img | ) | const |
Convert a DImg image to a pixmap for screen using color managed view if necessary.
void Digikam::ImageIface::crop | ( | const QRect & | region | ) |
Crop the original image currently hosted by editor to the region.
DImg * Digikam::ImageIface::original | ( | ) | const |
Return a pointer to the DImg object representing the original image. This object may not be modified or stored. Make copies if you need.
Referenced by DigikamEditorAdjustCurvesToolPlugin::AdjustCurvesTool::AdjustCurvesTool(), DigikamEditorAdjustLevelsToolPlugin::AdjustLevelsTool::AdjustLevelsTool(), DigikamEditorAutoCorrectionToolPlugin::AutoCorrectionTool::AutoCorrectionTool(), DigikamEditorBWSepiaToolPlugin::BWSepiaTool::BWSepiaTool(), Digikam::ColorFXSettings::ColorFXSettings(), colorInfoFromOriginal(), DigikamEditorProfileConversionToolPlugin::ProfileConversionTool::fastConversion(), DigikamEditorFilmToolPlugin::FilmTool::FilmTool(), originalMetadata(), and setOriginalMetadata().
bool Digikam::ImageIface::originalHasAlpha | ( | ) | const |
Referenced by previewHasAlpha(), and setSelection().
IccProfile Digikam::ImageIface::originalIccProfile | ( | ) | const |
Original image meta-data management methods.
Referenced by DigikamEditorProfileConversionToolPlugin::ProfileConversionTool::fastConversion(), and DigikamEditorProfileConversionToolPlugin::ProfileConversionTool::ProfileConversionTool().
MetaEngineData Digikam::ImageIface::originalMetadata | ( | ) | const |
References Digikam::DImg::getMetadata(), and original().
Referenced by DigikamEditorProfileConversionToolPlugin::ProfileConversionTool::fastConversion(), and originalPhotoInfo().
PhotoInfoContainer Digikam::ImageIface::originalPhotoInfo | ( | ) | const |
References originalMetadata().
bool Digikam::ImageIface::originalSixteenBit | ( | ) | const |
Referenced by previewSixteenBit(), and setSelection().
QSize Digikam::ImageIface::originalSize | ( | ) | const |
Methods to get/set original image information.
Referenced by colorInfoFromOriginal(), DigikamEditorContentAwareResizeToolPlugin::ContentAwareResizeTool::ContentAwareResizeTool(), DigikamEditorFreeRotationToolPlugin::FreeRotationTool::FreeRotationTool(), DigikamEditorPerspectiveToolPlugin::PerspectiveTool::PerspectiveTool(), DigikamEditorResizeToolPlugin::ResizeTool::ResizeTool(), and DigikamEditorShearToolPlugin::ShearTool::ShearTool().
void Digikam::ImageIface::paint | ( | QPaintDevice *const | device, |
const QRect & | rect, | ||
QPainter *const | painter = nullptr |
||
) |
Paint the current target preview image (or the preview image, if setPreview has not been called) on the given paint device. at x|y, with given maximum width and height taken from rectangle rect.
References Digikam::ICCSettingsContainer::defaultProofProfile, Digikam::IccManager::displaySoftProofingTransform(), Digikam::IccManager::displayTransform(), Digikam::ICCSettingsContainer::enableCM, Digikam::ExposureSettingsContainer::overExposureIndicator, Digikam::ExposureSettingsContainer::underExposureIndicator, and Digikam::ICCSettingsContainer::useManagedView.
DImg Digikam::ImageIface::preview | ( | ) | const |
Return a DImg object representing the preview image.
References previewHasAlpha(), and previewSixteenBit().
Referenced by setPreviewSize().
bool Digikam::ImageIface::previewHasAlpha | ( | ) | const |
References originalHasAlpha().
Referenced by preview(), and setPreview().
DImg * Digikam::ImageIface::previewReference | ( | ) |
Return a pointer to the DImg object representing the preview image. This function is a backdoor for preview editing.
bool Digikam::ImageIface::previewSixteenBit | ( | ) | const |
References originalSixteenBit().
Referenced by preview(), and setPreview().
QSize Digikam::ImageIface::previewSize | ( | ) | const |
Methods to get/set preview image information.
ImageIface::PreviewType Digikam::ImageIface::previewType | ( | ) | const |
DImg Digikam::ImageIface::selection | ( | ) | const |
Return a DImg object representing the current original image selection.
QRect Digikam::ImageIface::selectionRect | ( | ) | const |
Return current image selection position and size into original image coordinates.
Referenced by setSelection().
void Digikam::ImageIface::setOriginal | ( | const QString & | caller, |
const FilterAction & | action, | ||
const DImg & | img | ||
) |
Replace the data of the original with the given image. The characteristics of the data must match the characteristics of the original image as returned by the original...() methods, The size of image can be changed. Caller is an i18n'ed string that will be shown as the undo/redo action name.
References Digikam::DImg::isNull().
Referenced by DigikamEditorProfileConversionToolPlugin::ProfileConversionTool::fastConversion().
void Digikam::ImageIface::setOriginalIccProfile | ( | const IccProfile & | profile | ) |
Set the color profile of the original image.
Referenced by DigikamEditorProfileConversionToolPlugin::ProfileConversionTool::fastConversion().
void Digikam::ImageIface::setOriginalMetadata | ( | const MetaEngineData & | meta | ) |
References original(), and Digikam::DImg::setMetadata().
Referenced by DigikamEditorProfileConversionToolPlugin::ProfileConversionTool::fastConversion().
void Digikam::ImageIface::setPreview | ( | const DImg & | img | ) |
Replace the stored target preview with the given image. The characteristics of the data must match the characteristics of the current as returned by the preview...() methods. The target preview image is used by the paint() and colorInfoFromTargetPreview() methods. The image returned by getPreview() is unaffected.
References Digikam::DImg::bits(), Digikam::DImg::hasAlpha(), previewHasAlpha(), previewSixteenBit(), and Digikam::DImg::sixteenBit.
void Digikam::ImageIface::setPreviewIccProfile | ( | const IccProfile & | profile | ) |
Set the color profile of the preview image.
DImg Digikam::ImageIface::setPreviewSize | ( | const QSize & | size | ) | const |
Sets preview size and returns new preview as with getPreview. The parameters are only hints, previewSize() may differ from size.
References preview().
void Digikam::ImageIface::setPreviewType | ( | PreviewType | type = FullImage | ) |
If useSelection is true, preview will be rendered using current selection in editor instead the full image. Default preview is FullImage.
void Digikam::ImageIface::setSelection | ( | const QString & | caller, |
const FilterAction & | action, | ||
const DImg & | img | ||
) |
Replace the data of the current original image selection with the given data. The characteristics of the data must match the characteristics of the current selection as returned by the selectionWidth(), selectionHeight(), originalSixteenBit() and originalHasAlpha() methods. Caller is an i18n'ed string that will be shown as the undo/redo action name.
References Digikam::DImg::hasAlpha(), Digikam::DImg::isNull(), originalHasAlpha(), originalSixteenBit(), selectionRect(), Digikam::DImg::sixteenBit, and Digikam::DImg::size().