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

Public Types

enum  ExtendedFaceData { RejectedFaceTagListPosition = 1 }
enum  Type {
  InvalidFace = 0 , UnknownName = 1 << 0 , UnconfirmedName = 1 << 1 , IgnoredName = 1 << 2 ,
  ConfirmedName = 1 << 3 , FaceForTraining = 1 << 4 , UnconfirmedTypes = UnknownName | UnconfirmedName , NormalFaces = UnknownName | UnconfirmedName | IgnoredName | ConfirmedName ,
  AllTypes = UnknownName | UnconfirmedName | IgnoredName | ConfirmedName | FaceForTraining , TypeFirst = UnknownName , TypeLast = FaceForTraining
}
typedef QFlags< Type > TypeFlags

Public Member Functions

 FaceTagsIface (const FaceTagsIface &other)
 FaceTagsIface (const QString &attribute, qlonglong imageId, int tagId, const TagRegion &region, const QList< int > &rejectedFaceTagList=QList< int >())
 FaceTagsIface (Type type, qlonglong imageId, int tagId, const TagRegion &region, const QList< int > &rejectedFaceTagList=QList< int >())
bool addRejectedFaceTag (int tagId)
 adds a tag to the list of tags excluded from face recognition so "rejected" matches are not matched again
void clearRejectedFaceTagList ()
 Clears the list of tags excluded from face recognition.
const QString faceTagExtendedDataDBString () const
QString getAutodetectedPersonString () const
const QString hash () const
 Generate a hash based on the imageId, tagId, and rect to uniquely identify this entry in the face training DB.
qlonglong imageId () const
bool isConfirmedName () const
bool isForTraining () const
bool isIgnoredName () const
bool isInvalidFace () const
bool isNull () const
bool isUnconfirmedName () const
bool isUnconfirmedType () const
bool isUnknownName () const
FaceTagsIface & operator= (const FaceTagsIface &other)
bool operator== (const FaceTagsIface &other) const
TagRegion region () const
const QList< int > rejectedFaceTagList () const
const QString rejectedFaceTagListToString () const
void removeFaceTraining () const
 Remove the face from face training based on the current imageId, tagId, and rect hash.
void setRegion (const TagRegion &region)
bool setRejectedFaceTagList (const QList< int > &tagList)
 replaces the list of tags excluded from face recognition Adds a tag to the list of tags excluded from face recognition so "rejected" matches are not matched again.
void setTagId (int tagId)
void setType (Type type)
int tagId () const
QVariant toVariant () const
Type type () const

Static Public Member Functions

static QString attributeForType (Type type)
static QStringList attributesForFlags (TypeFlags flags)
static FaceTagsIface fromListing (qlonglong imageid, const QList< QVariant > &values)
 Create a FaceTagsIface from the extraValues returned from ItemLister.
static FaceTagsIface fromVariant (const QVariant &var)
 Writes the contents of this face - in a compact way - in the QVariant.
static const QList< int > stringToRejectedFaceTagList (const QString &str)
static Type typeForAttribute (const QString &attribute, int tagId=0)
static Type typeForId (int tagId)

Static Public Attributes

static const float faceThumbnailResizeFactor = 0.25F
static const QLatin1Char listSeparator = QLatin1Char(';')
static const QLatin1Char valueSeparator = QLatin1Char(',')

Protected Attributes

qlonglong m_imageId = 0
TagRegion m_region
QList< int > m_rejectedFaceTagList
int m_tagId = 0
Type m_type = InvalidFace

Member Function Documentation

◆ attributeForType()

QString Digikam::FaceTagsIface::attributeForType ( Type type)
static
Returns
the corresponding image tag property for the given type.

◆ attributesForFlags()

QStringList Digikam::FaceTagsIface::attributesForFlags ( TypeFlags flags)
static
Returns
a list of all image tag properties for which flags are set.

◆ faceTagExtendedDataDBString()

const QString Digikam::FaceTagsIface::faceTagExtendedDataDBString ( ) const
Returns
a string of the rect and the rejected face tag list to be saved in the DB.

◆ fromVariant()

FaceTagsIface Digikam::FaceTagsIface::fromVariant ( const QVariant & var)
static

Only native QVariant types are used, that is, the QVariant will not have a custom type, thus it can be compared by value by operator==.

◆ getAutodetectedPersonString()

QString Digikam::FaceTagsIface::getAutodetectedPersonString ( ) const
Returns
the string tagId + ',' + unconfirmedFace + ',' + regionXml.

◆ rejectedFaceTagList()

const QList< int > Digikam::FaceTagsIface::rejectedFaceTagList ( ) const
Returns
the list of tags excluded from face recognition so "rejected" matches are not matched again

◆ rejectedFaceTagListToString()

const QString Digikam::FaceTagsIface::rejectedFaceTagListToString ( ) const
Returns
a string representation of rejected face tag list separated by list separator.

◆ stringToRejectedFaceTagList()

const QList< int > Digikam::FaceTagsIface::stringToRejectedFaceTagList ( const QString & str)
static
Returns
a QList<int> from a string representation of m_rejectedFaceTagList separated by listSeparator.

◆ typeForAttribute()

FaceTagsIface::Type Digikam::FaceTagsIface::typeForAttribute ( const QString & attribute,
int tagId = 0 )
static
Returns
the Type for the given attribute. To distinguish between UnknownName and UnconfirmedName, the tagId must be given.

◆ typeForId()

FaceTagsIface::Type Digikam::FaceTagsIface::typeForId ( int tagId)
static
Returns
the Face Type corresponding to the given TagId.