[sixel] seed initial TAM matrix #1445

This commit is contained in:
nick black 2021-03-31 02:17:38 -04:00
parent 670dcbdd08
commit d813a66581
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -146,10 +146,13 @@ extract_color_table(const uint32_t* data, int linesize, int begy, int begx, int
for(int visx = begx ; visx < (begx + lenx) ; visx += 1){ // pixel column
for(int sy = visy ; sy < (begy + leny) && sy < visy + 6 ; ++sy){ // offset within sprixel
const uint32_t* rgb = (data + (linesize / 4 * sy) + visx);
int txyidx = (sy / cdimy) * cols + (visx / cdimx);
if(rgba_trans_p(ncpixel_a(*rgb))){
if(tacache[txyidx] == SPRIXCELL_NORMAL){
tacache[txyidx] = SPRIXCELL_CONTAINS_TRANS;
}
continue;
}
int txyidx = (sy / cdimy) * cols + (visx / cdimx);
if(tacache[txyidx] == SPRIXCELL_ANNIHILATED){
//fprintf(stderr, "TRANS SKIP %d %d %d %d (cell: %d %d)\n", visy, visx, sy, txyidx, sy / cdimy, visx / cdimx);
continue;