rEFIt_UEFI/libeg/lodepng.cpp
/*Adds a single color to the color stats. The stats must already have been inited. The color must be given as 16-bit
(with 2 bytes repeating for 8-bit and 65535 for opaque alpha channel). This function is expensive, do not call it for
all pixels of an image but only for a few additional values. */
Adds a single color to the color stats. The stats must already have been inited. The color must be given as 16-bit
(with 2 bytes repeating for 8-bit and 65535 for opaque alpha channel). This function is expensive, do not call it for
all pixels of an image but only for a few additional values.
Adds a single color to the color stats . The stats must already have been inited . The color must be given as 16 - bit ( with 2 bytes repeating for 8 - bit and 65535 for opaque alpha channel ) . This function is expensive do not call it for all pixels of an image but only for a few additional values .
static unsigned lodepng_color_stats_add(LodePNGColorStats* stats,
                                        unsigned r, unsigned g, unsigned b, unsigned a) {
  unsigned error = 0;
  unsigned char image[8];
  LodePNGColorMode mode;
  lodepng_color_mode_init(&mode);
  image[0] = r >> 8; image[1] = r; image[2] = g >> 8; image[3] = g;
  image[4] = b >> 8; image[5] = b; image[6] = a >> 8; image[7] = a;
  mode.bitdepth = 16;
  mode.colortype = LCT_RGBA;
  error = lodepng_compute_color_stats(stats, image, 1, 1, &mode);
  lodepng_color_mode_cleanup(&mode);
  return error;
}
static unsigned lodepng_color_stats_add ( LodePNGColorStats * stats , unsigned r , unsigned g , unsigned b , unsigned a ) { unsigned error = 0 ; unsigned char image [ 8 ] ; LodePNGColorMode mode ; lodepng_color_mode_init ( & mode ) ; image [ 0 ] = r >> 8 ; image [ 1 ] = r ; image [ 2 ] = g >> 8 ; image [ 3 ] = g ; image [ 4 ] = b >> 8 ; image [ 5 ] = b ; image [ 6 ] = a >> 8 ; image [ 7 ] = a ; mode . bitdepth = 16 ; mode . colortype = LCT_RGBA ; error = lodepng_compute_color_stats ( stats , image , 1 , 1 , & mode ) ; lodepng_color_mode_cleanup ( & mode ) ; return error ; }
Adds a single color to the color stats.
Adds a single color to the color stats .