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

Public Types

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)
 
 FaceTagsIface (Type type, qlonglong imageId, int tagId, const TagRegion &region)
 
QString getAutodetectedPersonString () const
 Returns the string tagId + ',' + unconfirmedFace + ',' + regionXml.
 
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
 
FaceTagsIfaceoperator= (const FaceTagsIface &other)
 
bool operator== (const FaceTagsIface &other) const
 
TagRegion region () const
 
void removeFaceTraining () const
 Remove the face from face training based on the current imageId, tagId, and rect hash.
 
void setRegion (const TagRegion &region)
 
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)
 Return the corresponding image tag property for the given type.
 
static QStringList attributesForFlags (TypeFlags flags)
 Returns a list of all image tag properties for which flags are set.
 
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 Type typeForAttribute (const QString &attribute, int tagId=0)
 Return the Type for the given attribute.
 
static Type typeForId (int tagId)
 Returns the Face Type corresponding to the given TagId.
 

Protected Attributes

qlonglong m_imageId = 0
 
TagRegion m_region
 
int m_tagId = 0
 
Type m_type = InvalidFace
 

Member Function Documentation

◆ 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==.

◆ typeForAttribute()

FaceTagsIface::Type Digikam::FaceTagsIface::typeForAttribute ( const QString &  attribute,
int  tagId = 0 
)
static

To distinguish between UnknownName and UnconfirmedName, the tagId must be given.