From 3bced067a4144381e59ce4bd0eb749eeff5ad1f4 Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 28 Mar 2019 08:56:15 +0800 Subject: *misc --- source/libs/asura-lib-core/graphics/image_data.h | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'source/libs/asura-lib-core/graphics/image_data.h') diff --git a/source/libs/asura-lib-core/graphics/image_data.h b/source/libs/asura-lib-core/graphics/image_data.h index 53a9e85..820e276 100644 --- a/source/libs/asura-lib-core/graphics/image_data.h +++ b/source/libs/asura-lib-core/graphics/image_data.h @@ -4,8 +4,9 @@ #include #include -#include -#include +#include +#include +#include #include "pixel_format.h" #include "color.h" @@ -18,17 +19,22 @@ namespace AsuraEngine class ImageDecoder; class ImageData ASURA_FINAL - : public Filesystem::DecodedData + : public AEIO::DecodedData , public Scripting::Portable { public: + LUAX_DECL_FACTORY(ImageData); + /// /// 解析图片数据文件,并构建像素信息,如果解析失败,抛出异常 /// - ImageData(const Filesystem::DataBuffer& buffer); + ImageData(const AEIO::DataBuffer& buffer); ~ImageData(); + void Load(const AEIO::DataBuffer& buffer); + void LoadAsync(const AEIO::DataBuffer& buffer, AEThreading::Thread* thread); + Color GetPixel(uint x, uint y); uint width, height; @@ -38,17 +44,13 @@ namespace AsuraEngine private: - void Decode(const Filesystem::DataBuffer& buffer) override; + void Decode(const AEIO::DataBuffer& buffer) override; /// /// 在第一次准备image data时构建所有提供的decoder。在几个decoders中间选择解析策略。 /// static std::list ImageDecoders; - public: - - LUAX_DECL_FACTORY(ImageData); - LUAX_DECL_METHOD(_New); LUAX_DECL_METHOD(_GetPixel); LUAX_DECL_METHOD(_GetSize); @@ -61,4 +63,6 @@ namespace AsuraEngine } } +namespace AEGraphics = AsuraEngine::Graphics; + #endif \ No newline at end of file -- cgit v1.1-26-g67d0