![]() |
naev 0.12.5
|
Handles datas. More...
#include "nlua_data.h"#include "nluadef.h"
Go to the source code of this file.
Macros | |
| #define | POS(U, V, W) |
Functions | |
| static size_t | dataL_checkpos (lua_State *L, const LuaData_t *ld, long pos) |
| static int | dataL_gc (lua_State *L) |
| Frees a data. | |
| static int | dataL_eq (lua_State *L) |
| Compares two datas to see if they are the same. | |
| static int | dataL_new (lua_State *L) |
| Opens a new data. | |
| static int | dataL_get (lua_State *L) |
| Gets the value of an element. | |
| static int | dataL_set (lua_State *L) |
| Sets the value of an element. | |
| static int | dataL_getSize (lua_State *L) |
| Gets the number of elements. | |
| static int | dataL_getString (lua_State *L) |
| Returns the data contents as a string. | |
| static int | dataL_paste (lua_State *L) |
| Writes the contents of "source" into "dest". | |
| static int | dataL_addWeighted (lua_State *L) |
| Returns alpha*A + beta*B + bias. | |
| static int | dataL_convolve2d (lua_State *L) |
| Does a convolution. You'd rather be writing shaders, right? | |
| int | nlua_loadData (nlua_env env) |
| Loads the data library. | |
| LuaData_t * | lua_todata (lua_State *L, int ind) |
| Lua bindings to interact with datas. | |
| LuaData_t * | luaL_checkdata (lua_State *L, int ind) |
| Gets data at index or raises error if there is no data at index. | |
| LuaData_t * | lua_pushdata (lua_State *L, LuaData_t data) |
| Pushes a data on the stack. | |
| int | lua_isdata (lua_State *L, int ind) |
| Checks to see if ind is a data. | |
Variables | |
| static const luaL_Reg | dataL_methods [] |
Handles datas.
Definition in file nlua_data.c.
| #define POS | ( | U, | |
| V, | |||
| W ) |
|
static |
Returns alpha*A + beta*B + bias.
Lua function parameter: Data A as above. Lua function parameter: Data B as above. Lua function parameter: number alpha as above. Lua function parameter: number beta as above. Lua function parameter: number bias as above. Lua return parameter: Data alpha*A + beta*B + bias.
| L | Lua State |
Lua function: addWeighted
Definition at line 321 of file nlua_data.c.
|
static |
Definition at line 184 of file nlua_data.c.
|
static |
Does a convolution. You'd rather be writing shaders, right?
Lua function parameter: Data I left-hand side of the convolution operator. Lua function parameter: number iw width of I. Lua function parameter: number ih height of I. Lua function parameter: Data K right-hand side of the convolution operator. Lua function parameter: number kw width of K. Lua function parameter: number kh height of K. Lua return parameter: (I*K, width, height)
| L | Lua State |
Lua function: convolve2d
Definition at line 372 of file nlua_data.c.
|
static |
Compares two datas to see if they are the same.
Lua function parameter: Data d1 Data 1 to compare. Lua function parameter: Data d2 Data 2 to compare. Lua return parameter: boolean true if both datas are the same.
| L | Lua State |
Lua function: __eq
Definition at line 147 of file nlua_data.c.
|
static |
Frees a data.
Lua function parameter: Data data Data to free.
| L | Lua State |
Lua function: __gc
Definition at line 132 of file nlua_data.c.
|
static |
Gets the value of an element.
Lua function parameter: Data data Data to index. Lua function parameter: number pos Element position. Lua return parameter: number The entry.
| L | Lua State |
Lua function: get
Definition at line 205 of file nlua_data.c.
|
static |
Gets the number of elements.
Lua function parameter: Data data ... Lua return parameter: number Data size.
| L | Lua State |
Lua function: getSize
Definition at line 250 of file nlua_data.c.
|
static |
Returns the data contents as a string.
Lua function parameter: Data data ... Lua return parameter: string The bytes inside.
| L | Lua State |
Lua function: getString
Definition at line 264 of file nlua_data.c.
|
static |
Opens a new data.
Lua function parameter: number size Size to allocate for data. Lua function parameter: string type Type of the data to create ("number") Lua return parameter: Data New data object.
| L | Lua State |
Lua function: new
Definition at line 168 of file nlua_data.c.
|
static |
Writes the contents of "source" into "dest".
Lua function parameter: Data dest Destination. Lua function parameter: Data source Source. Lua function parameter: number dx Offset from start of destination. Lua function parameter: number sx Offset from start of source. Lua function parameter: number sw Number of data elements to copy.
| L | Lua State |
Lua function: paste
Definition at line 281 of file nlua_data.c.
|
static |
Sets the value of an element.
Lua function parameter: Data data Data to index. Lua function parameter: number pos Element position. Lua function parameter: number value Value to set it to.
| L | Lua State |
Lua function: set
Definition at line 227 of file nlua_data.c.
| int lua_isdata | ( | lua_State * | L, |
| int | ind ) |
Checks to see if ind is a data.
| L | Lua state to check. |
| ind | Index position to check. |
Definition at line 110 of file nlua_data.c.
Pushes a data on the stack.
| L | Lua state to push data into. |
| data | Data to push. |
Definition at line 94 of file nlua_data.c.
| LuaData_t * lua_todata | ( | lua_State * | L, |
| int | ind ) |
Lua bindings to interact with datas.
Lua module: data
Gets data at index.
| L | Lua state to get data from. |
| ind | Index position to find the data. |
Definition at line 69 of file nlua_data.c.
| LuaData_t * luaL_checkdata | ( | lua_State * | L, |
| int | ind ) |
Gets data at index or raises error if there is no data at index.
| L | Lua state to get data from. |
| ind | Index position to find data. |
Definition at line 80 of file nlua_data.c.
| int nlua_loadData | ( | nlua_env | env | ) |
Loads the data library.
| env | Environment to load data library into. |
Definition at line 51 of file nlua_data.c.
|
static |
Data metatable methods.
Definition at line 32 of file nlua_data.c.