[Pixman] sRGB scaling without alpha channel?
Søren Sandmann
soren.sandmann at gmail.com
Thu Mar 4 19:55:50 UTC 2021
Hi,
You are right that pixman doesn't have support for sRGB formats
without an alpha channel. It would make sense to add such support (and
it should be straightforward to do so).
You might consider biting the bullet and just use an alpha channel.
Usually a8r8g8b8 images are faster to work with than r8g8b8 anyway
since they are aligned at 32 bits and tend to have more optimized fast
paths available for them.
Søren
On Thu, Mar 4, 2021 at 5:43 AM Claude Heiland-Allen <claude at mathr.co.uk> wrote:
>
> Hi,
>
> I have some image downscaling code [1] using Pixman that currently works
> in regular RGB. I would like instead to do gamma-correct sRGB
> downscaling, but I only see an sRGB-with-alpha format in the source code
> [2]. Is it possible to use this with sRGB-without-alpha data somehow?
> I would like to avoid having to add a placeholder alpha channel before
> downscaling only to remove it afterwards.
>
> [1]
> https://code.mathr.co.uk/kalles-fraktaler-2/blob/e7ead006bb8de5b80732ad71794455395f2bba67:/fraktal_sft/scale_bitmap.cpp#l48
> [2]
> https://gitlab.freedesktop.org/pixman/pixman/-/blob/d93ec5713821106df6d57952dcf169308c7c4f0e/pixman/pixman-access.c#L1406-1411
>
> Thanks,
>
>
> Claude
> --
> https://mathr.co.uk
>
> _______________________________________________
> Pixman mailing list
> Pixman at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/pixman
More information about the Pixman
mailing list