[Spice-devel] [vdagent-win PATCH v12 3/6] Write code to decode PNG format

Christophe Fergeau cfergeau at redhat.com
Tue Jul 25 16:59:00 UTC 2017


On Mon, Jul 24, 2017 at 01:39:35PM +0100, Frediano Ziglio wrote:
> +size_t PngCoder::convert_to_dib(uint8_t *out_buf, const uint8_t *data, size_t size)
> +{
[...]
> +    const unsigned int width = png_get_image_width(png, info);
> +    const unsigned int height = png_get_image_height(png, info);
> +    const size_t stride = compute_dib_stride(width, out_bits);
> +    const size_t image_size = stride * height;
> +    const int palette_colors = [=]() {

If you want to use a function, then give it a name, if you don't want to
use a function, then this can just go in convert_to_dib() body rather
than through a lambda (I know the latter means removing the 'const').

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170725/7c7a96f5/attachment.sig>


More information about the Spice-devel mailing list