mirror of
https://github.com/love2d/love.git
synced 2026-08-14 01:20:56 +02:00
ImageData:encode now supports saving exr image files.
Also add support for loading uint exr image files, and fix a memory leak in the exr loading code. Resolves #1813.
This commit is contained in:
@@ -206,12 +206,12 @@ love::filesystem::FileData *ImageData::encode(FormatHandler::EncodedFormat encod
|
||||
}
|
||||
catch (love::Exception &)
|
||||
{
|
||||
encoder->freeRawPixels(encodedimage.data);
|
||||
encoder->freeEncodedImage(encodedimage.data);
|
||||
throw;
|
||||
}
|
||||
|
||||
memcpy(filedata->getData(), encodedimage.data, encodedimage.size);
|
||||
encoder->freeRawPixels(encodedimage.data);
|
||||
encoder->freeEncodedImage(encodedimage.data);
|
||||
|
||||
if (writefile)
|
||||
{
|
||||
@@ -859,6 +859,7 @@ StringMap<FormatHandler::EncodedFormat, FormatHandler::ENCODED_MAX_ENUM>::Entry
|
||||
{
|
||||
{"tga", FormatHandler::ENCODED_TGA},
|
||||
{"png", FormatHandler::ENCODED_PNG},
|
||||
{"exr", FormatHandler::ENCODED_EXR},
|
||||
};
|
||||
|
||||
StringMap<FormatHandler::EncodedFormat, FormatHandler::ENCODED_MAX_ENUM> ImageData::encodedFormats(ImageData::encodedFormatEntries, sizeof(ImageData::encodedFormatEntries));
|
||||
|
||||
Reference in New Issue
Block a user