~aleteoryx/muditaos

ref: e6213e94077379e7d1ae6908dc2a6769fa406ccb muditaos/module-gui/gui/core/ImageManager.hpp -rw-r--r-- 1.2 KiB
e6213e94 — Lucjan Bryndza [EGD-5737] Merge master into experimental 5 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

/*
 * ImageManager.hpp
 *
 *  Created on: 18 maj 2019
 *      Author: robert
 */

#ifndef GUI_CORE_PIXMAPMANAGER_HPP_
#define GUI_CORE_PIXMAPMANAGER_HPP_

#include <vector>
#include <string>
#include <cstdint>
#include <cstring>

#include "ImageMap.hpp"

namespace gui
{

    class ImageManager
    {
      protected:
        std::string mapFolder;
        std::vector<ImageMap *> imageMaps;

        std::vector<std::string> getImageMapList(std::string ext);

        ImageMap *loadPixMap(std::string filename);
        ImageMap *loadVecMap(std::string filename);
        void loadImageMaps(std::string baseDirectory);

        ImageManager();

      public:
        ImageManager(const ImageManager &) = delete;
        void operator=(const ImageManager &) = delete;

        bool init(std::string baseDirectory);
        static ImageManager &getInstance();

        virtual ~ImageManager();

        ImageMap *getImageMap(uint32_t id);
        uint32_t getImageMapID(const std::string &name);
        void clear();
    };

} /* namespace gui */

#endif /* GUI_CORE_PIXMAPMANAGER_HPP_ */