Naev

Module data

Lua bindings to interact with datas.

Functions

__eq (d1, d2) Compares two datas to see if they are the same.
__gc (data) Frees a data.
addWeighted (A, B, alpha, beta, bias) Returns alphaA + betaB + bias
convolve2d (I, iw, ih, K, kw, kh) Does a convolution.
get (data, pos) Gets the value of an element.
getSize (data) Gets the number of elements.
getString (data) Returns the data contents as a string.
new (size, type) Opens a new data.
paste (dest, source, dx, sx, sw) Writes the contents of "source" into "dest".
set (data, pos, value) Sets the value of an element.


Functions

__eq (d1, d2)
Compares two datas to see if they are the same.

Parameters:

  • d1 Data Data 1 to compare.
  • d2 Data Data 2 to compare.

Returns:

    boolean true if both datas are the same.
__gc (data)
Frees a data.

Parameters:

  • data Data Data to free.
addWeighted (A, B, alpha, beta, bias)
Returns alphaA + betaB + bias

Parameters:

  • A Data as above.
  • B Data as above.
  • alpha number as above.
  • beta number as above.
  • bias number as above.

Returns:

    Data alphaA + betaB + bias.
convolve2d (I, iw, ih, K, kw, kh)
Does a convolution. You'd rather be writing shaders, right?

Parameters:

  • I Data left-hand side of the convolution operator.
  • iw number width of I.
  • ih number height of I.
  • K Data right-hand side of the convolution operator.
  • kw number width of K.
  • kh number height of K.

Returns:

    (I*K, width, height)
get (data, pos)
Gets the value of an element.

Parameters:

  • data Data Data to index.
  • pos number Element position.

Returns:

    number The entry.
getSize (data)
Gets the number of elements.

Parameters:

  • data Data ...

Returns:

    number Data size.
getString (data)
Returns the data contents as a string.

Parameters:

  • data Data ...

Returns:

    string The bytes inside.
new (size, type)
Opens a new data.

Parameters:

  • size number Size to allocate for data.
  • type string Type of the data to create ("number")

Returns:

    Data New data object.
paste (dest, source, dx, sx, sw)
Writes the contents of "source" into "dest".

Parameters:

  • dest Data Destination.
  • source Data Source.
  • dx number Offset from start of destination.
  • sx number Offset from start of source.
  • sw number Number of data elements to copy.
set (data, pos, value)
Sets the value of an element.

Parameters:

  • data Data Data to index.
  • pos number Element position.
  • value number Value to set it to.
generated by LDoc 1.5.0 Last updated 2025-05-18 01:00:15