digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
Loading...
Searching...
No Matches
Digikam::ImageIface Class Reference

Public Types

enum  PreviewType { FullImage , ImageSelection }
 

Public Member Functions

 ImageIface (const QSize &size=QSize(0, 0))
 Standard constructor.
 
DColor colorInfoFromOriginal (const QPoint &point) const
 Get colors from original, (unchanged) preview or target preview (set by setPreviewImage) image.
 
DColor colorInfoFromPreview (const QPoint &point) const
 
DColor colorInfoFromTargetPreview (const QPoint &point) const
 
void convertOriginalColorDepth (int depth)
 Convert depth of original image.
 
QPixmap convertToPixmap (const DImg &img) const
 Convert a DImg image to a pixmap for screen using color managed view if necessary.
 
void crop (const QRect &region)
 Crop the original image currently hosted by editor to the region.
 
DImgoriginal () const
 Return a pointer to the DImg object representing the original image.
 
bool originalHasAlpha () const
 
IccProfile originalIccProfile () const
 Original image meta-data management methods.
 
MetaEngineData originalMetadata () const
 
PhotoInfoContainer originalPhotoInfo () const
 
bool originalSixteenBit () const
 
QSize originalSize () const
 Methods to get/set original image information.
 
void 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.
 
DImg preview () const
 Return a DImg object representing the preview image.
 
bool previewHasAlpha () const
 
DImgpreviewReference ()
 Return a pointer to the DImg object representing the preview image.
 
bool previewSixteenBit () const
 
QSize previewSize () const
 Methods to get/set preview image information.
 
PreviewType previewType () const
 
DImg selection () const
 Return a DImg object representing the current original image selection.
 
QRect selectionRect () const
 Return current image selection position and size into original image coordinates.
 
void setOriginal (const QString &caller, const FilterAction &action, const DImg &img)
 Replace the data of the original with the given image.
 
void setOriginalIccProfile (const IccProfile &profile)
 Set the color profile of the original image.
 
void setOriginalMetadata (const MetaEngineData &meta)
 
void setPreview (const DImg &img)
 Replace the stored target preview with the given image.
 
void setPreviewIccProfile (const IccProfile &profile)
 Set the color profile of the preview image.
 
DImg setPreviewSize (const QSize &size) const
 Sets preview size and returns new preview as with getPreview.
 
void setPreviewType (PreviewType type=FullImage)
 If useSelection is true, preview will be rendered using current selection in editor instead the full image.
 
void setSelection (const QString &caller, const FilterAction &action, const DImg &img)
 Replace the data of the current original image selection with the given data.
 

Member Enumeration Documentation

◆ PreviewType

Enumerator
FullImage 

Preview will be rendered using full image.

ImageSelection 

Preview will be rendered using current selection from editor canvas.

Constructor & Destructor Documentation

◆ ImageIface()

Digikam::ImageIface::ImageIface ( const QSize &  size = QSize(0, 0))
explicit

Size is the constrain dimension of preview. This can be null size.

Member Function Documentation

◆ original()

DImg * Digikam::ImageIface::original ( ) const

This object may not be modified or stored. Make copies if you need.

◆ paint()

void Digikam::ImageIface::paint ( QPaintDevice *const  device,
const QRect &  rect,
QPainter *const  painter = nullptr 
)

at x|y, with given maximum width and height taken from rectangle rect.

◆ previewReference()

DImg * Digikam::ImageIface::previewReference ( )

This function is a backdoor for preview editing.

◆ setOriginal()

void Digikam::ImageIface::setOriginal ( const QString &  caller,
const FilterAction action,
const DImg img 
)

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.

◆ setPreview()

void Digikam::ImageIface::setPreview ( const DImg img)

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.

◆ setPreviewSize()

DImg Digikam::ImageIface::setPreviewSize ( const QSize &  size) const

The parameters are only hints, previewSize() may differ from size.

◆ setPreviewType()

void Digikam::ImageIface::setPreviewType ( PreviewType  type = FullImage)

Default preview is FullImage.

◆ setSelection()

void Digikam::ImageIface::setSelection ( const QString &  caller,
const FilterAction action,
const DImg img 
)

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.