1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
--- src/gui/xBRZ/xbrz.cpp.origin 2015-06-16 01:06:32.349519739 +0200
+++ src/gui/xBRZ/xbrz.cpp 2015-06-16 01:10:00.872799237 +0200
@@ -661,23 +661,22 @@
auto eq = [&](uint32_t pix1, uint32_t pix2) { return ColorDistance::dist(pix1, pix2, cfg.luminanceWeight_) < cfg.equalColorTolerance_; };
auto dist = [&](uint32_t pix1, uint32_t pix2) { return ColorDistance::dist(pix1, pix2, cfg.luminanceWeight_); };
- const bool doLineBlend = [&]() -> bool
- {
- if (getBottomR(blend) >= BLEND_DOMINANT)
- return true;
-
- //make sure there is no second blending in an adjacent rotation for this pixel: handles insular pixels, mario eyes
- if (getTopR(blend) != BLEND_NONE && !eq(e, g)) //but support double-blending for 90?corners
- return false;
- if (getBottomL(blend) != BLEND_NONE && !eq(e, c))
- return false;
-
- //no full blending for L-shapes; blend corner only (handles "mario mushroom eyes")
- if (!eq(e, i) && eq(g, h) && eq(h , i) && eq(i, f) && eq(f, c))
- return false;
+ bool doLineBlend;
- return true;
- }();
+ if (getBottomR(blend) >= BLEND_DOMINANT)
+ doLineBlend = true;
+
+ //make sure there is no second blending in an adjacent rotation for this pixel: handles insular pixels, mario eyes
+ else if (getTopR(blend) != BLEND_NONE && !eq(e, g)) //but support double-blending for 90?corners
+ doLineBlend = false;
+ else if (getBottomL(blend) != BLEND_NONE && !eq(e, c))
+ doLineBlend = false;
+
+ //no full blending for L-shapes; blend corner only (handles "mario mushroom eyes")
+ else if (!eq(e, i) && eq(g, h) && eq(h , i) && eq(i, f) && eq(f, c))
+ doLineBlend = false;
+ else
+ doLineBlend = true;
const uint32_t px = dist(e, f) <= dist(e, h) ? f : h; //choose most similar color
|