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

◆ can_read()

bool MayaFlux::IO::ImageReader::can_read ( const std::string &  filepath) const
overridevirtual

Check if a file can be read by this reader.

Parameters
filepathPath to the file.
Returns
true if the file format is supported.

Implements MayaFlux::IO::FileReader.

Definition at line 62 of file ImageReader.cpp.

63{
64 auto ext = std::filesystem::path(filepath).extension().string();
65 if (!ext.empty() && ext[0] == '.') {
66 ext = ext.substr(1);
67 }
68
69 static const std::vector<std::string> supported = {
70 "png", "jpg", "jpeg", "bmp", "tga", "psd", "gif", "hdr", "pic", "pnm"
71 };
72
73 return std::ranges::find(supported, ext) != supported.end();
74}

Referenced by open().

+ Here is the caller graph for this function: