summaryrefslogtreecommitdiff
path: root/source/modules/asura-core/graphics/image_data.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-03-30 21:49:29 +0800
committerchai <chaifix@163.com>2019-03-30 21:49:29 +0800
commit8164adb15b76f537f8b6c78b9992786b61d61cc8 (patch)
tree6e42919e32258a3c495dcec54b0fda3e8e1977d8 /source/modules/asura-core/graphics/image_data.cpp
parentc270d033fa04873ee7a8925dbb00cae5edc4555c (diff)
*misc
Diffstat (limited to 'source/modules/asura-core/graphics/image_data.cpp')
-rw-r--r--source/modules/asura-core/graphics/image_data.cpp28
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