1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

JPEG compression

This commit is contained in:
Brian Fiete 2021-04-12 17:23:18 -04:00
parent f51b195486
commit 4211c267a6
5 changed files with 174 additions and 2 deletions

View file

@ -100,6 +100,14 @@ ImageData* ImageData::Duplicate()
return copy;
}
bool ImageData::LoadFromMemory(void* ptr, int size)
{
SetSrcData((uint8*)ptr, size);
bool result = ReadData();
mSrcData = NULL;
return result;
}
bool ImageData::LoadFromFile(const StringImpl& path)
{
int size = 0;
@ -126,6 +134,7 @@ void ImageData::SetSrcData(uint8* data, int dataLen)
mSrcDataLen = dataLen;
}
void ImageData::PremultiplyAlpha()
{
if (mBits == NULL)