From 8164adb15b76f537f8b6c78b9992786b61d61cc8 Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 30 Mar 2019 21:49:29 +0800 Subject: *misc --- source/modules/asura-core/graphics/image.h | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'source/modules/asura-core/graphics/image.h') diff --git a/source/modules/asura-core/graphics/image.h b/source/modules/asura-core/graphics/image.h index 29fd97c..377e002 100644 --- a/source/modules/asura-core/graphics/image.h +++ b/source/modules/asura-core/graphics/image.h @@ -27,9 +27,9 @@ namespace AsuraEngine /// 是一个只读类。主要是考虑到editor和engine使用不同的封装。 /// class Image ASURA_FINAL - : public Drawable + : public Texture , public Scripting::Portable - , public AEIO::Reloadable + , public AEIO::Renewable { public: @@ -40,19 +40,17 @@ namespace AsuraEngine ~Image(); /// - /// 从数据buffer构建image像素信息,如果mPixels不为空,先清空数据。用来重新构建image, - /// 使用glTexImage2D重新提交image的像素数据。 + /// 将解析后的图像数据提交到GPU,更新像素信息。用来重新构建image,使用glTexImage2D重 + /// 新提交image的像素数据。 /// - bool Load(ImageData* data); + bool Refresh(AEIO::DecodedData* decodeData) override; + bool Refresh(AEIO::DecodedData* decodeData, const AEMath::Recti& rect); - uint GetWidth(); - uint GetHeight(); - Math::Vector2u GetSize(); - /// - /// 获得某一个位置的像素 - /// - Color32 GetPixel(uint x, uint y); + uint GetWidth(); + uint GetHeight(); + Math::Vector2u GetSize(); + Color32 GetPixel(uint x, uint y); void Render(const RenderTarget* rt, const RenderState& state) override; @@ -60,13 +58,14 @@ namespace AsuraEngine private: + /// + /// 一张图片保存一个像素数据的引用。 + /// ImageData* mImageData; Luax::LuaxMemberRef mImageDataRef; - Math::Vector2u mSize; - LUAX_DECL_METHOD(_New); - LUAX_DECL_METHOD(_Load); + LUAX_DECL_METHOD(_Refresh); LUAX_DECL_METHOD(_GetWidth); LUAX_DECL_METHOD(_GetHeight); LUAX_DECL_METHOD(_GetSize); -- cgit v1.1-26-g67d0