You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>Experimental generation of 2D spiralling lines based on input binary data.</p>
86
86
<p>This a C library implementing an experimental idea I had for generating procedural shapes. The library takes input as sequences of bytes and turns the 1s and 0s into a kind of <em>right-angled spiral</em>, with the changes in direction of the line encoding the binary data in a lossless manner.</p>
87
87
<p>Following Linus Torvalds' example, I have egotistically named this invention the **_saxbospiral_**, after my own online handle. At the time of writing, I couldn't think of a better name for it.</p>
Copy file name to clipboardExpand all lines: docs/initialise_8h.html
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -213,8 +213,8 @@
213
213
<p>This converts the 0s and 1s in the buffer data into UP, LEFT, DOWN, RIGHT instructions which are then used to build the pattern. Only the line directions are calculated at this point, all line lengths are 0.</p>
214
214
<dlclass="params"><dt>Parameters</dt><dd>
215
215
<tableclass="params">
216
-
<tr><tdclass="paramname">buffer</td><td>A buffer containing at least one byte of data, used to determine the directions of the lines in the spiral it will create. </td></tr>
217
-
<tr><tdclass="paramname">spiral</td><td>[out] Spiral object which the line directions will be written to. </td></tr>
216
+
<tr><tdclass="paramdir"></td><tdclass="paramname">buffer</td><td>A buffer containing at least one byte of data, used to determine the directions of the lines in the spiral it will create. </td></tr>
217
+
<tr><tdclass="paramdir">[out]</td><tdclass="paramname">spiral</td><td>Spiral object which the line directions will be written to. </td></tr>
Copy file name to clipboardExpand all lines: docs/plot_8h.html
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -157,8 +157,8 @@
157
157
<p>If there are any outstanding co-ordinates which haven't been stored in the spiral's internal cache, then these will be calculated and stored in the cache. Subsequent identical calls will not incur the overhead of re-calculating these co-ords, provided the lengths of any of the spiral's lines are not changed in the process.</p>
158
158
<dlclass="params"><dt>Parameters</dt><dd>
159
159
<tableclass="params">
160
-
<tr><tdclass="paramname">spiral</td><td>The spiral for which co-ords should be cached. </td></tr>
161
-
<tr><tdclass="paramname">limit</td><td>The highest index of line for which co-ords should be cached to. </td></tr>
160
+
<tr><tdclass="paramdir">[in,out]</td><tdclass="paramname">spiral</td><td>The spiral for which co-ords should be cached. </td></tr>
161
+
<tr><tdclass="paramdir"></td><tdclass="paramname">limit</td><td>The highest index of line for which co-ords should be cached to. </td></tr>
162
162
</table>
163
163
</dd>
164
164
</dl>
@@ -219,11 +219,11 @@
219
219
<p>The whole spiral may be calculated, or just a given segment of it. This is controlled by specifying which line to start at and which to end at.</p>
220
220
<dlclass="params"><dt>Parameters</dt><dd>
221
221
<tableclass="params">
222
-
<tr><tdclass="paramname">spiral</td><td>The spiral for which line co-ords should be calculated. </td></tr>
223
-
<tr><tdclass="paramname">output</td><td>[out] The co-ords array which calculated co-ords should be written to. </td></tr>
224
-
<tr><tdclass="paramname">start_point</td><td>The x/y co-ordinates at which the line being plotted originates at. </td></tr>
225
-
<tr><tdclass="paramname">start</td><td>The index of the first line which makes up the segment which is being calculated. </td></tr>
226
-
<tr><tdclass="paramname">end</td><td>The index of the line after the last line which makes up the segment which is being calculated. </td></tr>
222
+
<tr><tdclass="paramdir"></td><tdclass="paramname">spiral</td><td>The spiral for which line co-ords should be calculated. </td></tr>
223
+
<tr><tdclass="paramdir">[out]</td><tdclass="paramname">output</td><td>The co-ords array which calculated co-ords should be written to. </td></tr>
224
+
<tr><tdclass="paramdir"></td><tdclass="paramname">start_point</td><td>The x/y co-ordinates at which the line being plotted originates at. </td></tr>
225
+
<tr><tdclass="paramdir"></td><tdclass="paramname">start</td><td>The index of the first line which makes up the segment which is being calculated. </td></tr>
226
+
<tr><tdclass="paramdir"></td><tdclass="paramname">end</td><td>The index of the line after the last line which makes up the segment which is being calculated. </td></tr>
<p>The lines of the spiral are plotted on a white background and the pixel data representing the resulting shape is written as data in a given image file format, using the callback function to achieve this conversion. The callback function should inspect the pixels of the bitmap passed to it and write the file data representing the bitmap in it's respective file format out to the buffer.</p>
201
201
<p>The function signature of the callback is the same as that of the image rendering functions provided by the library: sxbp_render_backend_pbm and sxbp_render_backend_png. This allows one of these to be provided as the callback function, a convenient use of function chaining can achieve this like so: </p><divclass="fragment"><divclass="line"><aname="l00001"></a><spanclass="lineno"> 1</span> sxbp_render_spiral_image(spiral, buffer, sxbp_render_backend_pbm);</div></div><!-- fragment --><dlclass="params"><dt>Parameters</dt><dd>
202
202
<tableclass="params">
203
-
<tr><tdclass="paramname">spiral</td><td>The spiral which should be rendered. </td></tr>
204
-
<tr><tdclass="paramname">buffer</td><td>[out] The data buffer to which the bytes of the image file should be written. </td></tr>
205
-
<tr><tdclass="paramname">image_writer_callback</td><td>A function pointer with the following signature: <divclass="fragment"><divclass="line"><aname="l00001"></a><spanclass="lineno"> 1</span> sxbp_status_t callback_name(sxbp_bitmap_t image, sxbp_buffer_t* buffer)</div></div><!-- fragment --></td></tr>
203
+
<tr><tdclass="paramdir"></td><tdclass="paramname">spiral</td><td>The spiral which should be rendered. </td></tr>
204
+
<tr><tdclass="paramdir">[out]</td><tdclass="paramname">buffer</td><td>The data buffer to which the bytes of the image file should be written. </td></tr>
205
+
<tr><tdclass="paramdir"></td><tdclass="paramname">image_writer_callback</td><td>A function pointer with the following signature: <divclass="fragment"><divclass="line"><aname="l00001"></a><spanclass="lineno"> 1</span> sxbp_status_t callback_name(sxbp_bitmap_t image, sxbp_buffer_t* buffer)</div></div><!-- fragment --></td></tr>
0 commit comments