FastLED 3.9.15
Loading...
Searching...
No Matches

◆ nsgif__bitmap_fmt_to_colour_layout()

static struct nsgif_colour_layout fl::third_party::nsgif__bitmap_fmt_to_colour_layout ( nsgif_bitmap_fmt_t bitmap_fmt)
static

Definition at line 1434 of file gif.cpp.hpp.

1436{
1437 bool le = nsgif__host_is_little_endian();
1438
1439 /* Map endian-dependant formats to byte-wise format for the host. */
1440 switch (bitmap_fmt) {
1442 bitmap_fmt = (le) ? NSGIF_BITMAP_FMT_A8B8G8R8
1444 break;
1446 bitmap_fmt = (le) ? NSGIF_BITMAP_FMT_A8R8G8B8
1448 break;
1450 bitmap_fmt = (le) ? NSGIF_BITMAP_FMT_B8G8R8A8
1452 break;
1454 bitmap_fmt = (le) ? NSGIF_BITMAP_FMT_R8G8B8A8
1456 break;
1461 /* These are already byte-wise formats, no conversion needed */
1462 break;
1463 default:
1464 break;
1465 }
1466
1467 /* Set up colour component order for bitmap format. */
1468 switch (bitmap_fmt) {
1469 default:
1470 /* Fall through. */
1472 { struct nsgif_colour_layout result = {0, 1, 2, 3}; return result; }
1473
1475 { struct nsgif_colour_layout result = {2, 1, 0, 3}; return result; }
1476
1478 { struct nsgif_colour_layout result = {1, 2, 3, 0}; return result; }
1479
1481 { struct nsgif_colour_layout result = {3, 2, 1, 0}; return result; }
1482
1487 /* These should have been converted to byte-wise formats above */
1488 { struct nsgif_colour_layout result = {0, 1, 2, 3}; return result; }
1489 }
1490}
@ NSGIF_BITMAP_FMT_A8B8G8R8
Bite-wise ABGR: Byte order: 0xAA, 0xBB, 0xGG, 0xRR.
Definition nsgif.hpp:128
@ NSGIF_BITMAP_FMT_R8G8B8A8
Bite-wise RGBA: Byte order: 0xRR, 0xGG, 0xBB, 0xAA.
Definition nsgif.hpp:119
@ NSGIF_BITMAP_FMT_ARGB8888
32-bit ARGB (0xAARRGGBB).
Definition nsgif.hpp:152
@ NSGIF_BITMAP_FMT_RGBA8888
32-bit RGBA (0xRRGGBBAA).
Definition nsgif.hpp:136
@ NSGIF_BITMAP_FMT_B8G8R8A8
Bite-wise BGRA: Byte order: 0xBB, 0xGG, 0xRR, 0xAA.
Definition nsgif.hpp:122
@ NSGIF_BITMAP_FMT_ABGR8888
32-bit BGRA (0xAABBGGRR).
Definition nsgif.hpp:160
@ NSGIF_BITMAP_FMT_BGRA8888
32-bit BGRA (0xBBGGRRAA).
Definition nsgif.hpp:144
@ NSGIF_BITMAP_FMT_A8R8G8B8
Bite-wise ARGB: Byte order: 0xAA, 0xRR, 0xGG, 0xBB.
Definition nsgif.hpp:125
static bool nsgif__host_is_little_endian(void) FL_NOEXCEPT
Check whether the host is little endian.
Definition gif.cpp.hpp:1427
Pixel format: colour component order.
Definition gif.cpp.hpp:63
expected< T, E > result
Alias for expected (Rust-style naming)
Definition result.h:31

References FL_NOEXCEPT, nsgif__bitmap_fmt_to_colour_layout(), nsgif__host_is_little_endian(), NSGIF_BITMAP_FMT_A8B8G8R8, NSGIF_BITMAP_FMT_A8R8G8B8, NSGIF_BITMAP_FMT_ABGR8888, NSGIF_BITMAP_FMT_ARGB8888, NSGIF_BITMAP_FMT_B8G8R8A8, NSGIF_BITMAP_FMT_BGRA8888, NSGIF_BITMAP_FMT_R8G8B8A8, and NSGIF_BITMAP_FMT_RGBA8888.

Referenced by nsgif__bitmap_fmt_to_colour_layout(), and nsgif_create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: