Paste P236

Masterwork From Distant Lands
ActivePublic

Authored by dkazakov on Jun 12 2018, 7:59 AM.
diff --git a/libs/pigment/compositeops/KoCompositeOpFunctions.h b/libs/pigment/compositeops/KoCompositeOpFunctions.h
index 8f8a236..9a97834 100644
--- a/libs/pigment/compositeops/KoCompositeOpFunctions.h
+++ b/libs/pigment/compositeops/KoCompositeOpFunctions.h
@@ -460,6 +460,9 @@ inline T cfGlow(T src, T dst) {
if(dst == unitValue<T>())
return unitValue<T>();
+
+ if(src == zeroValue<T>())
+ return zeroValue<T>();
return clamp<T>(div(mul(src, src), inv(dst)));
}
@@ -468,22 +471,7 @@ template<class T>
inline T cfReflect(T src, T dst) {
using namespace Arithmetic;
- if(dst == unitValue<T>())
- return unitValue<T>();
-
- return clamp<T>(cfGlow(dst,src));
-
-}
-
-template<class T>
-inline T cfUQuad1(T src, T dst) {
- using namespace Arithmetic;
- // Helper Blender Mode for Heat, and Freeze - Reptorian
-
- if(dst == zeroValue<T>())
- return zeroValue<T>();
-
- return clamp<T>(div(mul(inv(src), inv(src)),dst));
+ return cfGlow(dst,src);
}
template<class T>
@@ -492,18 +480,18 @@ inline T cfHeat(T src, T dst) {
if(dst == zeroValue<T>())
return zeroValue<T>();
-
- return clamp<T>(inv(cfUQuad1(src,dst)));
+
+ if(src == unitValue<T>())
+ return unitValue<T>();
+
+ return inv(clamp<T>(div(mul(inv(src), inv(src)),dst)));
}
template<class T>
inline T cfFreeze(T src, T dst) {
using namespace Arithmetic;
- if(dst == zeroValue<T>())
- return zeroValue<T>();
-
- return clamp<T>(cfHeat(dst,src));
+ return cfHeat(dst,src);
}
dkazakov edited the content of this paste. (Show Details)Jun 12 2018, 7:59 AM
dkazakov changed the title of this paste from untitled to Masterwork From Distant Lands.