Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/references/api/bindings/json.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ All of the [lua-rapidjson](https://github.com/xpol/lua-rapidjson/blob/master/API

Returns the embedded rapidjson library version as a Lua string. The lua-rapidjson (bindings) version can be queried via `_VERSION`.

<Function>
<Function since="v0.0.3">
<Returns>
<Return name="rapidjsonLibraryVersion" type="string"/>
</Returns>
Expand All @@ -32,7 +32,7 @@ Returns the embedded rapidjson library version as a Lua string. The lua-rapidjso

Parses the given input as a JSON string and returns a Lua table containing the equivalent data. Alias for `json.decode(...)`.

<Function>
<Function since="v0.0.3">
<Parameters>
<Parameter name="jsonString" type="string"/>
</Parameters>
Expand All @@ -45,7 +45,7 @@ Parses the given input as a JSON string and returns a Lua table containing the e

Converts the given input table to a JSON string containing the equivalent data. Alias for `json.encode(...)`.

<Function>
<Function since="v0.0.3">
<Parameters>
<Parameter name="luaTable" type="table"/>
</Parameters>
Expand All @@ -58,7 +58,7 @@ Converts the given input table to a JSON string containing the equivalent data.

Identical to `json.encode(...)`, but accepts both strings and tables. Returns a human-readable JSON string with indentation and key sorting enabled. Indentation uses four spaces (lua-rapidjson default). You probably don't want to use this for performance-critical code.

<Function>
<Function since="v0.0.3">
<Parameters>
<Parameter name="jsonStringOrTable"/>
</Parameters>
Expand All @@ -71,7 +71,7 @@ Identical to `json.encode(...)`, but accepts both strings and tables. Returns a

Identical to `json.pretty`, but uses tabs for indentation (instead of four spaces). This saves some space, but is still unsuitable for performance-critical code paths due to the overhead of sorting and possibly redundantly re-encoding the provided string value.

<Function>
<Function since="v0.0.3">
<Parameters>
<Parameter name="jsonStringOrTable"/>
</Parameters>
Expand Down
50 changes: 25 additions & 25 deletions docs/references/api/bindings/miniz.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Most of the time, you'll want to pass `"no"` or `"finish"` for asynchronous and

:::

<Function>
<Function since="v0.0.5">
<Parameters>
<Parameter name="self" type="Deflator"/>
<Parameter name="input" type="string"/>
Expand All @@ -73,7 +73,7 @@ Created by [new_inflator](#new_inflator). You can use this to decompress large a

Applies [INFLATE](https://en.wikipedia.org/wiki/Deflate#Decoder/decompressor) to the given (DEFLATE-compressed) `input` and returns the decompressed bytes as a Lua string.

<Function>
<Function since="v0.0.5">
<Parameters>
<Parameter name="self" type="Inflator"/>
<Parameter name="input" type="string"/>
Expand All @@ -91,7 +91,7 @@ Created by [new_reader](#new_reader) or [new_reader_memory](#new_reader_memory).

Extracts the file referenced by the given `fileTableIndex` and returns the file contents (or `""` on failure). The `flags` are passed to `miniz` directly. Since the extraction happens entirely in memory, this method may not be well-suited for extracting very large files.

<Function>
<Function since="v0.0.5">
<Parameters>
<Parameter name="self" type="ZipFileReader"/>
<Parameter name="fileTableIndex" type="number"/>
Expand All @@ -105,7 +105,7 @@ Extracts the file referenced by the given `fileTableIndex` and returns the file

Returns the file name referenced by the given `fileTableIndex`, or `nil` and an error message if the given index was invalid.

<Function>
<Function since="v0.0.5">
<Parameters>
<Parameter name="self" type="ZipFileReader"/>
<Parameter name="fileTableIndex" type="number"/>
Expand All @@ -120,7 +120,7 @@ Returns the file name referenced by the given `fileTableIndex`, or `nil` and an

Returns the total number of files within the ZIP archive. This is the maximum `fileTableIndex` that you can pass to other functions.

<Function>
<Function since="v0.0.5">
<Parameters>
<Parameter name="self" type="ZipFileReader"/>
</Parameters>
Expand All @@ -139,7 +139,7 @@ This offset is likely zero for normal archives, but the file format allows stori

:::

<Function>
<Function since="v0.0.5">
<Parameters>
<Parameter name="self" type="ZipFileReader"/>
</Parameters>
Expand All @@ -152,7 +152,7 @@ This offset is likely zero for normal archives, but the file format allows stori

Returns `true` if the entry referenced by the given `fileTableIndex` is a directory entry, and `false` otherwise.

<Function>
<Function since="v0.0.5">
<Parameters>
<Parameter name="self" type="ZipFileReader"/>
<Parameter name="fileTableIndex" type="number"/>
Expand All @@ -166,7 +166,7 @@ Returns `true` if the entry referenced by the given `fileTableIndex` is a direct

Searches the internal file system table of the given ZIP archive for an entry that matches `fileSystemPath` and returns the corresponding `fileTableIndex`, or `nil` and an error message if no match was found. It uses a simple linear search method that might have to iterate over the entire table, which is slow for very large files. The `flags` passed to `miniz` can control the way that the search is performed.

<Function>
<Function since="v0.0.5">
<Parameters>
<Parameter name="fileSystemPath" type="string"/>
<Parameter name="flags" type="number" optional/>
Expand All @@ -180,7 +180,7 @@ Searches the internal file system table of the given ZIP archive for an entry th

Returns a list of attributes for the entry referenced by the given `fileTableIndex`, or `nil` and an error message if the index was invalid.

<Function>
<Function since="v0.0.5">
<Parameters>
<Parameter name="self" type="ZipFileReader"/>
<Parameter name="fileTableIndex" type="number"/>
Expand Down Expand Up @@ -215,7 +215,7 @@ Created by [new_writer](#new_writer). You can use this to add files to a ZIP arc

Adds (in-memory) a new file entry referenced by `fileSystemPath` with the given `fileContents` to the archive. The `flags` passed to `miniz` control the compression level and settings for this specific entry; it's a bitfield with the level being stored in the lowest byte.

<Function>
<Function since="v0.0.5">
<Parameters>
<Parameter name="self" type="ZipFileWriter"/>
<Parameter name="fileSystemPath" type="string"/>
Expand All @@ -227,7 +227,7 @@ Adds (in-memory) a new file entry referenced by `fileSystemPath` with the given

Adds (in-memory) the contents of the entry referenced by the given `fileTableIndex` from another ZIP archive to the archive.

<Function>
<Function since="v0.0.5">
<Parameters>
<Parameter name="self" type="ZipFileWriter"/>
<Parameter name="reader" type="ZipFileReader"/>
Expand All @@ -245,7 +245,7 @@ Once the archive has been finalized, you can no longer add new entries to it. Yo

:::

<Function>
<Function since="v0.0.5">
<Parameters>
<Parameter name="self" type="ZipFileWriter"/>
</Parameters>
Expand All @@ -260,7 +260,7 @@ Once the archive has been finalized, you can no longer add new entries to it. Yo

Returns the [Adler-32](https://en.wikipedia.org/wiki/Adler-32) checksum for the given `input`. Supplying an `initialValue` allows processing multiple chunks as they arrive.

<Function>
<Function since="v0.0.5">
<Parameters>
<Parameter name="input" type="string"/>
<Parameter name="initialValue" type="string" optional/>
Expand All @@ -274,7 +274,7 @@ Returns the [Adler-32](https://en.wikipedia.org/wiki/Adler-32) checksum for the

Returns the [CRC-32](https://en.wikipedia.org/wiki/Cyclic_redundancy_check) checksum for the given `input`. Supplying an `initialValue` allows processing multiple chunks as they arrive.

<Function>
<Function since="v0.0.5">
<Parameters>
<Parameter name="input" type="string"/>
<Parameter name="initialValue" type="string" optional/>
Expand All @@ -300,7 +300,7 @@ While you don't need to worry about buffer allocation with either of these, the

:::

<Function>
<Function since="v0.0.5">
<Parameters>
<Parameter name="input" type="string"/>
<Parameter name="compressionLevel" type="number" optional/>
Expand All @@ -316,7 +316,7 @@ Applies [DEFLATE](https://en.wikipedia.org/wiki/Deflate) to the given `input` an

The `flags` passed to `miniz` control the behavior of the compressor.

<Function>
<Function since="v0.0.5">
<Parameters>
<Parameter name="input" type="string"/>
<Parameter name="flags" type="number" optional/>
Expand All @@ -332,7 +332,7 @@ Applies [INFLATE](https://en.wikipedia.org/wiki/Deflate#Decoder/decompressor) to

The `flags` passed to `miniz` control the behavior of the decompressor.

<Function>
<Function since="v0.0.5">
<Parameters>
<Parameter name="input" type="string"/>
<Parameter name="flags" type="number" optional/>
Expand All @@ -346,7 +346,7 @@ The `flags` passed to `miniz` control the behavior of the decompressor.

Returns the last compression or decompression error (as a human-readable string) if any was encountered, or `nil` otherwise.

<Function>
<Function since="v0.0.5">
<Returns>
<Return name="errorString" type="string" optional/>
</Returns>
Expand All @@ -356,7 +356,7 @@ Returns the last compression or decompression error (as a human-readable string)

Creates a new [Deflator](#deflator) object and returns a `userdata` reference to it. If you set `compressionLevel`, it must be a valid value (0 to 9).

<Function>
<Function since="v0.0.5">
<Parameters>
<Parameter name="compressionLevel" type="number" optional/>
</Parameters>
Expand All @@ -369,7 +369,7 @@ Creates a new [Deflator](#deflator) object and returns a `userdata` reference to

Creates a new [Inflator](#inflator) object and returns a `userdata` reference to it.

<Function>
<Function since="v0.0.5">
<Returns>
<Return name="inflator" type="Inflator"/>
</Returns>
Expand All @@ -385,7 +385,7 @@ This function is suitable if loading the entire file into memory is acceptable.

Returns `nil` and an error message in case of failure. Otherwise the ZIP [reader](#ZipFileReader) should be ready to use.

<Function>
<Function since="v0.0.5">
<Parameters>
<Parameter name="fileSystemPath" type="string"/>
<Parameter name="flags" type="number" optional/>
Expand All @@ -406,7 +406,7 @@ This function is suitable if loading the entire file into memory is acceptable.

Returns `nil` and an error message in case of failure. Otherwise the ZIP [reader](#ZipFileReader) should be ready to use.

<Function>
<Function since="v0.0.20">
<Parameters>
<Parameter name="fileContents" type="string"/>
<Parameter name="flags" type="number" optional/>
Expand All @@ -421,7 +421,7 @@ Returns `nil` and an error message in case of failure. Otherwise the ZIP [reader

Creates a new ZIP file writer for the given `fileSystemPath`. The `flags` passed to `miniz` can control the way that the archive is written.

<Function>
<Function since="v0.0.5">
<Parameters>
<Parameter name="fileSystemPath" type="string"/>
<Parameter name="flags" type="number" optional/>
Expand Down Expand Up @@ -449,7 +449,7 @@ While you don't need to worry about buffer allocation with either of these, the

:::

<Function>
<Function since="v0.0.5">
<Parameters>
<Parameter name="input" type="string"/>
<Parameter name="initialOutputBufferSize" type="number" optional/>
Expand All @@ -463,7 +463,7 @@ While you don't need to worry about buffer allocation with either of these, the

Returns the version number of the embedded `miniz` library as a Lua string.

<Function>
<Function since="v0.0.5">
<Returns>
<Return name="version" type="string"/>
</Returns>
Expand Down
5 changes: 4 additions & 1 deletion docs/references/api/bindings/stbi.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Replaces all pixels using the RGBA values from `sourceColor` with those from `re

The pixel format used by the given `image` is expected to be in RGBA format; use [stbi_load_rgba](#stbi_load_rgba) to ensure this is always the case.

<Function>
<Function since="v0.0.19">
<Parameters>
<Parameter name="image" type="stbi_image_t"/>
<Parameter name="sourceColor" type="stbi_color_t"/>
Expand Down Expand Up @@ -76,6 +76,8 @@ Converts the pixel format of an `image` from ABGR to RGBA (and vice versa), by s
void stbi_abgr_to_rgba(stbi_image_t* image)
```

<Function since="v0.0.10"/>

### stbi_flip_vertically_on_write

Globally toggles the vertical direction that is used when encoding images. A non-zero flag means that the pixel data is inverted.
Expand Down Expand Up @@ -252,6 +254,7 @@ const char* stbi_version(void);

| Version | What happened? |
| :-----: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| v0.0.19 | Added `replace_pixel_color_rgba` |
| v0.0.10 | Added `stbi_abgr_to_rgba` |
| v0.0.9 | Removed `stbi_max_bitmap_size` in favor of `stbi_get_required_bmp_size`, `stbi_get_required_png_size`, `stbi_get_required_jpg_size`, and `stbi_get_required_tga_size` |
| v0.0.7 | Added `stbi_flip_vertically_on_write` |
Expand Down
10 changes: 5 additions & 5 deletions docs/references/api/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ debug.dump({ 1, 2, 3 })

Prints a human-readable string representation of the given object. Mostly useful for dumping tables, but unsuitable for serialization purposes. The output format cannot be considered stable. Currently uses [inspect](/docs/references/api/bindings/inspect) internally, though this may change in the future.

<Function>
<Function since="v0.0.1">
<Parameters>
<Parameter name="object"/>
</Parameters>
Expand All @@ -39,7 +39,7 @@ Prints a human-readable string representation of the given object. Mostly useful

Returns a string representing the difference between `firstValue` and `secondValue`. The exact format is subject to change.

<Function>
<Function since="v0.0.1">
<Parameters>
<Parameter name="firstValue" type="string"/>
<Parameter name="firstValue" type="string"/>
Expand All @@ -53,7 +53,7 @@ Returns a string representing the difference between `firstValue` and `secondVal

Tokenizes the given `inputString` based on a configurable `delimiter` character, which is stripped from the output.

<Function>
<Function since="v0.0.1">
<Parameters>
<Parameter name="inputString" type="string"/>
<Parameter name="delimiter" type="string" optional fallback="'%s' (whitespace)"/>
Expand All @@ -67,7 +67,7 @@ Tokenizes the given `inputString` based on a configurable `delimiter` character,

Returns a human-readable representation of the given `fileSizeInBytes` using standard units. The exact format is subject to change.

<Function>
<Function since="v0.0.2">
<Parameters>
<Parameter name="fileSizeInBytes" type="number"/>
</Parameters>
Expand All @@ -82,7 +82,7 @@ Returns a human-readable representation of the given `fileSizeInBytes` using sta

Returns `true` if the given `table` contains `value` in the array part of the table, and `false` otherwise. The dictionary part is ignored.

<Function>
<Function since="v0.0.1">
<Parameters>
<Parameter name="table" type="table"/>
<Parameter name="value"/>
Expand Down
2 changes: 1 addition & 1 deletion docs/references/api/globals.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Alias for [debug.dump(...)](/docs/references/api/extensions#debugdump).

Sets up the metatable of `child` so that it acts as an instance of `parent` (in terms of [object-oriented programming](https://en.wikipedia.org/wiki/Object-oriented_programming)).

<Function>
<Function since="v0.0.1">
<Parameters>
<Parameter name="parent" type="table"/>
<Parameter name="child" type="table"/>
Expand Down
Loading