MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / ChannelsInLayer

Function ChannelsInLayer

Source/ThirdParty/tinyexr/tinyexr.h:6111–6135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6109};
6110
6111static void ChannelsInLayer(const EXRHeader &exr_header,
6112 const std::string &layer_name,
6113 std::vector<LayerChannel> &channels) {
6114 channels.clear();
6115 //std::cout << "layer_name = " << layer_name << "\n";
6116 for (int c = 0; c < exr_header.num_channels; c++) {
6117 //std::cout << "chan[" << c << "] = " << exr_header.channels[c].name << "\n";
6118 std::string ch_name(exr_header.channels[c].name);
6119 if (layer_name.empty()) {
6120 const size_t pos = ch_name.find_last_of('.');
6121 if (pos != std::string::npos && pos < ch_name.size()) {
6122 if (pos != 0) continue;
6123 ch_name = ch_name.substr(pos + 1);
6124 }
6125 } else {
6126 const size_t pos = ch_name.find(layer_name + '.');
6127 if (pos == std::string::npos) continue;
6128 if (pos == 0) {
6129 ch_name = ch_name.substr(layer_name.size() + 1);
6130 }
6131 }
6132 LayerChannel ch(size_t(c), ch_name);
6133 channels.push_back(ch);
6134 }
6135}
6136
6137} // namespace tinyexr
6138

Callers 1

LoadEXRWithLayerFunction · 0.85

Calls 6

substrMethod · 0.80
clearMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45
findMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected