links

lynx-like text mode web browser
git clone anongit@rnpnr.xyz:links.git
Log | Files | Refs | Feed | README | LICENSE

Commit: 4616ab66f7a3ea95a7cc816a2d99cec363d316f7
Parent: c4818512161150dd614e9637ab533de459cbe857
Author: opask
Date:   Sun, 25 Aug 2019 00:41:09 -0600

img.c: clarify that rgb is a 3 element array in compute_background_8()

Diffstat:
Mgif.c | 13+++++--------
Mimg.c | 4++--
Mlinks.h | 2+-
3 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/gif.c b/gif.c @@ -330,14 +330,11 @@ accept_byte(unsigned char c) * and the buffer must be formatted. */ static void implant_transparent(struct gif_decoder *deco) { - if (deco->transparent>=0&&deco->transparent<(1<<deco->im_bpp)){ - if (global_cimg->strip_optimized){ - compute_background_8(deco->color_map+3*deco->transparent, - global_cimg); - }else{ - memcpy(deco->color_map+3*deco->transparent - ,deco->actual_line,3); - } + if (deco->transparent >= 0 && deco->transparent < (1 << deco->im_bpp)) { + if (global_cimg->strip_optimized) + compute_background_8(global_cimg, deco->color_map + 3 * deco->transparent); + else + memcpy(deco->color_map + 3 * deco->transparent, deco->actual_line, 3); } } diff --git a/img.c b/img.c @@ -163,7 +163,7 @@ static int height2width(double height_px, double width_mm, double height_mm) /* Compute 8-bit background for filling buffer with cimg->*_gamma * (performs rounding) */ -void compute_background_8(unsigned char *rgb, struct cached_image *cimg) +void compute_background_8(struct cached_image *cimg, unsigned char rgb[3]) { unsigned short red, green, blue; @@ -330,7 +330,7 @@ int header_dimensions_known(struct cached_image *cimg) unsigned char rgb[3]; /* 8-bit */ - compute_background_8(rgb, cimg); + compute_background_8(cimg, rgb); mix_one_color_24(cimg->buffer, cimg->width * cimg->height, rgb[0], rgb[1], rgb[2]); diff --git a/links.h b/links.h @@ -2983,7 +2983,7 @@ extern struct cached_image *global_cimg; /* Below are internal functions shared with imgcache.c, gif.c, and xbm.c */ int header_dimensions_known(struct cached_image *cimg); void img_end(struct cached_image *cimg); -void compute_background_8(unsigned char *rgb, struct cached_image *cimg); +void compute_background_8(struct cached_image *cimg, unsigned char rgb[3]); void buffer_to_bitmap_incremental(struct cached_image *cimg ,unsigned char *buffer, int height, int yoff, int *dregs, int use_strip);