Code cleanup: remove messy spaces before line continuation (\) in macros

This commit is contained in:
Twan van Laarhoven
2020-04-26 00:37:13 +02:00
parent 5d4c3402df
commit 5e92d9455c
19 changed files with 263 additions and 265 deletions
+22 -22
View File
@@ -56,33 +56,33 @@ template <ImageCombine combine> struct Combine {
// Based on // Based on
// http://www.pegtop.net/delphi/articles/blendmodes/ // http://www.pegtop.net/delphi/articles/blendmodes/
COMBINE_FUN(COMBINE_NORMAL, b ) COMBINE_FUN(COMBINE_NORMAL, b)
COMBINE_FUN(COMBINE_ADD, top(a + b) ) COMBINE_FUN(COMBINE_ADD, top(a + b))
COMBINE_FUN(COMBINE_SUBTRACT, bot(a - b) ) COMBINE_FUN(COMBINE_SUBTRACT, bot(a - b))
COMBINE_FUN(COMBINE_STAMP, col(a - 2 * b + 256) ) COMBINE_FUN(COMBINE_STAMP, col(a - 2 * b + 256))
COMBINE_FUN(COMBINE_DIFFERENCE, abs(a - b) ) COMBINE_FUN(COMBINE_DIFFERENCE, abs(a - b))
COMBINE_FUN(COMBINE_NEGATION, 255 - abs(255 - a - b) ) COMBINE_FUN(COMBINE_NEGATION, 255 - abs(255 - a - b))
COMBINE_FUN(COMBINE_MULTIPLY, (a * b) / 255 ) COMBINE_FUN(COMBINE_MULTIPLY, (a * b) / 255)
COMBINE_FUN(COMBINE_DARKEN, min(a, b) ) COMBINE_FUN(COMBINE_DARKEN, min(a, b))
COMBINE_FUN(COMBINE_LIGHTEN, max(a, b) ) COMBINE_FUN(COMBINE_LIGHTEN, max(a, b))
COMBINE_FUN(COMBINE_COLOR_DODGE,b == 255 ? 255 : top(a * 255 / (255 - b)) ) COMBINE_FUN(COMBINE_COLOR_DODGE, b == 255 ? 255 : top(a * 255 / (255 - b)))
COMBINE_FUN(COMBINE_COLOR_BURN, b == 0 ? 0 : bot(255 - (255-a) * 255 / b) ) COMBINE_FUN(COMBINE_COLOR_BURN, b == 0 ? 0 : bot(255 - (255-a) * 255 / b))
COMBINE_FUN(COMBINE_SCREEN, 255 - (((255 - a) * (255 - b)) / 255) ) COMBINE_FUN(COMBINE_SCREEN, 255 - (((255 - a) * (255 - b)) / 255))
COMBINE_FUN(COMBINE_OVERLAY, a < 128 COMBINE_FUN(COMBINE_OVERLAY, a < 128
? (a * b) >> 7 ? (a * b) >> 7
: 255 - (((255 - a) * (255 - b)) >> 7) ) : 255 - (((255 - a) * (255 - b)) >> 7))
COMBINE_FUN(COMBINE_HARD_LIGHT, b < 128 COMBINE_FUN(COMBINE_HARD_LIGHT, b < 128
? (a * b) >> 7 ? (a * b) >> 7
: 255 - (((255 - a) * (255 - b)) >> 7) ) : 255 - (((255 - a) * (255 - b)) >> 7))
COMBINE_FUN(COMBINE_SOFT_LIGHT, b) COMBINE_FUN(COMBINE_SOFT_LIGHT, b)
COMBINE_FUN(COMBINE_REFLECT, b == 255 ? 255 : top(a * a / (255 - b)) ) COMBINE_FUN(COMBINE_REFLECT, b == 255 ? 255 : top(a * a / (255 - b)))
COMBINE_FUN(COMBINE_GLOW, a == 255 ? 255 : top(b * b / (255 - a)) ) COMBINE_FUN(COMBINE_GLOW, a == 255 ? 255 : top(b * b / (255 - a)))
COMBINE_FUN(COMBINE_FREEZE, b == 0 ? 0 : bot(255 - (255 - a) * (255 - a) / b) ) COMBINE_FUN(COMBINE_FREEZE, b == 0 ? 0 : bot(255 - (255 - a) * (255 - a) / b))
COMBINE_FUN(COMBINE_HEAT, a == 0 ? 0 : bot(255 - (255 - b) * (255 - b) / a) ) COMBINE_FUN(COMBINE_HEAT, a == 0 ? 0 : bot(255 - (255 - b) * (255 - b) / a))
COMBINE_FUN(COMBINE_AND, a & b ) COMBINE_FUN(COMBINE_AND, a & b)
COMBINE_FUN(COMBINE_OR, a | b ) COMBINE_FUN(COMBINE_OR, a | b)
COMBINE_FUN(COMBINE_XOR, a ^ b ) COMBINE_FUN(COMBINE_XOR, a ^ b)
COMBINE_FUN(COMBINE_SHADOW, (b * a * a) / (255 * 255) ) COMBINE_FUN(COMBINE_SHADOW, (b * a * a) / (255 * 255))
COMBINE_FUN(COMBINE_SYMMETRIC_OVERLAY, (Combine<COMBINE_OVERLAY>::f(a,b) + Combine<COMBINE_OVERLAY>::f(b,a)) / 2 ) COMBINE_FUN(COMBINE_SYMMETRIC_OVERLAY, (Combine<COMBINE_OVERLAY>::f(a,b) + Combine<COMBINE_OVERLAY>::f(b,a)) / 2 )
// ----------------------------------------------------------------------------- : Combining // ----------------------------------------------------------------------------- : Combining
+1 -1
View File
@@ -186,7 +186,7 @@ inline Type from_script(const ScriptValueP& v, Variable var) {
/// Utility for defining a script rule with two named parameters, with dependencies /// Utility for defining a script rule with two named parameters, with dependencies
#define SCRIPT_RULE_2_N_DEP(funname, type1, str1, name1, type2, str2, name2) \ #define SCRIPT_RULE_2_N_DEP(funname, type1, str1, name1, type2, str2, name2) \
SCRIPT_RULE_2_N_AUX( funname, type1, str1, name1, type2, str2, name2, \ SCRIPT_RULE_2_N_AUX( funname, type1, str1, name1, type2, str2, name2, \
virtual ScriptValueP dependencies(Context&, const Dependency&) const;, \ virtual ScriptValueP dependencies(Context&, const Dependency&) const; \
SCRIPT_FUNCTION_DEPENDENCIES(funname) { \ SCRIPT_FUNCTION_DEPENDENCIES(funname) { \
SCRIPT_PARAM_N(type1, str1, name1); \ SCRIPT_PARAM_N(type1, str1, name1); \
SCRIPT_PARAM_N(type2, str2, name2); \ SCRIPT_PARAM_N(type2, str2, name2); \
-2
View File
@@ -102,8 +102,6 @@
/** Uses a const iterator /** Uses a const iterator
* Usage: FOR_EACH_CONST(e,collect) { body-of-loop } * Usage: FOR_EACH_CONST(e,collect) { body-of-loop }
*/ */
//#define FOR_EACH_CONST(Elem,Collection) \
// FOR_EACH_T(TYPEOF_CIT(Collection), TYPEOF_CREF(Collection), Elem, Collection, begin, end)
#define FOR_EACH_CONST(Elem,Collection) \ #define FOR_EACH_CONST(Elem,Collection) \
for (auto const& Elem : Collection) for (auto const& Elem : Collection)