MCPcopy Create free account
hub / github.com/TheRealMJP/DeferredTexturing / ReadAttribute

Function ReadAttribute

SampleFramework12/v1.00/TinyEXR.cpp:6739–6764  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6737}
6738
6739const char *ReadAttribute(std::string &name, std::string &ty,
6740 std::vector<unsigned char> &data, const char *ptr) {
6741
6742 if ((*ptr) == 0) {
6743 // end of attribute.
6744 return NULL;
6745 }
6746
6747 const char *p = ReadString(name, ptr);
6748
6749 p = ReadString(ty, p);
6750
6751 int dataLen;
6752 memcpy(&dataLen, p, sizeof(int));
6753 p += 4;
6754
6755 if (IsBigEndian()) {
6756 swap4(reinterpret_cast<unsigned int*>(&dataLen));
6757 }
6758
6759 data.resize(dataLen);
6760 memcpy(&data.at(0), p, dataLen);
6761 p += dataLen;
6762
6763 return p;
6764}
6765
6766void WriteAttribute(FILE *fp, const char *name, const char *type,
6767 const unsigned char *data, int len) {

Callers 2

LoadMultiChannelEXRFunction · 0.85
LoadDeepEXRFunction · 0.85

Calls 4

ReadStringFunction · 0.85
IsBigEndianFunction · 0.85
swap4Function · 0.85
resizeMethod · 0.80

Tested by

no test coverage detected