From 87093875902605dc914dfca2e62d231426d0a92a Mon Sep 17 00:00:00 2001 From: nick black Date: Sun, 31 May 2020 21:28:43 -0400 Subject: [PATCH] Implement CELL_ALPHA_BLEND for all blitters #652 --- src/lib/blit.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lib/blit.c b/src/lib/blit.c index 81766b313..c4b711d83 100644 --- a/src/lib/blit.c +++ b/src/lib/blit.c @@ -42,6 +42,10 @@ tria_blit_ascii(ncplane* nc, int placey, int placex, int linesize, // effective in that case anyway c->channels = 0; c->attrword = 0; + if(blendcolors){ + cell_set_bg_alpha(c, CELL_ALPHA_BLEND); + cell_set_fg_alpha(c, CELL_ALPHA_BLEND); + } if(ffmpeg_trans_p(bgr, rgbbase_up[3])){ cell_set_bg_alpha(c, CELL_ALPHA_TRANSPARENT); cell_set_fg_alpha(c, CELL_ALPHA_TRANSPARENT); @@ -172,6 +176,10 @@ quadrant_blit(ncplane* nc, int placey, int placex, int linesize, // effective in that case anyway c->channels = 0; c->attrword = 0; + if(blendcolors){ + cell_set_bg_alpha(c, CELL_ALPHA_BLEND); + cell_set_fg_alpha(c, CELL_ALPHA_BLEND); + } // FIXME for now, we just sample, color-wise, and always draw a Panamanian. // we ought look for pixels with the same color, and combine them glyph-wise. // even a pair helps tremendously. we then ought interpolate the rest. we @@ -259,6 +267,9 @@ braille_blit(ncplane* nc, int placey, int placex, int linesize, // effective in that case anyway c->channels = 0; c->attrword = 0; + if(blendcolors){ + cell_set_fg_alpha(c, CELL_ALPHA_BLEND); + } // FIXME for now, we just sample, color-wise, and always draw crap. // more complicated to do optimally than quadrants, for sure. ideally, // we only get one color in an area.