| 569 | } |
| 570 | |
| 571 | bool write_data_to_file(const char* pFilename, const void* pData, size_t len) |
| 572 | { |
| 573 | FILE* pFile = nullptr; |
| 574 | #ifdef _WIN32 |
| 575 | fopen_s(&pFile, pFilename, "wb"); |
| 576 | #else |
| 577 | pFile = fopen(pFilename, "wb"); |
| 578 | #endif |
| 579 | if (!pFile) |
| 580 | return false; |
| 581 | |
| 582 | if (len) |
| 583 | { |
| 584 | if (fwrite(pData, 1, len, pFile) != len) |
| 585 | { |
| 586 | fclose(pFile); |
| 587 | return false; |
| 588 | } |
| 589 | } |
| 590 | |
| 591 | return fclose(pFile) != EOF; |
| 592 | } |
| 593 | |
| 594 | float linear_to_srgb(float l) |
| 595 | { |
no outgoing calls
no test coverage detected