mirror of
https://github.com/love2d/love.git
synced 2026-08-17 19:23:38 +02:00
Added love.math.compress(data, format [, level]) and love.math.decompress(compresseddata) / love.math.decompress(compressedstring, format).
Renamed the love.image CompressedData type to CompressedImageData. love.math.compress returns a love.math CompressedData object which holds the newly compressed data. Currently supported formats are "lz4" and "zlib". Note that the formats are not file formats and don't compress filesystem hierarchies.
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
|
||||
// LOVE
|
||||
#include "filesystem/FileData.h"
|
||||
#include "image/CompressedData.h"
|
||||
#include "image/CompressedImageData.h"
|
||||
#include "common/Object.h"
|
||||
|
||||
namespace love
|
||||
@@ -34,7 +34,7 @@ namespace magpie
|
||||
{
|
||||
|
||||
/**
|
||||
* Base class for all CompressedData parser library interfaces.
|
||||
* Base class for all CompressedImageData parser library interfaces.
|
||||
* We inherit from love::Object to take advantage of reference counting...
|
||||
**/
|
||||
class CompressedFormatHandler : public love::Object
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
virtual ~CompressedFormatHandler() {}
|
||||
|
||||
/**
|
||||
* Determines whether a particular FileData can be parsed as CompressedData
|
||||
* Determines whether a particular FileData can be parsed as CompressedImageData
|
||||
* by this handler.
|
||||
* @param data The data to parse.
|
||||
**/
|
||||
@@ -64,8 +64,8 @@ public:
|
||||
*
|
||||
* @return The single block of memory containing the parsed images.
|
||||
**/
|
||||
virtual uint8 *parse(filesystem::FileData *filedata, std::vector<CompressedData::SubImage> &images,
|
||||
size_t &dataSize, CompressedData::Format &format, bool &sRGB) = 0;
|
||||
virtual uint8 *parse(filesystem::FileData *filedata, std::vector<CompressedImageData::SubImage> &images,
|
||||
size_t &dataSize, CompressedImageData::Format &format, bool &sRGB) = 0;
|
||||
|
||||
}; // CompressedFormatHandler
|
||||
|
||||
|
||||
Reference in New Issue
Block a user