|
|
@ -33,11 +33,10 @@ trilerp(uint32_t c0, uint32_t c1, uint32_t c2){
|
|
|
|
|
|
|
|
|
|
|
|
// Retarded RGBA blitter (ASCII only).
|
|
|
|
// Retarded RGBA blitter (ASCII only).
|
|
|
|
static inline int
|
|
|
|
static inline int
|
|
|
|
tria_blit_ascii(const tinfo* tcache, ncplane* nc, int placey, int placex,
|
|
|
|
tria_blit_ascii(ncplane* nc, int placey, int placex, int linesize,
|
|
|
|
int linesize, const void* data, int begy, int begx,
|
|
|
|
const void* data, int begy, int begx,
|
|
|
|
int leny, int lenx, unsigned blendcolors){
|
|
|
|
int leny, int lenx, unsigned blendcolors){
|
|
|
|
//fprintf(stderr, "ASCII %d X %d @ %d X %d (%p) place: %d X %d\n", leny, lenx, begy, begx, data, placey, placex);
|
|
|
|
//fprintf(stderr, "ASCII %d X %d @ %d X %d (%p) place: %d X %d\n", leny, lenx, begy, begx, data, placey, placex);
|
|
|
|
(void)tcache;
|
|
|
|
|
|
|
|
const int bpp = 32;
|
|
|
|
const int bpp = 32;
|
|
|
|
int dimy, dimx, x, y;
|
|
|
|
int dimy, dimx, x, y;
|
|
|
|
int total = 0; // number of cells written
|
|
|
|
int total = 0; // number of cells written
|
|
|
@ -83,10 +82,9 @@ tria_blit_ascii(const tinfo* tcache, ncplane* nc, int placey, int placex,
|
|
|
|
// RGBA half-block blitter. Best for most images/videos. Full fidelity
|
|
|
|
// RGBA half-block blitter. Best for most images/videos. Full fidelity
|
|
|
|
// combined with 1:1 pixel aspect ratio.
|
|
|
|
// combined with 1:1 pixel aspect ratio.
|
|
|
|
static inline int
|
|
|
|
static inline int
|
|
|
|
tria_blit(const tinfo* tcache, ncplane* nc, int placey, int placex,
|
|
|
|
tria_blit(ncplane* nc, int placey, int placex, int linesize,
|
|
|
|
int linesize, const void* data, int begy, int begx,
|
|
|
|
const void* data, int begy, int begx,
|
|
|
|
int leny, int lenx, unsigned blendcolors){
|
|
|
|
int leny, int lenx, unsigned blendcolors){
|
|
|
|
(void)tcache;
|
|
|
|
|
|
|
|
//fprintf(stderr, "HALF %d X %d @ %d X %d (%p) place: %d X %d\n", leny, lenx, begy, begx, data, placey, placex);
|
|
|
|
//fprintf(stderr, "HALF %d X %d @ %d X %d (%p) place: %d X %d\n", leny, lenx, begy, begx, data, placey, placex);
|
|
|
|
const int bpp = 32;
|
|
|
|
const int bpp = 32;
|
|
|
|
int dimy, dimx, x, y;
|
|
|
|
int dimy, dimx, x, y;
|
|
|
@ -418,10 +416,9 @@ qtrans_check(nccell* c, unsigned blendcolors,
|
|
|
|
// quadrant blitter. maps 2x2 to each cell. since we only have two colors at
|
|
|
|
// quadrant blitter. maps 2x2 to each cell. since we only have two colors at
|
|
|
|
// our disposal (foreground and background), we lose some fidelity.
|
|
|
|
// our disposal (foreground and background), we lose some fidelity.
|
|
|
|
static inline int
|
|
|
|
static inline int
|
|
|
|
quadrant_blit(const tinfo* tcache, ncplane* nc, int placey, int placex,
|
|
|
|
quadrant_blit(ncplane* nc, int placey, int placex, int linesize,
|
|
|
|
int linesize, const void* data, int begy, int begx,
|
|
|
|
const void* data, int begy, int begx,
|
|
|
|
int leny, int lenx, unsigned blendcolors){
|
|
|
|
int leny, int lenx, unsigned blendcolors){
|
|
|
|
(void)tcache;
|
|
|
|
|
|
|
|
const int bpp = 32;
|
|
|
|
const int bpp = 32;
|
|
|
|
int dimy, dimx, x, y;
|
|
|
|
int dimy, dimx, x, y;
|
|
|
|
int total = 0; // number of cells written
|
|
|
|
int total = 0; // number of cells written
|
|
|
@ -642,10 +639,9 @@ sex_trans_check(cell* c, const uint32_t rgbas[6], unsigned blendcolors){
|
|
|
|
// sextant blitter. maps 3x2 to each cell. since we only have two colors at
|
|
|
|
// sextant blitter. maps 3x2 to each cell. since we only have two colors at
|
|
|
|
// our disposal (foreground and background), we lose some fidelity.
|
|
|
|
// our disposal (foreground and background), we lose some fidelity.
|
|
|
|
static inline int
|
|
|
|
static inline int
|
|
|
|
sextant_blit(const tinfo* tcache, ncplane* nc, int placey, int placex,
|
|
|
|
sextant_blit(ncplane* nc, int placey, int placex, int linesize,
|
|
|
|
int linesize, const void* data, int begy, int begx,
|
|
|
|
const void* data, int begy, int begx,
|
|
|
|
int leny, int lenx, unsigned blendcolors){
|
|
|
|
int leny, int lenx, unsigned blendcolors){
|
|
|
|
(void)tcache;
|
|
|
|
|
|
|
|
const int bpp = 32;
|
|
|
|
const int bpp = 32;
|
|
|
|
int dimy, dimx, x, y;
|
|
|
|
int dimy, dimx, x, y;
|
|
|
|
int total = 0; // number of cells written
|
|
|
|
int total = 0; // number of cells written
|
|
|
@ -712,10 +708,9 @@ fold_rgb8(unsigned* restrict r, unsigned* restrict g, unsigned* restrict b,
|
|
|
|
// visuals with only two colors in a given area, as it packs lots of
|
|
|
|
// visuals with only two colors in a given area, as it packs lots of
|
|
|
|
// resolution. always transparent background.
|
|
|
|
// resolution. always transparent background.
|
|
|
|
static inline int
|
|
|
|
static inline int
|
|
|
|
braille_blit(const tinfo* tcache, ncplane* nc, int placey, int placex,
|
|
|
|
braille_blit(ncplane* nc, int placey, int placex, int linesize,
|
|
|
|
int linesize, const void* data, int begy, int begx,
|
|
|
|
const void* data, int begy, int begx,
|
|
|
|
int leny, int lenx, unsigned blendcolors){
|
|
|
|
int leny, int lenx, unsigned blendcolors){
|
|
|
|
(void)tcache;
|
|
|
|
|
|
|
|
const int bpp = 32;
|
|
|
|
const int bpp = 32;
|
|
|
|
int dimy, dimx, x, y;
|
|
|
|
int dimy, dimx, x, y;
|
|
|
|
int total = 0; // number of cells written
|
|
|
|
int total = 0; // number of cells written
|
|
|
@ -927,7 +922,7 @@ int ncblit_rgba(const void* data, int linesize, const struct ncvisual_options* v
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const bool blend = (vopts->flags & NCVISUAL_OPTION_BLEND);
|
|
|
|
const bool blend = (vopts->flags & NCVISUAL_OPTION_BLEND);
|
|
|
|
return bset->blit(NULL, nc, vopts->y, vopts->x, linesize, data, begy, begx,
|
|
|
|
return bset->blit(nc, vopts->y, vopts->x, linesize, data, begy, begx,
|
|
|
|
leny, lenx, blend);
|
|
|
|
leny, lenx, blend);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -944,7 +939,7 @@ const struct blitset* lookup_blitset(const tinfo* tcache, ncblitter_e setid, boo
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// without pixel support, NCBLIT_PIXEL decays to NCBLIT_3x2
|
|
|
|
// without pixel support, NCBLIT_PIXEL decays to NCBLIT_3x2
|
|
|
|
if(!tcache->pixelon && setid == NCBLIT_PIXEL){
|
|
|
|
if(!tcache->sixel_supported && setid == NCBLIT_PIXEL){
|
|
|
|
if(may_degrade){
|
|
|
|
if(may_degrade){
|
|
|
|
setid = NCBLIT_3x2;
|
|
|
|
setid = NCBLIT_3x2;
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|