rEFIt_UEFI/libeg/lodepng.cpp
/*in an idat chunk, each scanline is a multiple of 8 bits, unlike the lodepng output buffer,
and in addition has one extra byte per line: the filter byte. So this gives a larger
result than lodepng_get_raw_size. Set h to 1 to get the size of 1 row including filter byte. */
in an idat chunk, each scanline is a multiple of 8 bits, unlike the lodepng output buffer,
and in addition has one extra byte per line: the filter byte. So this gives a larger
result than lodepng_get_raw_size. Set h to 1 to get the size of 1 row including filter byte.
in an idat chunk each scanline is a multiple of 8 bits unlike the lodepng output buffer and in addition has one extra byte per line : the filter byte . So this gives a larger result than lodepng_get_raw_size . Set h to 1 to get the size of 1 row including filter byte .
static size_t lodepng_get_raw_size_idat(unsigned w, unsigned h, unsigned bpp) {
  size_t line = ((size_t)(w / 8u) * bpp) + 1u + ((w & 7u) * bpp + 7u) / 8u;
  return (size_t)h * line;
}
static size_t lodepng_get_raw_size_idat ( unsigned w , unsigned h , unsigned bpp ) { size_t line = ( ( size_t ) ( w / 8u ) * bpp ) + 1u + ( ( w & 7u ) * bpp + 7u ) / 8u ; return ( size_t ) h * line ; }
in an idat chunk, each scanline is a multiple of 8 bits, unlike the lodepng output buffer,
and in addition has one extra byte per line: the filter byte.
in an idat chunk each scanline is a multiple of 8 bits unlike the lodepng output buffer and in addition has one extra byte per line : the filter byte .
/* + 1 for the filter byte, and possibly plus padding bits per line. */ /* Ignoring casts, the expression is equal to (w * bpp + 7) / 8 + 1, but avoids overflow of w * bpp */