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

Christophe Fergeau cfergeau at redhat.com
Tue Jul 18 16:00:23 UTC 2017


Sorry, forgot one comment,

On Mon, Jul 17, 2017 at 09:54:04AM +0100, Frediano Ziglio wrote:
> +static void line_fixup_rgb2bgr(uint8_t *line, unsigned width)
> +{
> +    for (; width; --width) {
> +        std::swap(line[0], line[2]);
> +        line += 3;
> +    }
> +}
> +
> +size_t PngCoder::convert_to_dib(uint8_t *out_buf, const uint8_t *data, size_t size)
> +{
[snip]
> +    case PNG_COLOR_TYPE_RGB:
> +        line_fixup = line_fixup_rgb2bgr;
> +        out_bits = 24;
> +        break;
> +    case PNG_COLOR_TYPE_RGB_ALPHA:
> +        line_fixup = line_fixup_rgb2bgr;
> +        out_bits = 24;
> +        png_set_strip_alpha(png);
> +        break;

Isn't line_fixup_rgb2bgr doing the same as png_set_bgr?

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/20170718/af717ee8/attachment-0001.sig>


More information about the Spice-devel mailing list