Changeset View
Changeset View
Standalone View
Standalone View
libs/pigment/compositeops/KoCompositeOpFunctions.h
Show First 20 Lines • Show All 891 Lines • ▼ Show 20 Line(s) | |||||
892 | template<class T> | 892 | template<class T> | ||
893 | inline T cfModuloContinuous(T src, T dst) { | 893 | inline T cfModuloContinuous(T src, T dst) { | ||
894 | using namespace Arithmetic; | 894 | using namespace Arithmetic; | ||
895 | 895 | | |||
896 | return cfMultiply(cfDivisiveModuloContinuous(src,dst),src); | 896 | return cfMultiply(cfDivisiveModuloContinuous(src,dst),src); | ||
897 | } | 897 | } | ||
898 | 898 | | |||
899 | template<class T> | 899 | template<class T> | ||
900 | inline T cfColorBurnLogarithmic(T src, T dst) { | | |||
901 | using namespace Arithmetic; | | |||
902 | //Also known as Darken from EffectBank/Illusions.hu. IFS Illusions had used this blending mode. | | |||
903 | | ||||
904 | qreal fsrc = scale<qreal>(src); | | |||
905 | qreal fdst = scale<qreal>(dst); | | |||
906 | | ||||
907 | if (inv(fdst) == zeroValue<T>()) { | | |||
908 | return scale<T>(log2(1.0 + abs(fsrc)/abs(inv(.999999))/8)); | | |||
909 | } | | |||
910 | | ||||
911 | return scale<T>(log2(1.0 + abs(fsrc)/abs(inv(fdst))/8)); | | |||
912 | } | | |||
913 | | ||||
914 | template<class T> | | |||
915 | inline T cfColorDodgeLogarithmic(T src, T dst) { | | |||
916 | using namespace Arithmetic; | | |||
917 | //Also known as Lighten from EffectBank/Illusions.hu. IFS Illusions had used this blending mode. | | |||
918 | | ||||
919 | return inv(cfColorBurnLogarithmic(inv(src),inv(dst))); | | |||
920 | } | | |||
921 | | ||||
922 | template<class T> | | |||
923 | inline T cfEasyDodge(T src, T dst) { | 900 | inline T cfEasyDodge(T src, T dst) { | ||
924 | using namespace Arithmetic; | 901 | using namespace Arithmetic; | ||
925 | // The 13 divided by 15 can be adjusted to taste. See imgblend.m | 902 | // The 13 divided by 15 can be adjusted to taste. See imgblend.m | ||
926 | 903 | | |||
927 | qreal fsrc = scale<qreal>(src); | 904 | qreal fsrc = scale<qreal>(src); | ||
928 | qreal fdst = scale<qreal>(dst); | 905 | qreal fdst = scale<qreal>(dst); | ||
929 | 906 | | |||
930 | if (fsrc == 1.0) { | 907 | if (fsrc == 1.0) { | ||
Show All 29 Lines |