summaryrefslogtreecommitdiff
path: root/Source/Asura/Graphics/Image.h
blob: 34a83ce5dce043b54d379e101a8cc7c5b48f5f58 (plain)
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
#ifndef __AE_IMAGE_H__
#define __AE_IMAGE_H__

#include "Math/Vector2.h"
#include "Manager.hpp"
#include "Object.h"

namespace AsuraEngine
{
    namespace Graphics
    {

        ///
        /// ImageͼƬڴ󣬶ȡϷ󱣴ĽһImageڴ桢ԴֻᱣһݣҪ
        /// imageêλãźתǶȣʹspriteһֻࡣ
        ///
        class Image final : public Object
        {
        public:

            Math::Vector2 GetSize();
            uint GetWidth();
            uint GetHeight();

        private:

            ///
            /// СΪλ
            ///
            uint mWidth, mHeight;

        };

        class ImageManager : public Manager
        {
        public:

            uint GetImagePath(uint ID);

            uint GetImageID(const Containers::String& path);

            Image* GetImage(const Containers::String& path);

            Image* GetImage(const Containers::String& id);

            uint AddImage(const Containers::String& path, Image* image);

        private:

            ///
            /// еimage
            ///
            Containers::Map<uint, Image*> mImages;

            ///
            /// еimage·IDӳ
            ///
            Containers::StringMap<uint> mImageIDs;
                   
        };

    }
}

#endif