Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Fix cross-channel filter in F16 mode to not generate negative values

Dmitry Kazakov47a51021cf8e
diff --git a/plugins/color/colorspaceextensions/kis_hsv_adjustment.cpp b/plugins/color/colorspaceextensions/kis_hsv_adjustment.cpp
index 38d6f8728a..2c3e77a906 100644
--- a/plugins/color/colorspaceextensions/kis_hsv_adjustment.cpp
+++ b/plugins/color/colorspaceextensions/kis_hsv_adjustment.cpp
@@ -50,18 +50,18 @@ void clamp<quint16>(float* r, float* g, float* b)
template<>
void clamp<half>(float* r, float* g, float* b)
{
- Q_UNUSED(r);
- Q_UNUSED(g);
- Q_UNUSED(b);
+ *r = qMax(0.0f, *r);
+ *g = qMax(0.0f, *g);
+ *b = qMax(0.0f, *b);
}
#endif
template<>
void clamp<float>(float* r, float* g, float* b)
{
- Q_UNUSED(r);
- Q_UNUSED(g);
- Q_UNUSED(b);
+ *r = qMax(0.0f, *r);
+ *g = qMax(0.0f, *g);
+ *b = qMax(0.0f, *b);
}
#include "kis_global.h"