Release v0.6.37: isolate image capture and OCR, fingerprint history duplicates

This commit is contained in:
2026-11-04 16:58:34 +02:00
parent 94cab4c112
commit 30e70192dc
15 changed files with 449 additions and 37 deletions
+8
View File
@@ -1,6 +1,7 @@
#pragma once
#include "platform.h"
#include <mutex>
#include <functional>
namespace ks
{
Settings loadSettings(const std::filesystem::path &, const std::vector<Layout> &);
@@ -15,6 +16,7 @@ struct Entry
bool pinned{}, image{}, files{};
int ocrState{}; // 0: legacy/not applicable, 1: pending, 2: saved, 3: failed
std::wstring ocrProfile = L"windows";
std::string contentHash, imageHash, pixelHash;
};
class History
{
@@ -22,6 +24,7 @@ class History
std::vector<Entry> entries_;
mutable std::mutex mutex_;
void saveIndex();
void loadIndex();
void prune(const Settings &);
public:
@@ -29,6 +32,9 @@ class History
std::vector<Entry> entries() const;
Clip load(const std::wstring &id) const;
void add(const Clip &, const std::wstring &app, const Settings &);
bool captureImage(DWORD sequence, const std::wstring &app, const Settings &);
std::wstring recognizeImage(const std::wstring &id, const Settings &,
const std::function<bool()> &cancelled = {}) const;
bool saveOcr(const std::wstring &id, const std::optional<std::wstring> &, const Settings &);
std::optional<std::wstring> ocrText(const std::wstring &id, const std::wstring &profile = L"") const;
void remove(const std::wstring &);
@@ -39,4 +45,6 @@ class History
Bytes encodeClip(const Clip &);
Clip decodeClip(const Bytes &);
bool sameClipboardImage(const Clip &, const Clip &);
int runImageHistoryCapture(const std::filesystem::path &request);
int runHistoryOcr(const std::filesystem::path &request);
} // namespace ks