digiKam
Digikam::ImageIface Class Reference

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 &region)
 
 ImageIface (const QSize &size=QSize(0, 0))
 
DImgoriginal () 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
 
DImgpreviewReference ()
 
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 ()
 

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

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

◆ ~ImageIface()

Digikam::ImageIface::~ImageIface ( )

Member Function Documentation

◆ colorInfoFromOriginal()

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().

◆ colorInfoFromPreview()

DColor Digikam::ImageIface::colorInfoFromPreview ( const QPoint &  point) const

◆ colorInfoFromTargetPreview()

DColor Digikam::ImageIface::colorInfoFromTargetPreview ( const QPoint &  point) const

◆ convertOriginalColorDepth()

void Digikam::ImageIface::convertOriginalColorDepth ( int  depth)

Convert depth of original image.

◆ convertToPixmap()

QPixmap Digikam::ImageIface::convertToPixmap ( const DImg img) const

Convert a DImg image to a pixmap for screen using color managed view if necessary.

◆ crop()

void Digikam::ImageIface::crop ( const QRect &  region)

Crop the original image currently hosted by editor to the region.

◆ original()

◆ originalHasAlpha()

bool Digikam::ImageIface::originalHasAlpha ( ) const

Referenced by previewHasAlpha(), and setSelection().

◆ originalIccProfile()

◆ originalMetadata()

◆ originalPhotoInfo()

PhotoInfoContainer Digikam::ImageIface::originalPhotoInfo ( ) const

References originalMetadata().

◆ originalSixteenBit()

bool Digikam::ImageIface::originalSixteenBit ( ) const

Referenced by previewSixteenBit(), and setSelection().

◆ originalSize()

◆ paint()

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

◆ preview()

DImg Digikam::ImageIface::preview ( ) const

Return a DImg object representing the preview image.

References previewHasAlpha(), and previewSixteenBit().

Referenced by setPreviewSize().

◆ previewHasAlpha()

bool Digikam::ImageIface::previewHasAlpha ( ) const

References originalHasAlpha().

Referenced by preview(), and setPreview().

◆ previewReference()

DImg * Digikam::ImageIface::previewReference ( )

Return a pointer to the DImg object representing the preview image. This function is a backdoor for preview editing.

◆ previewSixteenBit()

bool Digikam::ImageIface::previewSixteenBit ( ) const

References originalSixteenBit().

Referenced by preview(), and setPreview().

◆ previewSize()

QSize Digikam::ImageIface::previewSize ( ) const

Methods to get/set preview image information.

◆ previewType()

ImageIface::PreviewType Digikam::ImageIface::previewType ( ) const

◆ selection()

DImg Digikam::ImageIface::selection ( ) const

Return a DImg object representing the current original image selection.

◆ selectionRect()

QRect Digikam::ImageIface::selectionRect ( ) const

Return current image selection position and size into original image coordinates.

Referenced by setSelection().

◆ setOriginal()

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().

◆ setOriginalIccProfile()

void Digikam::ImageIface::setOriginalIccProfile ( const IccProfile profile)

Set the color profile of the original image.

Referenced by DigikamEditorProfileConversionToolPlugin::ProfileConversionTool::fastConversion().

◆ setOriginalMetadata()

void Digikam::ImageIface::setOriginalMetadata ( const MetaEngineData meta)

◆ setPreview()

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.

◆ setPreviewIccProfile()

void Digikam::ImageIface::setPreviewIccProfile ( const IccProfile profile)

Set the color profile of the preview image.

◆ setPreviewSize()

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().

◆ setPreviewType()

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.

◆ setSelection()

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().


The documentation for this class was generated from the following files: