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

◆ create_reader()

std::unique_ptr< TensorReader > MayaFlux::IO::TensorFormatRegistry::create_reader ( const std::string & filepath,
std::string_view format = {} ) const
nodiscard

New reader for a file.

Parameters
filepathPath to read.
formatOptional format name that overrides detection.
Returns
Unopened reader, or nullptr when no format applies.

Definition at line 61 of file TensorFormat.cpp.

63{
64 const TensorFormat* chosen = format.empty() ? detect(filepath) : find(format);
65 return chosen && chosen->make_reader ? chosen->make_reader() : nullptr;
66}
const TensorFormat * detect(const std::string &filepath) const
Format recognised by content, then by extension, or nullptr.
const TensorFormat * find(std::string_view name) const
Format with this name, or nullptr.

References detect(), find(), and MayaFlux::IO::TensorFormat::make_reader.

Referenced by MayaFlux::IO::IOManager::open_tensor_reader().

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