Utility/Image: Add saver (allowing to save images)

Former-commit-id: df78d657256f8a6b7dad5ab11877aae7402608b3
This commit is contained in:
Lynix
2016-03-08 13:11:09 +01:00
parent 6f9d778749
commit d6ff7d065e
9 changed files with 413 additions and 10 deletions

View File

@@ -825,6 +825,30 @@ namespace Nz
return Update(image, Rectui(0, 0, faceSize, faceSize), face);
}
bool Texture::SaveToFile(const String& filePath, const ImageParams& params)
{
Image image;
if (!Download(&image))
{
NazaraError("Failed to download texture");
return false;
}
return image.SaveToFile(filePath, params);
}
bool Texture::SaveToStream(Stream& stream, const String& format, const ImageParams& params)
{
Image image;
if (!Download(&image))
{
NazaraError("Failed to download texture");
return false;
}
return image.SaveToStream(stream, format, params);
}
bool Texture::SetMipmapRange(UInt8 minLevel, UInt8 maxLevel)
{
#if NAZARA_RENDERER_SAFE