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

Method saveToFile

core/2d/RenderTexture.cpp:419–440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

417}
418
419bool RenderTexture::saveToFile(std::string_view filename, bool isRGBA, SaveFileCallbackType callback)
420{
421 std::string basename(filename);
422 std::transform(basename.begin(), basename.end(), basename.begin(), ::tolower);
423
424 if (basename.find(".png") != std::string::npos)
425 {
426 return saveToFile(filename, Image::Format::PNG, isRGBA, std::move(callback));
427 }
428 else if (basename.find(".jpg") != std::string::npos)
429 {
430 if (isRGBA)
431 AXLOGD("RGBA is not supported for JPG format.");
432 return saveToFile(filename, Image::Format::JPG, false, std::move(callback));
433 }
434 else
435 {
436 AXLOGD("Only PNG and JPG format are supported now!");
437 }
438
439 return saveToFile(filename, Image::Format::JPG, false, std::move(callback));
440}
441
442bool RenderTexture::saveToFileAsNonPMA(std::string_view fileName,
443 Image::Format format,

Callers 1

onSaveToFileMethod · 0.45

Calls 11

transformFunction · 0.85
getInstanceFunction · 0.85
getRendererMethod · 0.80
nextCallbackCommandMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
findMethod · 0.45
appendMethod · 0.45
getWritablePathMethod · 0.45
initMethod · 0.45
addCommandMethod · 0.45

Tested by

no test coverage detected