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

Function ReadFromFile

src/openrct2/core/Imaging.cpp:313–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

311 }
312
313 Image ReadFromFile(std::string_view path, ImageFormat format)
314 {
315 switch (format)
316 {
317 case ImageFormat::automatic:
318 return ReadFromFile(path, GetImageFormatFromPath(path));
319 default:
320 {
321 std::ifstream fs(fs::u8path(path), std::ios::binary);
322 return ReadFromStream(fs, format);
323 }
324 }
325 }
326
327 Image ReadFromBuffer(const std::vector<uint8_t>& buffer, ImageFormat format)
328 {

Callers

nothing calls this directly

Calls 2

GetImageFormatFromPathFunction · 0.85
ReadFromStreamFunction · 0.85

Tested by

no test coverage detected