From c317012c9957e02bd540c32ab285b7e5ac2ad8d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Poizl?= Date: Mon, 10 Mar 2025 03:05:44 -0700 Subject: [PATCH] Configurable threshold --- thumbnailer/loadxisf.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/thumbnailer/loadxisf.cpp b/thumbnailer/loadxisf.cpp index e79e73c..059b496 100644 --- a/thumbnailer/loadxisf.cpp +++ b/thumbnailer/loadxisf.cpp @@ -8,7 +8,16 @@ bool OpenGLES = false; void RawImageToHTBITMAP(std::shared_ptr &rawImage, HBITMAP *hbmp, UINT thumbSize) { rawImage->calcStats(); - if(rawImage->imageStats().m_median[0] < rawImage->norm() * 0.2f) + + DWORD thre = 20; + DWORD dataSize = 4; + HRESULT hr = HRESULT_FROM_WIN32(RegGetValueW(HKEY_CURRENT_USER, L"SOFTWARE\\nou\\Tenmon\\settings", L"thumbnailstretchthreshold", RRF_RT_DWORD, NULL, &thre, &dataSize)); + + float thref = 0.2f; + if(hr == S_OK) + thref = thre / 100.0f; + + if(rawImage->imageStats().m_median[0] < rawImage->norm() * thref) { //OutputDebugStringA("Stretch image"); MTFParam params = rawImage->calcMTFParams();