mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-16 00:13:00 +00:00
quadblitter: respect transparency #686
This commit is contained in:
parent
10cbaedc77
commit
841c0a4b8f
@ -58,6 +58,7 @@ videothread(void* vnc){
|
|||||||
struct ncvisual_options ovopts = {
|
struct ncvisual_options ovopts = {
|
||||||
.scaling = NCSCALE_STRETCH,
|
.scaling = NCSCALE_STRETCH,
|
||||||
.n = ncp,
|
.n = ncp,
|
||||||
|
.y = 1,
|
||||||
};
|
};
|
||||||
int three = 3;
|
int three = 3;
|
||||||
if(ncvisual_render(nc, ncv, &ovopts) == NULL){
|
if(ncvisual_render(nc, ncv, &ovopts) == NULL){
|
||||||
|
@ -307,8 +307,6 @@ quadrant_blit(ncplane* nc, int placey, int placex, int linesize,
|
|||||||
&& ffmpeg_trans_p(bgr, rgbbase_bl[3]) && ffmpeg_trans_p(bgr, rgbbase_br[3])){
|
&& ffmpeg_trans_p(bgr, rgbbase_bl[3]) && ffmpeg_trans_p(bgr, rgbbase_br[3])){
|
||||||
cell_set_bg_alpha(c, CELL_ALPHA_TRANSPARENT);
|
cell_set_bg_alpha(c, CELL_ALPHA_TRANSPARENT);
|
||||||
cell_set_fg_alpha(c, CELL_ALPHA_TRANSPARENT);
|
cell_set_fg_alpha(c, CELL_ALPHA_TRANSPARENT);
|
||||||
egc = " ";
|
|
||||||
// FIXME else look for pairs of transparency!
|
|
||||||
}else{
|
}else{
|
||||||
uint32_t tl = 0, tr = 0, bl = 0, br = 0;
|
uint32_t tl = 0, tr = 0, bl = 0, br = 0;
|
||||||
channel_set_rgb(&tl, rgbbase_tl[rpos], rgbbase_tl[1], rgbbase_tl[bpos]);
|
channel_set_rgb(&tl, rgbbase_tl[rpos], rgbbase_tl[1], rgbbase_tl[bpos]);
|
||||||
@ -317,16 +315,16 @@ quadrant_blit(ncplane* nc, int placey, int placex, int linesize,
|
|||||||
channel_set_rgb(&br, rgbbase_br[rpos], rgbbase_br[1], rgbbase_br[bpos]);
|
channel_set_rgb(&br, rgbbase_br[rpos], rgbbase_br[1], rgbbase_br[bpos]);
|
||||||
uint32_t bg, fg;
|
uint32_t bg, fg;
|
||||||
egc = quadrant_solver(tl, tr, bl, br, &fg, &bg);
|
egc = quadrant_solver(tl, tr, bl, br, &fg, &bg);
|
||||||
|
assert(egc);
|
||||||
cell_set_fchannel(c, fg);
|
cell_set_fchannel(c, fg);
|
||||||
cell_set_bchannel(c, bg);
|
cell_set_bchannel(c, bg);
|
||||||
if(blendcolors){
|
if(blendcolors){
|
||||||
cell_set_bg_alpha(c, CELL_ALPHA_BLEND);
|
cell_set_bg_alpha(c, CELL_ALPHA_BLEND);
|
||||||
cell_set_fg_alpha(c, CELL_ALPHA_BLEND);
|
cell_set_fg_alpha(c, CELL_ALPHA_BLEND);
|
||||||
}
|
}
|
||||||
}
|
if(cell_load(nc, c, egc) <= 0){
|
||||||
assert(egc);
|
return -1;
|
||||||
if(cell_load(nc, c, egc) <= 0){
|
}
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
++total;
|
++total;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user