summaryrefslogtreecommitdiff
path: root/src/media.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-09-07 15:29:54 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-09-07 15:29:54 +0300
commita2acc9264f3259f4ea9c66f951feb6246bff293e (patch)
treea736b52c6c7362f8d7175ad93c7c354a53bfccc4 /src/media.c
parent7ebf62baffed32be593fa1307afd3a303575f1c4 (diff)
Cleanup
Diffstat (limited to 'src/media.c')
-rw-r--r--src/media.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/media.c b/src/media.c
index 999368c5..636cd91f 100644
--- a/src/media.c
+++ b/src/media.c
@@ -115,9 +115,9 @@ static void applyImageStyle_(enum iImageStyle style, iInt2 size, uint8_t *imgDat
115 if (style != grayscale_ImageStyle) { 115 if (style != grayscale_ImageStyle) {
116 colorize = get_Color(style == textColorized_ImageStyle ? tmParagraph_ColorId 116 colorize = get_Color(style == textColorized_ImageStyle ? tmParagraph_ColorId
117 : tmPreformatted_ColorId); 117 : tmPreformatted_ColorId);
118 /* Maximize contrast. */ 118 /* Compensate for change in mid-tones. */
119 const int colMax = iMax(iMax(colorize.r, colorize.g), colorize.b); 119 const int colMax = iMax(iMax(colorize.r, colorize.g), colorize.b);
120 brighten = iClamp(1.0f - (colorize.r + colorize.g + colorize.b) / (colMax * 3), 0.0f, 0.5f); /* compensate loss of light */ 120 brighten = iClamp(1.0f - (colorize.r + colorize.g + colorize.b) / (colMax * 3), 0.0f, 0.5f);
121 } 121 }
122 iHSLColor hslColorize = hsl_Color(colorize); 122 iHSLColor hslColorize = hsl_Color(colorize);
123 while (numPixels-- > 0) { 123 while (numPixels-- > 0) {