From bad78945ceba425f6a80e3b8dca2414d592970eb Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 2 Aug 2019 20:51:00 +0800 Subject: =?UTF-8?q?*=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6=E5=90=8D=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/modules/asura-core/image/image_data.cpp | 62 -------------------------- 1 file changed, 62 deletions(-) delete mode 100644 source/modules/asura-core/image/image_data.cpp (limited to 'source/modules/asura-core/image/image_data.cpp') diff --git a/source/modules/asura-core/image/image_data.cpp b/source/modules/asura-core/image/image_data.cpp deleted file mode 100644 index 1de70cd..0000000 --- a/source/modules/asura-core/image/image_data.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include "image_data.h" -#include "png_decoder.h" -#include "stb_decoder.h" -#include "image_decoder.h" - -using namespace std; - -using namespace AEGraphics; - -namespace_begin(AsuraEngine) -namespace_begin(Image) - -// 解析image的decoder,用来作为解析策略。 -list ImageData::ImageDecoders = { - new PNGDecoder(), // png - new STBDecoder() // jpeg, tga, bmp -}; - -ImageData::ImageData() - : pixels(nullptr) - , size(0) - , width(0) - , height(0) - , format(COLOR_FORMAT_UNKNOWN) -{ -} - -ImageData::~ImageData() -{ - if (pixels) - delete[] pixels; -} - -void ImageData::Decode(IO::DataBuffer& buffer) -{ - for (ImageDecoder* decoder : ImageDecoders) - { - if (decoder->CanDecode(buffer)) - { - decoder->Decode(buffer, *this); - return; - } - } -} - -Color ImageData::GetPixel(uint x, uint y) -{ - return Color(); -} - -void ImageData::Lock() -{ - m_Mutex.Lock(); -} - -void ImageData::Unlock() -{ - m_Mutex.Unlock(); -} - -namespace_end -namespace_end \ No newline at end of file -- cgit v1.1-26-g67d0