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

Function GetLayers

Source/ThirdParty/tinyexr/tinyexr.h:6086–6103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6084}
6085
6086static void GetLayers(const EXRHeader &exr_header,
6087 std::vector<std::string> &layer_names) {
6088 // Naive implementation
6089 // Group channels by layers
6090 // go over all channel names, split by periods
6091 // collect unique names
6092 layer_names.clear();
6093 for (int c = 0; c < exr_header.num_channels; c++) {
6094 std::string full_name(exr_header.channels[c].name);
6095 const size_t pos = full_name.find_last_of('.');
6096 if (pos != std::string::npos && pos != 0 && pos + 1 < full_name.size()) {
6097 full_name.erase(pos);
6098 if (std::find(layer_names.begin(), layer_names.end(), full_name) ==
6099 layer_names.end())
6100 layer_names.push_back(full_name);
6101 }
6102 }
6103}
6104
6105struct LayerChannel {
6106 explicit LayerChannel(size_t i, std::string n) : index(i), name(n) {}

Callers 2

EXRLayersFunction · 0.85
LoadEXRWithLayerFunction · 0.85

Calls 7

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

Tested by

no test coverage detected