MCPcopy Create free account
hub / github.com/VCVRack/Rack / loadImage

Method loadImage

src/window/Window.cpp:803–820  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

801
802
803std::shared_ptr<Image> Window::loadImage(const std::string& filename) {
804 const auto& it = internal->imageCache.find(filename);
805 if (it != internal->imageCache.end())
806 return it->second;
807
808 // Load image
809 std::shared_ptr<Image> image;
810 try {
811 image = std::make_shared<Image>();
812 image->loadFile(filename, vg);
813 }
814 catch (Exception& e) {
815 WARN("%s", e.what());
816 image = NULL;
817 }
818 internal->imageCache[filename] = image;
819 return image;
820}
821
822
823bool& Window::fbDirtyOnSubpixelChange() {

Callers 1

loadMethod · 0.80

Calls 2

whatMethod · 0.80
loadFileMethod · 0.45

Tested by

no test coverage detected