diff options
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); + + //---------------------------------------------------------------------------------------------------------- + }; } |