MCPcopy Create free account
hub / github.com/axmolengine/axmol / initWithImageFileThreadSafe

Method initWithImageFileThreadSafe

core/platform/Image.cpp:667–682  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

665}
666
667bool Image::initWithImageFileThreadSafe(std::string_view fullpath)
668{
669 bool ret = false;
670 _filePath = fullpath;
671
672 Data data = FileUtils::getInstance()->getDataFromFile(_filePath);
673
674 if (!data.isNull())
675 {
676 ssize_t n = 0;
677 auto buf = data.takeBuffer(&n);
678 ret = initWithImageData(buf, n, true);
679 }
680
681 return ret;
682}
683
684bool Image::initWithImageData(const uint8_t* data, ssize_t dataLen)
685{

Callers 1

loadImageMethod · 0.80

Calls 4

getInstanceFunction · 0.85
getDataFromFileMethod · 0.80
isNullMethod · 0.80
takeBufferMethod · 0.80

Tested by

no test coverage detected