| 1494 | |
| 1495 | #ifndef STBI_NO_LINEAR |
| 1496 | static float* stbi__loadf_main( |
| 1497 | stbi__context* s, int* x, int* y, int* comp, int req_comp) { |
| 1498 | unsigned char* data; |
| 1499 | #ifndef STBI_NO_HDR |
| 1500 | if (stbi__hdr_test(s)) { |
| 1501 | stbi__result_info ri; |
| 1502 | float* hdr_data = stbi__hdr_load(s, x, y, comp, req_comp, &ri); |
| 1503 | if (hdr_data) |
| 1504 | stbi__float_postprocess(hdr_data, x, y, comp, req_comp); |
| 1505 | return hdr_data; |
| 1506 | } |
| 1507 | #endif |
| 1508 | data = stbi__load_and_postprocess_8bit(s, x, y, comp, req_comp); |
| 1509 | if (data) |
| 1510 | return stbi__ldr_to_hdr(data, *x, *y, req_comp ? req_comp : *comp); |
| 1511 | return stbi__errpf("unknown image type", "Image not of any known type, or corrupt"); |
| 1512 | } |
| 1513 | |
| 1514 | STBIDEF float* stbi_loadf_from_memory( |
| 1515 | stbi_uc const* buffer, int len, int* x, int* y, int* comp, int req_comp) { |
no test coverage detected