diff options
author | chai <chaifix@163.com> | 2019-03-12 00:39:26 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-03-12 00:39:26 +0800 |
commit | 70b82d1981c0de3c7b77670ff8abcfeb26815142 (patch) | |
tree | f69c05bcd204cc3f9bf745be37a2ba5911e52436 /Source/Asura.Engine/Graphics/ImageData.h | |
parent | c19a282e10f51ddd50d198b903f8fbd5a2238b62 (diff) |
*misc
Diffstat (limited to 'Source/Asura.Engine/Graphics/ImageData.h')
-rw-r--r-- | Source/Asura.Engine/Graphics/ImageData.h | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/Source/Asura.Engine/Graphics/ImageData.h b/Source/Asura.Engine/Graphics/ImageData.h index 925a5a0..931eaa3 100644 --- a/Source/Asura.Engine/Graphics/ImageData.h +++ b/Source/Asura.Engine/Graphics/ImageData.h @@ -13,43 +13,47 @@ namespace AsuraEngine { namespace Graphics { - - class ImageData final : public Filesystem::DecodedData, public Scripting::Portable + + class ImageData ASURA_FINAL + : public Filesystem::DecodedData + , public Scripting::Portable { public: /// /// ͼƬļϢʧܣ׳쳣 /// - ImageData(const Filesystem::DataBuffer* buffer); + ImageData(const Filesystem::DataBuffer& buffer); + ~ImageData(); Color GetPixel(uint x, uint y); - uint width, height; + uint width, height; PixelFormat format; std::size_t size; byte* pixels; - //---------------------------------------------------------------------------------------------------------- - - LUAX_DECL_FACTORY(ImageData); - - LUAX_DECL_METHOD(l_GetPixel); - LUAX_DECL_METHOD(l_GetSize); - - //---------------------------------------------------------------------------------------------------------- - private: - // stbJPEGTGABMP,lodePNGpngͼƬ - void Decode(const Filesystem::DataBuffer* buffer) override; + void Decode(const Filesystem::DataBuffer& buffer) override; /// /// ڵһimage dataʱṩdecoderڼdecodersмѡԡ /// static std::list<ImageDecoder*> ImageDecoders; + public: + + //---------------------------------------------------------------------------------------------------------- + + LUAX_DECL_FACTORY(ImageData); + + LUAX_DECL_METHOD(l_GetPixel); + LUAX_DECL_METHOD(l_GetSize); + + //---------------------------------------------------------------------------------------------------------- + }; } |