![]() |
libsxbp
v0.27
Experimental generation of 2D spiralling lines based on input binary data.
|
This compilation unit provides basic functions to initialise a spiral. More...
#include "saxbospiral.h"
Go to the source code of this file.
Functions | |
| sxbp_direction_t | sxbp_change_direction (sxbp_direction_t current, sxbp_rotation_t turn) |
| Gets the direction which is clockwise or anti-clockwise to the current direction. More... | |
| sxbp_spiral_t | sxbp_blank_spiral (void) |
| Builds a blank spiral struct. More... | |
| sxbp_status_t | sxbp_init_spiral (sxbp_buffer_t buffer, sxbp_spiral_t *spiral) |
| Builds a partially-complete spiral from binary input data stored in a buffer. More... | |
This compilation unit provides basic functions to initialise a spiral.
| sxbp_spiral_t sxbp_blank_spiral | ( | void | ) |
Builds a blank spiral struct.
This is a convenience function, as the struct has many fields. This function will create a spiral struct with all of these fields initialised to 0 or their default 'blank' state. No memory is allocated.
| sxbp_direction_t sxbp_change_direction | ( | sxbp_direction_t | current, |
| sxbp_rotation_t | turn | ||
| ) |
Gets the direction which is clockwise or anti-clockwise to the current direction.
Given a current direction and a rotational direction, return the new direction which would be faced after turning 90 degrees in the given rotational direction.
| current | The current direction to turn from. |
| turn | The rotational direction to turn in. |
| sxbp_status_t sxbp_init_spiral | ( | sxbp_buffer_t | buffer, |
| sxbp_spiral_t * | spiral | ||
| ) |
Builds a partially-complete spiral from binary input data stored in a buffer.
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.
| buffer | A buffer containing at least one byte of data, used to determine the directions of the lines in the spiral it will create. | |
| [out] | spiral | Spiral object which the line directions will be written to. |
1.8.11