Re: Get RGBA image

Suhail Doshi <[email protected]> Tue, 6 Aug 2019 09:03:04 -0700
Newsgroups gmane.comp.freedesktop.xcb
Message-ID <CAKDSyZ6f8FqEP3R7twjjVn3SGm9_wMuKgRNzvmTUFMDapJ9nhw@mail.gmail.com>
And how might you figure out what you have: 4 bits of RGBA or 5 bits with a
pad or something else? Docs feel a bit scant.

On Mon, Aug 5, 2019 at 6:07 PM Suhail Doshi <[email protected]>
wrote:

> Is there a way to just get 8-bits per channel (3 or 4 channel)?
>
> I am using an encoder that accepts 8-bit packed RGBA.
>
> Ideally, I don’t have to do bit manipulation on my own because that will
> slow things down.
>
> On Mon, Aug 5, 2019 at 5:56 PM Alan Coopersmith <
> [email protected]> wrote:
>
>> On 8/5/19 5:51 PM, Suhail Doshi wrote:
>> > Hi there,
>> >
>> > I am trying out this
>> > code: https://gist.github.com/Suhail/3ae62751857ff034a027adcacd350b69
>> >
>> > One thing I noticed is that when I print the xcb image struct info I
>> don't get
>> > the image size I was expecting:
>> >
>> > xcb_image_print() Printing a (1024,768) xcb_image_t of 1572864 bytes,
>> depth: 16,
>> > bpp: 16
>> >
>> > Do you know why ximg->size wouldn't be 1024*768*3 (3 channel: RGB)? Or
>> 4 channel?
>> >
>> > 1572864 seems like an odd size.
>>
>> It's the size I'd expect - 1024 * 768 * 2 (where 2 is 16 bits-per-pixel
>> divided
>> by 8 bits per byte).  You might have 4 bits each of RGBA or 5 bits each
>> of RGB
>> plus a pad bit, or some other combination of channels, in those 16 bits.
>>
>> --
>>         -Alan Coopersmith-               [email protected]
>>          Oracle Solaris Engineering - https://blogs.oracle.com/alanc
>>
> --
>
> Suhail
>
> --
>
> Founder
>
-- 

Suhail

--

Founder

_______________________________________________
Xcb mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/xcb