diff options
Diffstat (limited to 'source/modules/asura-core/image/image_data.h')
-rw-r--r-- | source/modules/asura-core/image/image_data.h | 94 |
1 files changed, 46 insertions, 48 deletions
diff --git a/source/modules/asura-core/image/image_data.h b/source/modules/asura-core/image/image_data.h index 8b4f04a..93e3448 100644 --- a/source/modules/asura-core/image/image_data.h +++ b/source/modules/asura-core/image/image_data.h @@ -12,71 +12,69 @@ #include "../graphics/texture.h" #include "../graphics/color.h" -namespace AsuraEngine -{ - namespace Image - { +namespace_begin(AsuraEngine) +namespace_begin(Image) - class ImageDecoder; +class ImageDecoder; - class ImageData ASURA_FINAL - : public Scripting::Portable<ImageData> - , public AEIO::DecodedData - { - public: +class ImageData ASURA_FINAL + : public Scripting::Portable<ImageData> + , public AEIO::DecodedData +{ +public: - /// - /// ͼƬļϢʧܣ׳쳣 - /// - ImageData(); - ~ImageData(); + /// + /// ͼƬļϢʧܣ׳쳣 + /// + ImageData(); + ~ImageData(); - void Decode(AEIO::DataBuffer& buffer) override; + void Decode(AEIO::DataBuffer& buffer) override; - void Lock(); - void Unlock(); + void Lock(); + void Unlock(); - AEGraphics::Color GetPixel(uint x, uint y); + AEGraphics::Color GetPixel(uint x, uint y); - //----------------------------------------------------------------------------// + //----------------------------------------------------------------------------// - uint width, height; // سߴ - AEGraphics::ColorFormat format; // ʽ - byte* pixels; // - std::size_t size; // ݳ + uint width, height; // سߴ + AEGraphics::ColorFormat format; // ʽ + byte* pixels; // + std::size_t size; // ݳ - //----------------------------------------------------------------------------// + //----------------------------------------------------------------------------// - private: +private: - /// - /// ڵһimage dataʱṩdecoderڼdecodersмѡԡ - /// - static std::list<ImageDecoder*> ImageDecoders; + /// + /// ڵһimage dataʱṩdecoderڼdecodersмѡԡ + /// + static std::list<ImageDecoder*> ImageDecoders; - /// - /// дݵ - /// - AEThreading::Mutex m_Mutex; + /// + /// дݵ + /// + AEThreading::Mutex m_Mutex; - luaxport: +luaxport: - LUAX_DECL_FACTORY(ImageData); + LUAX_DECL_FACTORY(ImageData); - LUAX_DECL_METHOD(_New); - LUAX_DECL_METHOD(_GetPixel); - LUAX_DECL_METHOD(_GetSize); - LUAX_DECL_METHOD(_GetWidth); - LUAX_DECL_METHOD(_GetHeight); - LUAX_DECL_METHOD(_GetPixelFormat); - LUAX_DECL_METHOD(_Decode); - LUAX_DECL_METHOD(_DecodeAsync); - LUAX_DECL_METHOD(_IsAvailable); + LUAX_DECL_METHOD(_New); + LUAX_DECL_METHOD(_GetPixel); + LUAX_DECL_METHOD(_GetSize); + LUAX_DECL_METHOD(_GetWidth); + LUAX_DECL_METHOD(_GetHeight); + LUAX_DECL_METHOD(_GetPixelFormat); + LUAX_DECL_METHOD(_Decode); + LUAX_DECL_METHOD(_DecodeAsync); + LUAX_DECL_METHOD(_IsAvailable); - }; +}; - } -} +namespace_end +namespace_end namespace AEImage = AsuraEngine::Image; |