~aleteoryx/muditaos

ref: sign_test muditaos/module-gui/gui/core/ImageMap.hpp -rw-r--r-- 1.8 KiB
a217eeb3 — Dawid Wojtas [BH-2024] Fix lack of alarm directory after updating software 1 year, 5 months 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#ifndef MODULE_GUI_GUI_CORE_IMAGEMAP_HPP_
#define MODULE_GUI_GUI_CORE_IMAGEMAP_HPP_

#include <cstdint>
#include <string>
#include "../Common.hpp"

namespace gui
{

    /*
     *
     */
    class ImageMap
    {
      public:
        enum class Type
        {
            NONE,
            PIXMAP,
            VECMAP
        };

      protected:
        // id of the pixmap asigned by the pixmap manager
        uint32_t id;
        // number of columns in the pixmap
        uint16_t width;
        // number of rows in the image
        uint16_t height;
        // data of the image
        uint8_t *data = nullptr;
        // file name
        std::string name;
        // type of the image
        Type type = Type::NONE;

      public:
        ImageMap();
        ImageMap(uint16_t w, uint16_t h, uint8_t *data);
        virtual ~ImageMap();

        Type getType()
        {
            return type;
        };
        uint16_t getWidth()
        {
            return width;
        };
        uint16_t getHeight()
        {
            return height;
        };
        uint8_t *getData()
        {
            return data;
        };
        std::string getName()
        {
            return name;
        };
        uint32_t getID()
        {
            return id;
        };

        void setID(uint32_t id)
        {
            this->id = id;
        };
        void setName(std::string name)
        {
            this->name = name;
        };

        virtual gui::Status load(uint8_t *data, uint32_t size = 0)
        {
            return gui::Status::GUI_SUCCESS;
        };
    };

} /* namespace gui */

#endif /* MODULE_GUI_GUI_CORE_IMAGEMAP_HPP_ */