diff options
author | chai <chaifix@163.com> | 2019-03-30 21:49:29 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-03-30 21:49:29 +0800 |
commit | 8164adb15b76f537f8b6c78b9992786b61d61cc8 (patch) | |
tree | 6e42919e32258a3c495dcec54b0fda3e8e1977d8 /source/modules/asura-core/graphics/image_data.h | |
parent | c270d033fa04873ee7a8925dbb00cae5edc4555c (diff) |
*misc
Diffstat (limited to 'source/modules/asura-core/graphics/image_data.h')
-rw-r--r-- | source/modules/asura-core/graphics/image_data.h | 45 |
1 files changed, 31 insertions, 14 deletions
diff --git a/source/modules/asura-core/graphics/image_data.h b/source/modules/asura-core/graphics/image_data.h index ea1d53a..b9d656c 100644 --- a/source/modules/asura-core/graphics/image_data.h +++ b/source/modules/asura-core/graphics/image_data.h @@ -7,8 +7,9 @@ #include <asura-utils/io/decoded_data.h> #include <asura-utils/io/data_buffer.h> #include <asura-utils/threading/thread.h> +#include <asura-utils/threading/mutex.h> -#include "pixel_format.h" +#include "texture.h" #include "color.h" namespace AsuraEngine @@ -29,27 +30,28 @@ namespace AsuraEngine /// /// ͼƬļϢʧܣ׳쳣 /// - ImageData(const AEIO::DataBuffer& buffer); + ImageData(); ~ImageData(); - void Load(const AEIO::DataBuffer& buffer); - void LoadAsync(const AEIO::DataBuffer& buffer, AEThreading::Thread* thread); + void Decode(AEIO::DataBuffer& buffer) override; + + void Lock(); + void Unlock(); Color GetPixel(uint x, uint y); - uint width, height; - PixelFormat format; - std::size_t size; - byte* pixels; + //----------------------------------------------------------------------------// - private: + uint width, height; // سߴ + ColorFormat format; // ʽ + byte* pixels; // + std::size_t size; // ݳ - void Decode(const AEIO::DataBuffer& buffer) override; + //----------------------------------------------------------------------------// - /// - /// ڵһimage dataʱṩdecoderڼdecodersмѡԡ - /// - static std::list<ImageDecoder*> ImageDecoders; + private: + + //----------------------------------------------------------------------------// LUAX_DECL_METHOD(_New); LUAX_DECL_METHOD(_GetPixel); @@ -57,6 +59,21 @@ namespace AsuraEngine LUAX_DECL_METHOD(_GetWidth); LUAX_DECL_METHOD(_GetHeight); LUAX_DECL_METHOD(_GetPixelFormat); + LUAX_DECL_METHOD(_Decode); + LUAX_DECL_METHOD(_DecodeAsync); + LUAX_DECL_METHOD(_IsAvailable); + + //----------------------------------------------------------------------------// + + /// + /// ڵһimage dataʱṩdecoderڼdecodersмѡԡ + /// + static std::list<ImageDecoder*> ImageDecoders; + + /// + /// дݵ + /// + AEThreading::Mutex mMutex; }; |