MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / stbi__bmp_set_mask_defaults

Function stbi__bmp_set_mask_defaults

include/stb/stb_image.h:5422–5446  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5420} stbi__bmp_data;
5421
5422static int stbi__bmp_set_mask_defaults(stbi__bmp_data *info, int compress)
5423{
5424 // BI_BITFIELDS specifies masks explicitly, don't override
5425 if (compress == 3)
5426 return 1;
5427
5428 if (compress == 0) {
5429 if (info->bpp == 16) {
5430 info->mr = 31u << 10;
5431 info->mg = 31u << 5;
5432 info->mb = 31u << 0;
5433 } else if (info->bpp == 32) {
5434 info->mr = 0xffu << 16;
5435 info->mg = 0xffu << 8;
5436 info->mb = 0xffu << 0;
5437 info->ma = 0xffu << 24;
5438 info->all_a = 0; // if all_a is 0 at end, then we loaded alpha channel but it was all 0
5439 } else {
5440 // otherwise, use defaults, which is all-0
5441 info->mr = info->mg = info->mb = info->ma = 0;
5442 }
5443 return 1;
5444 }
5445 return 0; // error
5446}
5447
5448static void *stbi__bmp_parse_header(stbi__context *s, stbi__bmp_data *info)
5449{

Callers 1

stbi__bmp_parse_headerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected