-
Notifications
You must be signed in to change notification settings - Fork 0
UtilsBuffer
Starlon edited this page Nov 30, 2011
·
1 revision
<tr>
<td class="name" nowrap><a href="#LibBuffer:AsList">LibBuffer:AsList</a> (list)</td>
<td class="summary">Return the buffer as a list </td>
</tr>
<tr>
<td class="name" nowrap><a href="#LibBuffer:AsString">LibBuffer:AsString</a> ()</td>
<td class="summary">Return the buffer as a concatenated string.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#LibBuffer:Clear">LibBuffer:Clear</a> ()</td>
<td class="summary">Clear this buffer </td>
</tr>
<tr>
<td class="name" nowrap><a href="#LibBuffer:Clone">LibBuffer:Clone</a> (name)</td>
<td class="summary">Make a copy of this buffer </td>
</tr>
<tr>
<td class="name" nowrap><a href="#LibBuffer:Copy">LibBuffer:Copy</a> (other)</td>
<td class="summary">Copy this buffer into another </td>
</tr>
<tr>
<td class="name" nowrap><a href="#LibBuffer:Del">LibBuffer:Del</a> (buff)</td>
<td class="summary">Delete this buffer </td>
</tr>
<tr>
<td class="name" nowrap><a href="#LibBuffer:Fill">LibBuffer:Fill</a> (val)</td>
<td class="summary">Fill a buffer with a value </td>
</tr>
<tr>
<td class="name" nowrap><a href="#LibBuffer:FromList">LibBuffer:FromList</a> (list)</td>
<td class="summary">Populate this buffer with the elements within the provided table </td>
</tr>
<tr>
<td class="name" nowrap><a href="#LibBuffer:FromString">LibBuffer:FromString</a> (str)</td>
<td class="summary">Populate each cell in the buffer with characters from the provided string </td>
</tr>
<tr>
<td class="name" nowrap><a href="#LibBuffer:Insert">LibBuffer:Insert</a> (i, val)</td>
<td class="summary">Insert a new value in the buffer at the indicated index </td>
</tr>
<tr>
<td class="name" nowrap><a href="#LibBuffer:Line">LibBuffer:Line</a> (x0, y0, x1, y1, color, pitch)</td>
<td class="summary">The various line algorithms were found on the internet at various places.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#LibBuffer:Memcopy">LibBuffer:Memcopy</a> (pos1, buffer, pos2, length)</td>
<td class="summary">Copy another buffer into this one </td>
</tr>
<tr>
<td class="name" nowrap><a href="#LibBuffer:Memset">LibBuffer:Memset</a> (pos, val, length)</td>
<td class="summary">Set a subsection of this buffer to the specified value </td>
</tr>
<tr>
<td class="name" nowrap><a href="#LibBuffer:Merge">LibBuffer:Merge</a> (from, pos, len)</td>
<td class="summary">Merge one buffer into this one </td>
</tr>
<tr>
<td class="name" nowrap><a href="#LibBuffer:MergeString">LibBuffer:MergeString</a> (pos1, str, pos2, length)</td>
<td class="summary">Merge a string into the buffer </td>
</tr>
<tr>
<td class="name" nowrap><a href="#LibBuffer:MovingAverageExp">LibBuffer:MovingAverageExp</a> (alpha, epsilon, buf)</td>
<td class="summary">Retrieve the moving averages for this buffer of number values </td>
</tr>
<tr>
<td class="name" nowrap><a href="#LibBuffer:New">LibBuffer:New</a> (name, size, defval, errorLevel)</td>
<td class="summary">Create a new LibScriptableBuffer object </td>
</tr>
<tr>
<td class="name" nowrap><a href="#LibBuffer:Randomize">LibBuffer:Randomize</a> ()</td>
<td class="summary">Randomize the buffer </td>
</tr>
<tr>
<td class="name" nowrap><a href="#LibBuffer:Replace">LibBuffer:Replace</a> (pos, val)</td>
<td class="summary">Replace a buffer position with a new value.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#LibBuffer:Resize">LibBuffer:Resize</a> (size)</td>
<td class="summary">Resize a buffer </td>
</tr>
<tr>
<td class="name" nowrap><a href="#LibBuffer:Size">LibBuffer:Size</a> ()</td>
<td class="summary">Return the size of this buffer </td>
</tr>
<tr>
<td class="name" nowrap><a href="#LibBuffer:Sub">LibBuffer:Sub</a> (num1, num2, buf, t)</td>
<td class="summary">Extract a subsection from this buffer </td>
</tr>
<tr>
<td class="name" nowrap><a href="#LibBuffer:Wipe">LibBuffer:Wipe</a> ()</td>
<td class="summary">Wipe a buffer, </td>
</tr>
- LibBuffer:AsList (list)
-
Return the buffer as a list
:AsString() All cells in the buffer populating a list
<li> list: </li> - LibBuffer:AsString ()
- Return the buffer as a concatenated string. :AsString() All cells in the buffer concatenated as a string
- LibBuffer:Clear ()
- Clear this buffer :Clear() Nothing
- LibBuffer:Clone (name)
-
Make a copy of this buffer
Clone([name]) A new LibBuffer populated with this buffer's data
<li> name: An optional name for the buffer, else this buffer's name is used </li> - LibBuffer:Copy (other)
-
Copy this buffer into another
:Copy(other) Nothing
<li> other: The other LibBuffer object to copy into </li> - LibBuffer:Del (buff)
-
Delete this buffer
buffer:Del()
<li> buff: </li> - LibBuffer:Fill (val)
-
Fill a buffer with a value
:Fill(val) Nothing
<li> val: The value to fill the buffer with </li> - LibBuffer:FromList (list)
-
Populate this buffer with the elements within the provided table
:FromList(list) Nothing
<li> list: The table from which we'll copy into this buffer </li> - LibBuffer:FromString (str)
-
Populate each cell in the buffer with characters from the provided string
:FromString(str) Nothing
<li> str: The string which to populate the buffer with </li> - LibBuffer:Insert (i, val)
-
Insert a new value in the buffer at the indicated index
:Insert(i, val) Nothing
<li> i: The position in the buffer </li> <li> val: The value to insert </li> - LibBuffer:Line (x0, y0, x1, y1, color, pitch)
-
The various line algorithms were found on the internet at various places. Line(), Line2(), Line3(), Line4(), Line5() Some of these were found at the website of associate professor Leonard McMillan: http://www.cs.unc.edu/~mcmillan/comp136/Lecture6/Lines.html Some of these don't work. Line5() is the most efficient algorithm. The others should be regarded as deprecated as they will likely be removed.
<li> x0: First X position </li> <li> y0: First Y position </li> <li> x1: Second X position </li> <li> y1: Second Y position </li> <li> color: The line will be filled with this value </li> <li> pitch: The buffer's width. [[ </li> - LibBuffer:Memcopy (pos1, buffer, pos2, length)
-
Copy another buffer into this one
:Memcopy(pos1, buffer, pos2, length) Nothing
<li> pos1: The starting position in this buffer to copy </li> <li> buffer: The other buffer to copy </li> <li> pos2: The starting position in the other buffer where we'll begin copying </li> <li> length: The length of the subsection being copied </li> - LibBuffer:Memset (pos, val, length)
-
Set a subsection of this buffer to the specified value
:Memset(pos, val, length) Nothing
<li> pos: The starting position within this buffer to start assigning the specified value </li> <li> val: The value to assign to this buffer's subsection described by this method's other parameters </li> <li> length: The length of the subsection which is being assigned the specified value </li> - LibBuffer:Merge (from, pos, len)
-
Merge one buffer into this one
:Merge(from, pos, len) Nothing
<li> from: The buffer from which we'll copy </li> <li> pos: The position in the other buffer that we'll start copying from </li> <li> len: The length of the content to merge </li> - LibBuffer:MergeString (pos1, str, pos2, length)
-
Merge a string into the buffer
:MergeString(pos1, str, pos2, length) Nothing
<li> pos1: The index in this buffer to start merging from </li> <li> str: The string to merge </li> <li> pos2: The position in the string from which to start </li> <li> length: This is best expressed with a Lua expression :) str:sub(pos2, length) </li> - LibBuffer:MovingAverageExp (alpha, epsilon, buf)
-
Retrieve the moving averages for this buffer of number values
:MovingAverageExp(alpha, epsilon, buf) A new buffer populated with this buffer's moving averages
<li> alpha: </li> <li> epsilon: </li> <li> buf: </li> - LibBuffer:New (name, size, defval, errorLevel)
-
Create a new LibScriptableBuffer object
LibBuffer:New(name, size, defval, errorLevel) A new LibScriptableBuffer object
<li> name: A name for the buffer </li> <li> size: The buffer's size </li> <li> defval: The buffer's default value. The alpha channel. </li> <li> errorLevel: The verbocity level </li> - LibBuffer:Randomize ()
- Randomize the buffer :Randomize()
- LibBuffer:Replace (pos, val)
-
Replace a buffer position with a new value.
:Replace(pos, val) Nothing
<li> pos: The position in the buffer to replace </li> <li> val: The new value </li> - LibBuffer:Resize (size)
-
Resize a buffer
:Resize(size) Nothing
<li> size: The buffer's new size </li> - LibBuffer:Size ()
- Return the size of this buffer :Size() The size of this buffer
- LibBuffer:Sub (num1, num2, buf, t)
-
Extract a subsection from this buffer
:Sub(num1, num2) A new LibBuffer populated with this table subsection between num1 and num2
<li> num1: The starting position in the buffer from which to copy </li> <li> num2: THe ending position in the buffer from which to copy </li> <li> buf: </li> <li> t: An optional LibBuffer object </li> - LibBuffer:Wipe ()
- Wipe a buffer, :Wipe() Nothing