MCPcopy Create free account
hub / github.com/OpenPathGuidingLibrary/openpgl / LoadEXRImageFromFile

Function LoadEXRImageFromFile

third-party/tinyexr/tinyexr.h:6921–6942  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6919};
6920
6921int LoadEXRImageFromFile(EXRImage *exr_image, const EXRHeader *exr_header,
6922 const char *filename, const char **err) {
6923 if (exr_image == NULL) {
6924 tinyexr::SetErrorMessage("Invalid argument for LoadEXRImageFromFile", err);
6925 return TINYEXR_ERROR_INVALID_ARGUMENT;
6926 }
6927
6928 MemoryMappedFile file(filename);
6929 if (!file.valid()) {
6930 tinyexr::SetErrorMessage("Cannot read file " + std::string(filename), err);
6931 return TINYEXR_ERROR_CANT_OPEN_FILE;
6932 }
6933
6934 if (file.size < 16) {
6935 tinyexr::SetErrorMessage("File size too short : " + std::string(filename),
6936 err);
6937 return TINYEXR_ERROR_INVALID_FILE;
6938 }
6939
6940 return LoadEXRImageFromMemory(exr_image, exr_header, file.data, file.size,
6941 err);
6942}
6943
6944int LoadEXRImageFromMemory(EXRImage *exr_image, const EXRHeader *exr_header,
6945 const unsigned char *memory, const size_t size,

Callers 2

LoadEXRWithLayerFunction · 0.85

Calls 3

SetErrorMessageFunction · 0.85
LoadEXRImageFromMemoryFunction · 0.85
validMethod · 0.80

Tested by

no test coverage detected