MCPcopy Create free account
hub / github.com/RenderKit/embree / ChannelsInLayer

Function ChannelsInLayer

tutorials/common/image/tinyexr.h:6190–6214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6188};
6189
6190static void ChannelsInLayer(const EXRHeader &exr_header,
6191 const std::string &layer_name,
6192 std::vector<LayerChannel> &channels) {
6193 channels.clear();
6194 //std::cout << "layer_name = " << layer_name << "\n";
6195 for (int c = 0; c < exr_header.num_channels; c++) {
6196 //std::cout << "chan[" << c << "] = " << exr_header.channels[c].name << "\n";
6197 std::string ch_name(exr_header.channels[c].name);
6198 if (layer_name.empty()) {
6199 const size_t pos = ch_name.find_last_of('.');
6200 if (pos != std::string::npos && pos < ch_name.size()) {
6201 if (pos != 0) continue;
6202 ch_name = ch_name.substr(pos + 1);
6203 }
6204 } else {
6205 const size_t pos = ch_name.find(layer_name + '.');
6206 if (pos == std::string::npos) continue;
6207 if (pos == 0) {
6208 ch_name = ch_name.substr(layer_name.size() + 1);
6209 }
6210 }
6211 LayerChannel ch(size_t(c), ch_name);
6212 channels.push_back(ch);
6213 }
6214}
6215
6216} // namespace tinyexr
6217

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