Exemplo n.º 1
0
 public static byte[] Serialized(SampleFingerprint fp)
 {
     return(PersistentCache.Get("templates", fp.Path + ".cbor", () =>
     {
         return new FingerprintTemplate(fp.Decode()).ToByteArray();
     }));
 }
Exemplo n.º 2
0
 public static byte[] Extractor(string key, SampleFingerprint fp)
 {
     return(PersistentCache.Get(Path.Combine("extractor-transparency-files", key), ExtractorPath(key, fp), () =>
     {
         using (var collector = new FileCollector(key))
         {
             new FingerprintTemplate(fp.Decode());
             return collector.Files[0];
         }
     }));
 }
Exemplo n.º 3
0
 public static Table ExtractorTable(SampleFingerprint fp)
 {
     return(PersistentCache.Get <Table>("extractor-transparency-stats", fp.Path, () =>
     {
         using (var collector = new TableCollector())
         {
             new FingerprintTemplate(fp.Decode());
             return collector.Sum();
         }
     }));
 }
Exemplo n.º 4
0
 public static Table ExtractorTable(SampleFingerprint fp)
 {
     return(PersistentCache.Get <Table>("extractor-transparency-stats", fp, () =>
     {
         var image = fp.Load();
         using (var collector = new TableCollector())
         {
             new FingerprintTemplate(fp.Decode());
             return collector.Accumulator.Summarize();
         }
     }));
 }