Difference between revisions of "love.math.compress"
Line 1: | Line 1: | ||
− | {{newin | + | {{newin|[[0.10.0]]|100|type=function}} |
− | {{deprecatedin | + | {{deprecatedin|[[11.0]]|110|type=function|text=This function is deprecated and is replaced by [[love.data.compress]]}} |
− | + | Compresses a string or data using a specific compression algorithm. | |
− | {{notice| | + | {{notice|This function, depending on the compression format and level, can be slow if called repeatedly, such as from [[love.update]] or [[love.draw]]. Some benchmarks are available [https://github.com/Cyan4973/lz4#user-content-benchmarks here].}} |
− | == | + | == Function == |
− | === | + | === Synopsis === |
<source lang="lua"> | <source lang="lua"> | ||
compressedData = love.math.compress( rawstring, format, level ) | compressedData = love.math.compress( rawstring, format, level ) | ||
</source> | </source> | ||
− | === | + | === Arguments === |
− | {{param | + | {{param|string|rawstring|The raw (un-compressed) string to compress.}} |
− | {{param | + | {{param|CompressedDataFormat|format ("lz4")|The format to use when compressing the string.}} |
− | {{param | + | {{param|number|level (-1)|The level of compression to use, between 0 and 9. -1 indicates the default level. The meaning of this argument depends on the compression format being used.}} |
− | === | + | === Returns === |
− | {{param | + | {{param|CompressedData|compressedData|A new Data object containing the compressed version of the string.}} |
− | == | + | == Function == |
− | === | + | === Synopsis === |
<source lang="lua"> | <source lang="lua"> | ||
compressedData = love.math.compress( data, format, level ) | compressedData = love.math.compress( data, format, level ) | ||
</source> | </source> | ||
− | === | + | === Arguments === |
− | {{param | + | {{param|Data|data|A Data object containing the raw (un-compressed) data to compress.}} |
− | {{param | + | {{param|CompressedDataFormat|format ("lz4")|The format to use when compressing the data.}} |
− | {{param | + | {{param|number|level (-1)|The level of compression to use, between 0 and 9. -1 indicates the default level. The meaning of this argument depends on the compression format being used.}} |
− | === | + | === Returns === |
− | {{param | + | {{param|CompressedData|compressedData|A new Data object containing the compressed version of the raw data.}} |
− | == | + | == See Also == |
− | * [[parent:: | + | * [[parent::love.math]] |
− | * [[love.math. | + | * [[love.math.decompress]] |
− | * [[Constructs:: | + | * [[Constructs::CompressedData]] |
[[Category:Functions]] | [[Category:Functions]] | ||
− | {{#set:Description= | + | {{#set:Description=Compresses a string or data using a specific compression algorithm.}} |
− | == | + | == Other Languages == |
{{i18n|love.math.compress}} | {{i18n|love.math.compress}} |
Latest revision as of 14:33, 25 February 2020
Available since LÖVE 0.10.0 |
This function is not supported in earlier versions. |
Deprecated in LÖVE 11.0 |
This function is deprecated and is replaced by love.data.compress. |
Compresses a string or data using a specific compression algorithm.
This function, depending on the compression format and level, can be slow if called repeatedly, such as from love.update or love.draw. Some benchmarks are available here. |
Contents
Function
Synopsis
compressedData = love.math.compress( rawstring, format, level )
Arguments
string rawstring
- The raw (un-compressed) string to compress.
CompressedDataFormat format ("lz4")
- The format to use when compressing the string.
number level (-1)
- The level of compression to use, between 0 and 9. -1 indicates the default level. The meaning of this argument depends on the compression format being used.
Returns
CompressedData compressedData
- A new Data object containing the compressed version of the string.
Function
Synopsis
compressedData = love.math.compress( data, format, level )
Arguments
Data data
- A Data object containing the raw (un-compressed) data to compress.
CompressedDataFormat format ("lz4")
- The format to use when compressing the data.
number level (-1)
- The level of compression to use, between 0 and 9. -1 indicates the default level. The meaning of this argument depends on the compression format being used.
Returns
CompressedData compressedData
- A new Data object containing the compressed version of the raw data.
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info