MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / GetImageFormatFromPath

Function GetImageFormatFromPath

src/openrct2/core/Imaging.cpp:261–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259 }
260
261 ImageFormat GetImageFormatFromPath(std::string_view path)
262 {
263 if (String::endsWith(path, ".png", true))
264 {
265 return ImageFormat::png;
266 }
267
268 if (String::endsWith(path, ".bmp", true))
269 {
270 return ImageFormat::bitmap;
271 }
272
273 return ImageFormat::unknown;
274 }
275
276 static ImageReaderFunc GetReader(ImageFormat format)
277 {

Callers 3

ReadFromFileFunction · 0.85
WriteToFileFunction · 0.85
LoadHeightmapImageFunction · 0.85

Calls 1

endsWithFunction · 0.85

Tested by

no test coverage detected