mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 03:28:20 +02:00
Res_WritePNG
This commit is contained in:
parent
c58f327136
commit
d1134ebfb8
1 changed files with 14 additions and 0 deletions
|
@ -165,4 +165,18 @@ BF_EXPORT StringView BF_CALLTYPE Res_JPEGCompress(uint32* bits, int width, int h
|
||||||
outString.Clear();
|
outString.Clear();
|
||||||
outString.Insert(0, (char*)jpegData.mSrcData, jpegData.mSrcDataLen);
|
outString.Insert(0, (char*)jpegData.mSrcData, jpegData.mSrcDataLen);
|
||||||
return outString;
|
return outString;
|
||||||
|
}
|
||||||
|
|
||||||
|
BF_EXPORT bool BF_CALLTYPE Res_WritePNG(uint32* bits, int width, int height, const char* filePath)
|
||||||
|
{
|
||||||
|
String& outString = *gResLib_TLStrReturn.Get();
|
||||||
|
PNGData pngData;
|
||||||
|
pngData.mBits = bits;
|
||||||
|
pngData.mWidth = width;
|
||||||
|
pngData.mHeight = height;
|
||||||
|
bool result = pngData.WriteToFile(filePath);
|
||||||
|
pngData.mBits = NULL;
|
||||||
|
outString.Clear();
|
||||||
|
outString.Insert(0, (char*)pngData.mSrcData, pngData.mSrcDataLen);
|
||||||
|
return result;
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue