Move MTFParam

This commit is contained in:
2025-02-25 17:35:55 +01:00
parent d069ce3302
commit e4b9fefa5a
4 changed files with 14 additions and 8 deletions
+1
View File
@@ -46,6 +46,7 @@ set(TENMON_SRC
main.cpp main.cpp
mainwindow.cpp mainwindow.h mainwindow.cpp mainwindow.h
markedfiles.cpp markedfiles.h markedfiles.cpp markedfiles.h
mtfparam.h
rawimage.cpp rawimage.h rawimage.cpp rawimage.h
rawimage_sse.cpp rawimage_sse.cpp
scriptengine.cpp scriptengine.h scriptengine.cpp scriptengine.h
+1 -1
View File
@@ -359,7 +359,7 @@ void swPaint(std::shared_ptr<RawImage> &rawImage, float dx, float dy, float scal
auto mtf = [&mtfParams](int i, float x) auto mtf = [&mtfParams](int i, float x)
{ {
x = (x - mtfParams.blackPoint[i]) / (mtfParams.whitePoint[i] - mtfParams.blackPoint[i]); x = (x - mtfParams.blackPoint[i]) / (mtfParams.whitePoint[i] - mtfParams.blackPoint[i]);
x = std::min(std::max(x, 0.0f), 1.0f); x = std::clamp(x, 0.0f, 1.0f);
return ((mtfParams.midPoint[i] - 1.0f) * x) / ((2.0f * mtfParams.midPoint[i] - 1.0f) * x - mtfParams.midPoint[i]); return ((mtfParams.midPoint[i] - 1.0f) * x) / ((2.0f * mtfParams.midPoint[i] - 1.0f) * x - mtfParams.midPoint[i]);
}; };
+11
View File
@@ -0,0 +1,11 @@
#ifndef MTFPARAM_H
#define MTFPARAM_H
struct MTFParam
{
float blackPoint[3] = {0.0f, 0.0f, 0.0f};
float midPoint[3] = {0.5f, 0.5f, 0.5f};
float whitePoint[3] = {1.0f, 1.0f, 1.0f};
};
#endif // MTFPARAM_H
+1 -7
View File
@@ -4,16 +4,10 @@
#include <QToolBar> #include <QToolBar>
#include <QStackedWidget> #include <QStackedWidget>
#include "stfslider.h" #include "stfslider.h"
#include "mtfparam.h"
class Image; class Image;
struct MTFParam
{
float blackPoint[3] = {0.0f, 0.0f, 0.0f};
float midPoint[3] = {0.5f, 0.5f, 0.5f};
float whitePoint[3] = {1.0f, 1.0f, 1.0f};
};
class StretchToolbar : public QToolBar class StretchToolbar : public QToolBar
{ {
Q_OBJECT Q_OBJECT