[Spice-devel] [vdagent-win PATCH v10 3/6] Write code to decode PNG format
Frediano Ziglio
fziglio at redhat.com
Mon Jul 24 11:32:19 UTC 2017
>
> On Fri, Jul 21, 2017 at 02:51:38PM +0100, Frediano Ziglio wrote:
> > + const int palette_colors = out_bits > 8 ? 0 : 1 << (bits == 2 ? 2 :
> > out_bits);
>
> This really deserves to be split in multiple statements to make this
> easier to parse :)
>
> Looks good otherwise.
>
> Christophe
>
Maybe just
const int palette_colors = out_bits > 8 ? 0 : // no palette
bits == 2 ? 4 : // 2 bit PNG converted to 4 bit BMP
1 << out_bits; // palette
(with the comments too)
Frediano
More information about the Spice-devel
mailing list