| digiKam Developer Documentation Professional Photo Management with the Power of Open Source

Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
Digikam::SimilarityDb Class Reference

## Public Member Functions
void | clearImageSimilarity (FuzzyAlgorithm algorithm=FuzzyAlgorithm::Haar)
| This method removes all image similarity entries for the algorithm.
void | copySimilarityAttributes (qlonglong srcId, qlonglong destId)
| Copies all similarity-specific information, from image srcId to destId.
QList< qlonglong > | getDirtyOrMissingFingerprints (const QList< ItemInfo > &imageInfos, FuzzyAlgorithm algorithm=FuzzyAlgorithm::Haar)
| Returns a list of all item ids (images, videos,...) where either no fingerprint for the given algorithm exists or is outdated because the file is identified as changed since the generation of the fingerprint.
QStringList | getDirtyOrMissingFingerprintURLs (const QList< ItemInfo > &imageInfos, FuzzyAlgorithm algorithm=FuzzyAlgorithm::Haar)
| Returns a list of the URLs of all items (images, videos,...) where either no fingerprint for the given algorithm exists or is outdated because the file is identified as changed since the generation of the fingerprint.
double | getImageSimilarity (qlonglong imageID1, qlonglong imageID2, FuzzyAlgorithm algorithm=FuzzyAlgorithm::Haar)
| Returns the similarity value for two images.
QList< FuzzyAlgorithm > | getImageSimilarityAlgorithms (qlonglong imageID1, qlonglong imageID2)
| Returns the algorithms for which a similarity value exists for the given image ids.
QString | getLegacySetting (const QString &keyword)
| Returns the legacy settings with the keyword name.
QString | getSetting (const QString &keyword)
| Returns the setting with the keyword name.
bool | hasDirtyOrMissingFingerprint (const ItemInfo &imageInfo, FuzzyAlgorithm algorithm=FuzzyAlgorithm::Haar) const
| Checks if the given image has a dirty fingerprint or even none for the given algorithm.
bool | hasFingerprint (qlonglong imageId, FuzzyAlgorithm algorithm) const
| This method checks if the given image has a fingerprint for the given algorithm.
bool | hasFingerprints ()
| This method checks if there are any fingerprints for any algorithm present.
bool | hasFingerprints (FuzzyAlgorithm algorithm) const
| This method checks if there are any fingerprints for the given algorithm.
bool | integrityCheck ()
| This method checks the integrity of the similarity database.
QSet< qlonglong > | registeredImageIds () const
| This method returns all image ids that are present in the similarity db tables.
void | removeImageFingerprint (qlonglong imageID, FuzzyAlgorithm algorithm=FuzzyAlgorithm::Haar)
| This method removes the fingerprint entry for the given imageId and algorithm.
void | removeImageSimilarity (qlonglong imageID, FuzzyAlgorithm algorithm=FuzzyAlgorithm::Haar)
| This method removes the image similarity entries for the imageID and algorithm.
void | removeImageSimilarity (qlonglong imageID1, qlonglong imageID2, FuzzyAlgorithm algorithm=FuzzyAlgorithm::Haar)
| This method removes the image similarity entry for the imageIDs and algorithm.
void | setImageSimilarity (qlonglong imageID1, qlonglong imageID2, double value, FuzzyAlgorithm algorithm=FuzzyAlgorithm::Haar)
bool | setSetting (const QString &keyword, const QString &value)
| Set the database setting entry given by keyword to the given value.
void | vacuum ()
| This method shrinks the database.

## Friends
class | SimilarityDbAccess

## Member Function Documentation

## ◆ clearImageSimilarity()

void Digikam::SimilarityDb::clearImageSimilarity | ( | FuzzyAlgorithm | algorithm = `FuzzyAlgorithm::Haar` | ) |

Parameters

  algorithm | The algorithm.

## ◆ getDirtyOrMissingFingerprints()

QList< qlonglong > Digikam::SimilarityDb::getDirtyOrMissingFingerprints | ( | const QList< ItemInfo > & | imageInfos,
|  | FuzzyAlgorithm | algorithm = `FuzzyAlgorithm::Haar`
| ) |  |

Parameters

  imageInfos | The image info objects representing the items.
  algorithm | The algorithm.

Returns
  The ids of the items whose fingerprints are dirty or missing.

## ◆ getDirtyOrMissingFingerprintURLs()

