MayaFlux 1.0.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 256 of file ImageReader.cpp.

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

Referenced by open().

+ Here is the caller graph for this function: