MayaFlux 0.1.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 29 of file ImageReader.cpp.

30{
31 auto ext = std::filesystem::path(filepath).extension().string();
32 if (!ext.empty() && ext[0] == '.') {
33 ext = ext.substr(1);
34 }
35
36 static const std::vector<std::string> supported = {
37 "png", "jpg", "jpeg", "bmp", "tga", "psd", "gif", "hdr", "pic", "pnm"
38 };
39
40 return std::ranges::find(supported, ext) != supported.end();
41}

Referenced by open().

+ Here is the caller graph for this function: