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

Function GetLayers

tutorials/common/image/tinyexr.h:6165–6182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6163}
6164
6165static void GetLayers(const EXRHeader &exr_header,
6166 std::vector<std::string> &layer_names) {
6167 // Naive implementation
6168 // Group channels by layers
6169 // go over all channel names, split by periods
6170 // collect unique names
6171 layer_names.clear();
6172 for (int c = 0; c < exr_header.num_channels; c++) {
6173 std::string full_name(exr_header.channels[c].name);
6174 const size_t pos = full_name.find_last_of('.');
6175 if (pos != std::string::npos && pos != 0 && pos + 1 < full_name.size()) {
6176 full_name.erase(pos);
6177 if (std::find(layer_names.begin(), layer_names.end(), full_name) ==
6178 layer_names.end())
6179 layer_names.push_back(full_name);
6180 }
6181 }
6182}
6183
6184struct LayerChannel {
6185 explicit LayerChannel(size_t i, std::string n) : index(i), name(n) {}

Callers 2

EXRLayersFunction · 0.85
LoadEXRWithLayerFunction · 0.85

Calls 6

findFunction · 0.85
clearMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected