Пример #1
0
        public void RemoveKnownHash(ImageHashData hashData)
        {
            for (int idx = customHashes.Count - 1; idx >= 0; idx--)
            {
                ImageHashData testHash = customHashes[idx];
                if (hashData.IsMatching(testHash, 0, out int dummyDistance))
                {
                    customHashes.RemoveAt(idx);
                    ImageHashDB.Get().hashes.Remove(testHash);

                    MarkDirty();
                }
            }
        }
Пример #2
0
        public void AddKnownHash(ImageHashData hashData)
        {
            foreach (ImageHashData testHash in customHashes)
            {
                if (hashData.IsMatching(testHash, 0, out int dummyDistance))
                {
                    Logger.WriteLine("Adding hash ({0}: {1}) failed! Colision with already known ({2}: {3})", hashData.type, hashData.ownerOb, testHash.type, testHash.ownerOb);
                    return;
                }
            }

            customHashes.Add(hashData);
            ImageHashDB.Get().hashes.Add(hashData);

            MarkDirty();
        }