Swizzle image colour channels

16 views
Skip to first unread message

Anmol Sud

unread,
Jun 3, 2021, 11:55:49 AM6/3/21
to skia-discuss
I have some images stored in ARGB (32-bit) format. While setting up "SkColorType" in "SkImageInfo" I do not see a corresponding 32-bit ARGB format there. Converting this buffer is going to be very expensive considering these images can be huge. Is there a way to avoid having to do this on the CPU on client side and can be handled within skia?

Mike Reed

unread,
Jun 3, 2021, 12:09:12 PM6/3/21
to skia-d...@googlegroups.com

kBGRA_8888_SkColorType


This is ARGB in little-endian. Is that sufficient? If not, you may need to convert up-front, or use something like a SkColorMatrixFilter to swizzle when the image is sampled at runtime.

On Thu, Jun 3, 2021 at 11:55 AM Anmol Sud <anmol....@gmail.com> wrote:
I have some images stored in ARGB (32-bit) format. While setting up "SkColorType" in "SkImageInfo" I do not see a corresponding 32-bit ARGB format there. Converting this buffer is going to be very expensive considering these images can be huge. Is there a way to avoid having to do this on the CPU on client side and can be handled within skia?

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/23524284-a275-45cd-83b2-f2fbbe008c7bn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages