ncblit_bgrx: reimplement using ncvisual_blit() #2451

This commit is contained in:
nick black 2021-12-10 07:53:38 -05:00
parent ca38f7d5fc
commit 39f1d9b4cc
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -997,9 +997,18 @@ int ncblit_bgrx(const void* data, int linesize, const struct ncvisual_options* v
if(rdata == NULL){
return -1;
}
int r = ncblit_rgba(rdata, linesize, vopts);
struct ncvisual* ncv = ncvisual_from_rgba(rdata, vopts->leny, linesize, vopts->lenx);
if(ncv == NULL){
free(rdata);
return r;
return -1;
}
free(rdata);
if(ncvisual_blit(ncplane_notcurses(vopts->n), ncv, vopts) == NULL){
ncvisual_destroy(ncv);
return -1;
}
ncvisual_destroy(ncv);
return 0;
}
int ncblit_rgb_loose(const void* data, int linesize,