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

Function stbi__load_and_postprocess_16bit

include/stb/stb_image.h:1286–1311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1284}
1285
1286static stbi__uint16 *stbi__load_and_postprocess_16bit(stbi__context *s, int *x, int *y, int *comp, int req_comp)
1287{
1288 stbi__result_info ri;
1289 void *result = stbi__load_main(s, x, y, comp, req_comp, &ri, 16);
1290
1291 if (result == NULL)
1292 return NULL;
1293
1294 // it is the responsibility of the loaders to make sure we get either 8 or 16 bit.
1295 STBI_ASSERT(ri.bits_per_channel == 8 || ri.bits_per_channel == 16);
1296
1297 if (ri.bits_per_channel != 16) {
1298 result = stbi__convert_8_to_16((stbi_uc *) result, *x, *y, req_comp == 0 ? *comp : req_comp);
1299 ri.bits_per_channel = 16;
1300 }
1301
1302 // @TODO: move stbi__convert_format16 to here
1303 // @TODO: special case RGB-to-Y (and RGBA-to-YA) for 8-bit-to-16-bit case to keep more precision
1304
1305 if (stbi__vertically_flip_on_load) {
1306 int channels = req_comp ? req_comp : *comp;
1307 stbi__vertical_flip(result, *x, *y, channels * sizeof(stbi__uint16));
1308 }
1309
1310 return (stbi__uint16 *) result;
1311}
1312
1313#if !defined(STBI_NO_HDR) && !defined(STBI_NO_LINEAR)
1314static void stbi__float_postprocess(float *result, int *x, int *y, int *comp, int req_comp)

Callers 3

stb_image.hFile · 0.85
stbi_load_16_from_memoryFunction · 0.85

Calls 3

stbi__load_mainFunction · 0.85
stbi__convert_8_to_16Function · 0.85
stbi__vertical_flipFunction · 0.85

Tested by

no test coverage detected