QStringList Digikam::SimilarityDb::getDirtyOrMissingFingerprintURLs | ( | const QList< ItemInfo > & | imageInfos,
|  | FuzzyAlgorithm | algorithm = `FuzzyAlgorithm::Haar`
| ) |  |

Parameters

  imageInfos | The image info objects representing the items.
  algorithm | The algorithm.

Returns
  The URLs of the items whose fingerprints are dirty or missing.

## ◆ getImageSimilarity()

double Digikam::SimilarityDb::getImageSimilarity | ( | qlonglong | imageID1,
|  | qlonglong | imageID2,
|  | FuzzyAlgorithm | algorithm = `FuzzyAlgorithm::Haar`
| ) |  |

A value of -1 means nonexistence. A value of -2 means that there is a value that cannot be converted into a double

## ◆ getImageSimilarityAlgorithms()

QList< FuzzyAlgorithm > Digikam::SimilarityDb::getImageSimilarityAlgorithms | ( | qlonglong | imageID1,
|  | qlonglong | imageID2
| ) |  |

Parameters

  imageID1 | The first image id.
  imageID2 | The second image id.

Returns
  a list of all algorithms for which a similarity value exists.

## ◆ getLegacySetting()

QString Digikam::SimilarityDb::getLegacySetting | ( | const QString & | keyword | ) |

Parameters

  keyword | The setting entry name.

Returns
  The setting value.

## ◆ getSetting()

QString Digikam::SimilarityDb::getSetting | ( | const QString & | keyword | ) |

Parameters

  keyword | The setting entry name.

Returns
  The setting value.

## ◆ hasDirtyOrMissingFingerprint()

bool Digikam::SimilarityDb::hasDirtyOrMissingFingerprint | ( | const ItemInfo & | imageInfo,
|  | FuzzyAlgorithm | algorithm = `FuzzyAlgorithm::Haar`
| ) |  | const

Parameters

  imageInfo | The image info object representing the item.
  algorithm | The algorithm used for the fingerprint.

Returns
  True, if the image either has no or a dirty fingerprint.

## ◆ hasFingerprint()

bool Digikam::SimilarityDb::hasFingerprint | ( | qlonglong | imageId,
|  | FuzzyAlgorithm | algorithm
| ) |  | const

Parameters

  imageId | The Id of the image to check.
  algorithm | The algorithm.

Returns
  True, if there is a fingerprint.

## ◆ hasFingerprints() [1/2]

bool Digikam::SimilarityDb::hasFingerprints | ( |  | ) |

Returns
  True, if fingerprints exist.

## ◆ hasFingerprints() [2/2]

bool Digikam::SimilarityDb::hasFingerprints | ( | FuzzyAlgorithm | algorithm | ) | const

Parameters

  algorithm | The algorithm.

Returns
  true, if there are fingerprints and false, otherwise.

## ◆ integrityCheck()

bool Digikam::SimilarityDb::integrityCheck | ( |  | ) |

Returns
  true, if the integrity check was passed and false, else.

## ◆ registeredImageIds()

QSet< qlonglong > Digikam::SimilarityDb::registeredImageIds | ( |  | ) | const

Returns
  a set of all present image ids.

## ◆ removeImageFingerprint()

void Digikam::SimilarityDb::removeImageFingerprint | ( | qlonglong | imageID,
|  | FuzzyAlgorithm | algorithm = `FuzzyAlgorithm::Haar`
| ) |  |

Also, this automatically removes the entries in the ImageSimilarities table for the given algorithm and image id.

Parameters

  imageID | The image id.
  algorithm | The algorithm.

## ◆ removeImageSimilarity() [1/2]

void Digikam::SimilarityDb::removeImageSimilarity | ( | qlonglong | imageID,
|  | FuzzyAlgorithm | algorithm = `FuzzyAlgorithm::Haar`
| ) |  |

Parameters

  imageID | The image id.
  algorithm | The algorithm.

## ◆ removeImageSimilarity() [2/2]

void Digikam::SimilarityDb::removeImageSimilarity | ( | qlonglong | imageID1,
|  | qlonglong | imageID2,
|  | FuzzyAlgorithm | algorithm = `FuzzyAlgorithm::Haar`
| ) |  |

Parameters

  imageID1 | The first image id.
  imageID2 | The second image id.
  algorithm | The algorithm.

## ◆ setSetting()

bool Digikam::SimilarityDb::setSetting | ( | const QString & | keyword,
|  | const QString & | value
| ) |  |

Parameters

  keyword | The keyword, i.e. setting name.
  value | The value.

Returns
  True, if the value was set and false, else..