diff options
Diffstat (limited to 'source/modules/asura-core/graphics/image_data.cpp')
-rw-r--r-- | source/modules/asura-core/graphics/image_data.cpp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/source/modules/asura-core/graphics/image_data.cpp b/source/modules/asura-core/graphics/image_data.cpp index b79dfab..64f83a8 100644 --- a/source/modules/asura-core/graphics/image_data.cpp +++ b/source/modules/asura-core/graphics/image_data.cpp @@ -16,8 +16,12 @@ namespace AsuraEngine new STBDecoder() // jpeg, tga, bmp }; - ImageData::ImageData(const IO::DataBuffer& buffer) - : DecodedData(buffer) + ImageData::ImageData() + : pixels(nullptr) + , size(0) + , width(0) + , height(0) + , format(COLOR_FORMAT_UNKNOWN) { } @@ -27,10 +31,12 @@ namespace AsuraEngine delete[] pixels; } - /// - /// ɹ׳쳣 - /// - void ImageData::Decode(const IO::DataBuffer& buffer) + ImageData::operator bool() + { + return size > 0; + } + + void ImageData::Decode(IO::DataBuffer& buffer) { for (ImageDecoder* decoder : ImageDecoders) { @@ -46,6 +52,16 @@ namespace AsuraEngine { } + + void ImageData::Lock() + { + mMutex.Lock(); + } + + void ImageData::Unlock() + { + mMutex.Unlock(); + } } }
\ No newline at end of file |