MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / detectContainer

Function detectContainer

engine/Poseidon/Graphics/Textures/Image.cpp:483–492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

481// --- Container I/O ---
482
483static ImageContainer detectContainer(const std::string& path)
484{
485 auto dot = path.find_last_of('.');
486 if (dot == std::string::npos)
487 return ImageContainer::Unknown;
488 std::string ext = path.substr(dot);
489 std::transform(ext.begin(), ext.end(), ext.begin(), ::tolower);
490 const auto* ci = ImageContainerRegistry::FindByExtension(ext.c_str());
491 return ci ? ci->container : ImageContainer::Unknown;
492}
493
494bool Image::Save(const std::string& path) const
495{

Callers 1

SaveMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected