![]() |
digiKam
|
#include <tagregion.h>
Public Types | |
enum | Type { Invalid , Rect } |
Public Member Functions | |
bool | intersects (const TagRegion &other, double fraction=0) |
bool | isValid () const |
bool | operator!= (const TagRegion &other) const |
bool | operator== (const TagRegion &other) const |
TagRegion ()=default | |
TagRegion (const QRect &rect) | |
TagRegion (const QString &descriptor) | |
QRect | toRect () const |
QVariant | toVariant () const |
QString | toXml () const |
Type | type () const |
Static Public Member Functions | |
static QRectF | absoluteToRelative (const QRect ®ion, const QSize &fullSize) |
static QSize | adjustToOrientation (QRect ®ion, int orientation, const QSize &fullSize) |
static TagRegion | fromVariant (const QVariant &var) |
static QRect | mapFromOriginalSize (const DImg &reducedSizeImage, const QRect &fullSizeDetail) |
static QRect | mapFromOriginalSize (const QSize &fullImageSize, const QSize &reducedImageSize, const QRect &fullSizeDetail) |
static QRect | mapToOriginalSize (const DImg &reducedSizeImage, const QRect &reducedSizeDetail) |
static QRect | mapToOriginalSize (const QSize &fullImageSize, const QSize &reducedImageSize, const QRect &reducedSizeDetail) |
static QRect | relativeToAbsolute (const QRectF ®ion, const DImg &reducedSizeImage) |
static QRect | relativeToAbsolute (const QRectF ®ion, const QSize &fullSize) |
static void | reverseToOrientation (QRect ®ion, int orientation, const QSize &fullSize) |
Protected Attributes | |
Type | m_type = Invalid |
QVariant | m_value |
|
default |
Use this small class to convert between the formatted textual representation of a tag region in the database and the corresponding object. Construct an invalid region.
References Digikam::operator==().
Referenced by fromVariant().
|
explicit |
|
explicit |
Construct with the region.
|
static |
Takes absolute region and full size to return the original relative region. Used to write back rectangles into image's XMP. see MetadataHub::write.
Referenced by Digikam::FocusPointGroup::slotAddItemFinished().
|
static |
Rotate and flip region to MetaEngine::ImageOrientation. The value region are calculated for the new image orientation.
References Digikam::MetaEngine::ORIENTATION_HFLIP, 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, and Digikam::MetaEngine::ORIENTATION_VFLIP.
Referenced by Digikam::FaceGroup::applyItemGeometryChanges(), Digikam::ItemScanner::commitFaces(), Digikam::FocusPointGroup::Private::createItem(), reverseToOrientation(), Digikam::FaceTagsEditor::rotateFaces(), Digikam::FaceGroup::slotAddItemFinished(), Digikam::FocusPointGroup::slotAddItemFinished(), and Digikam::FaceGroup::slotIgnored().
|
static |
References TagRegion().
Referenced by Digikam::FaceTagsIface::fromVariant().
bool Digikam::TagRegion::intersects | ( | const TagRegion & | other, |
double | fraction = 0 |
||
) |
Returns true if this and the other region intersect. fraction describes the relative overlap area needed to return true: If fraction is 0, returns true if the regions intersect at all. If fraction is 1, returns true only if other is completely contained in this region. If fraction is x, 0 < x < 1, returns true if the area of this region covered by the other is greater than x. Invalid areas never intersect.
References Invalid, m_type, Rect, and toRect().
Referenced by Digikam::FaceUtils::writeUnconfirmedResults().
bool Digikam::TagRegion::isValid | ( | ) | const |
References Invalid, and m_type.
Referenced by Digikam::FaceTagsEditor::confirmedEntry(), and Digikam::FaceTagsEditor::databaseFaces().
|
static |
References mapFromOriginalSize(), Digikam::DImg::originalRatioSize(), and Digikam::DImg::size().
|
static |
|
static |
Takes the original and reduced size from the DImg.
References mapToOriginalSize(), Digikam::DImg::originalRatioSize(), and Digikam::DImg::size().
|
static |
Converts detail rectangles taken from a reduced size image to the original size, and vice versa.
Referenced by mapToOriginalSize().
bool Digikam::TagRegion::operator!= | ( | const TagRegion & | other | ) | const |
bool Digikam::TagRegion::operator== | ( | const TagRegion & | other | ) | const |
|
static |
Takes the original and reduced size from the DImg, maps to original size.
References Digikam::DImg::originalRatioSize(), and relativeToAbsolute().
|
static |
Takes a relative region and a full size and returns the absolute region.
Referenced by Digikam::ItemScanner::commitFaces(), relativeToAbsolute(), and Digikam::FaceUtils::toFaceTagsIfaces().
|
static |
Reverse rotate and flip region to MetaEngine::ImageOrientation. The value region are calculated for the new image orientation.
References adjustToOrientation(), Digikam::MetaEngine::ORIENTATION_HFLIP, Digikam::MetaEngine::ORIENTATION_ROT_270, Digikam::MetaEngine::ORIENTATION_ROT_90, Digikam::MetaEngine::ORIENTATION_ROT_90_HFLIP, Digikam::MetaEngine::ORIENTATION_ROT_90_VFLIP, and Digikam::MetaEngine::ORIENTATION_VFLIP.
Referenced by Digikam::FaceGroup::Private::createItem(), and Digikam::FaceTagsEditor::rotateFaces().
QRect Digikam::TagRegion::toRect | ( | ) | const |
If type is Rect, returns the contained rectangle.
References m_type, m_value, and Rect.
Referenced by Digikam::FaceTagsEditor::add(), Digikam::FaceGroup::Private::createItem(), Digikam::ItemFaceDelegate::faceRect(), Digikam::FaceTagsEditor::getTagRects(), intersects(), Digikam::FaceTagsEditor::removeFace(), and Digikam::FaceTagsEditor::removeFaceAndTag().
QVariant Digikam::TagRegion::toVariant | ( | ) | const |
Stores in / loads from a variant. Will only use native QVariant types.
References m_value.
Referenced by Digikam::operator<<(), and Digikam::FaceTagsIface::toVariant().
QString Digikam::TagRegion::toXml | ( | ) | const |
Returns an XML textual representation of this region.
References Invalid, m_type, m_value, and Rect.
Referenced by Digikam::FaceTagsEditor::addFaceAndTag(), Digikam::ItemFilterModel::categoryIdentifier(), Digikam::ItemSortSettings::compareCategories(), Digikam::ItemFilterModel::data(), Digikam::FaceTagsIface::hash(), and Digikam::FaceTagsEditor::removeFaceAndTag().
TagRegion::Type Digikam::TagRegion::type | ( | ) | const |
References m_type.
Referenced by intersects(), isValid(), operator==(), TagRegion(), toRect(), toXml(), and type().
|
protected |
Referenced by operator==(), TagRegion(), toRect(), toVariant(), and toXml().