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

Function ReadAttribute

SampleFramework11/v1.02/TinyEXR.cpp:6738–6763  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

LoadMultiChannelEXRFunction · 0.85
LoadDeepEXRFunction · 0.85

Calls 5

ReadStringFunction · 0.85
IsBigEndianFunction · 0.85
swap4Function · 0.85
atMethod · 0.80
resizeMethod · 0.45

Tested by

no test coverage detected