MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ by_extension()

const TensorFormat * MayaFlux::IO::TensorFormatRegistry::by_extension ( const std::string & filepath,
bool need_writer ) const
nodiscardprivate

Definition at line 33 of file TensorFormat.cpp.

34{
35 const auto ext = Detail::lower_extension(filepath);
36 if (ext.empty())
37 return nullptr;
38
39 for (const auto& format : m_formats) {
40 if (need_writer && !format.make_writer)
41 continue;
42 if (std::ranges::find(format.extensions, ext) != format.extensions.end())
43 return &format;
44 }
45 return nullptr;
46}
std::vector< TensorFormat > m_formats
std::string lower_extension(const std::string &path)
Lowercase extension of a path without its dot.

References MayaFlux::IO::Detail::lower_extension(), and m_formats.

Referenced by create_writer(), and detect().

Here is the call graph for this function:
Here is the caller graph for this function: