MayaFlux 0.4.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 251 of file ImageReader.cpp.

252{
253 auto ext = std::filesystem::path(filepath).extension().string();
254 if (!ext.empty() && ext[0] == '.') {
255 ext = ext.substr(1);
256 }
257
258 static const std::vector<std::string> supported = {
259 "png", "jpg", "jpeg", "bmp", "tga", "psd", "gif", "hdr", "pic", "pnm",
260 "exr"
261 };
262
263 return std::ranges::find(supported, ext) != supported.end();
264}

Referenced by open().

+ Here is the caller graph for this function: