| 54 | } |
| 55 | |
| 56 | juce::Image getImage(const LayoutDescription::Resource& resource) |
| 57 | { |
| 58 | if (images_.find(resource.file) != images_.end()) { |
| 59 | return images_.at(resource.file); |
| 60 | } else { |
| 61 | auto path = directory.getChildFile(resource.file).getFullPathName(); |
| 62 | return images_[resource.file] = juce::ImageFileFormat::loadFrom(path); |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | private: |
| 67 | std::unordered_map<std::string, juce::Image> images_; |