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

Function ReadChannelInfo

SampleFramework12/v1.00/TinyEXR.cpp:6793–6821  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6791} ChannelInfo;
6792
6793void ReadChannelInfo(std::vector<ChannelInfo> &channels,
6794 const std::vector<unsigned char> &data) {
6795 const char *p = reinterpret_cast<const char *>(&data.at(0));
6796
6797 for (;;) {
6798 if ((*p) == 0) {
6799 break;
6800 }
6801 ChannelInfo info;
6802 p = ReadString(info.name, p);
6803
6804 memcpy(&info.pixelType, p, sizeof(int));
6805 p += 4;
6806 info.pLinear = p[0]; // uchar
6807 p += 1 + 3; // reserved: uchar[3]
6808 memcpy(&info.xSampling, p, sizeof(int)); // int
6809 p += 4;
6810 memcpy(&info.ySampling, p, sizeof(int)); // int
6811 p += 4;
6812
6813 if (IsBigEndian()) {
6814 swap4(reinterpret_cast<unsigned int*>(&info.pixelType));
6815 swap4(reinterpret_cast<unsigned int*>(&info.xSampling));
6816 swap4(reinterpret_cast<unsigned int*>(&info.ySampling));
6817 }
6818
6819 channels.push_back(info);
6820 }
6821}
6822
6823void WriteChannelInfo(std::vector<unsigned char> &data,
6824 const std::vector<ChannelInfo> &channels) {

Callers 2

LoadMultiChannelEXRFunction · 0.85
LoadDeepEXRFunction · 0.85

Calls 4

ReadStringFunction · 0.85
IsBigEndianFunction · 0.85
swap4Function · 0.85
push_backMethod · 0.80

Tested by

no test coverage detected