MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / stbi__fopen

Function stbi__fopen

lite/example/cpp_example/mge/cv/stb_image.h:1365–1394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1363#endif
1364
1365static FILE* stbi__fopen(char const* filename, char const* mode) {
1366 FILE* f;
1367#if defined(_WIN32) && defined(STBI_WINDOWS_UTF8)
1368 wchar_t wMode[64];
1369 wchar_t wFilename[1024];
1370 if (0 == MultiByteToWideChar(
1371 65001 /* UTF8 */, 0, filename, -1, wFilename,
1372 sizeof(wFilename) / sizeof(*wFilename)))
1373 return 0;
1374
1375 if (0 ==
1376 MultiByteToWideChar(
1377 65001 /* UTF8 */, 0, mode, -1, wMode, sizeof(wMode) / sizeof(*wMode)))
1378 return 0;
1379
1380#if defined(_MSC_VER) && _MSC_VER >= 1400
1381 if (0 != _wfopen_s(&f, wFilename, wMode))
1382 f = 0;
1383#else
1384 f = _wfopen(wFilename, wMode);
1385#endif
1386
1387#elif defined(_MSC_VER) && _MSC_VER >= 1400
1388 if (0 != fopen_s(&f, filename, mode))
1389 f = 0;
1390#else
1391 f = fopen(filename, mode);
1392#endif
1393 return f;
1394}
1395
1396STBIDEF stbi_uc* stbi_load(
1397 char const* filename, int* x, int* y, int* comp, int req_comp) {

Callers 6

stbi_loadFunction · 0.85
stbi_load_16Function · 0.85
stbi_loadfFunction · 0.85
stbi_is_hdrFunction · 0.85
stbi_infoFunction · 0.85
stbi_is_16_bitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected