![]() |
libsxbp
v0.27
Experimental generation of 2D spiralling lines based on input binary data.
|
This compilation unit provides functions for rendering a spiral to a bitmap. More...


Go to the source code of this file.
Data Structures | |
| struct | sxbp_bitmap_t |
| Used to represent a basic 1-bit, pure black/white bitmap image. More... | |
Typedefs | |
| typedef struct sxbp_bitmap_t | sxbp_bitmap_t |
| Used to represent a basic 1-bit, pure black/white bitmap image. More... | |
Functions | |
| sxbp_status_t | sxbp_render_spiral_raw (sxbp_spiral_t spiral, sxbp_bitmap_t *image) |
| Renders the line of a spiral to a bitmap. More... | |
| sxbp_status_t | sxbp_render_spiral_image (sxbp_spiral_t spiral, sxbp_buffer_t *buffer, sxbp_status_t(*image_writer_callback)(sxbp_bitmap_t image, sxbp_buffer_t *buffer)) |
| Renders the line of a spiral to an image format. More... | |
This compilation unit provides functions for rendering a spiral to a bitmap.
| typedef struct sxbp_bitmap_t sxbp_bitmap_t |
Used to represent a basic 1-bit, pure black/white bitmap image.
The image has integer height and width, and a 2-dimensional array of 1-bit pixels which are either black or white.
| sxbp_status_t sxbp_render_spiral_image | ( | sxbp_spiral_t | spiral, |
| sxbp_buffer_t * | buffer, | ||
| sxbp_status_t(*)(sxbp_bitmap_t image, sxbp_buffer_t *buffer) | image_writer_callback | ||
| ) |
Renders the line of a spiral to an image format.
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.
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:
| spiral | The spiral which should be rendered. | |
| [out] | buffer | The data buffer to which the bytes of the image file should be written. |
| image_writer_callback | A function pointer with the following signature: |
| sxbp_status_t sxbp_render_spiral_raw | ( | sxbp_spiral_t | spiral, |
| sxbp_bitmap_t * | image | ||
| ) |
Renders the line of a spiral to a bitmap.
The lines of the spiral are plotted on a white background and the pixel data representing the resulting shape is written to the given image.
| spiral | The spiral which should be rendered. | |
| [out] | image | The bitmap to write the pixel data out to. |
1.8.11