libsxbp  v0.27
Experimental generation of 2D spiralling lines based on input binary data.
Functions | Variables
backend_png.h File Reference

This compilation unit provides functionality to render a bitmap struct to a PNG image (stored in a buffer). More...

#include <stdbool.h>
#include "../saxbospiral.h"
#include "../render.h"
Include dependency graph for backend_png.h:

Go to the source code of this file.

Functions

sxbp_status_t sxbp_render_backend_png (sxbp_bitmap_t bitmap, sxbp_buffer_t *buffer)
 Renders a bitmap image to a PNG image. More...
 

Variables

const bool SXBP_PNG_SUPPORT
 Flag for whether PNG output support has been enabled. More...
 

Detailed Description

This compilation unit provides functionality to render a bitmap struct to a PNG image (stored in a buffer).

Note
PNG output support may have not been enabled in the compiled version of libsxbp that you have. If support is not enabled, the library boolean constant SXBP_PNG_SUPPORT will be set to false and the one public function defined in this unit will return SXBP_NOT_IMPLEMENTED.
Author
Joshua Saxby <joshua.a.saxby+TNOPLuc8vM==.com
Date
2016, 2017

Function Documentation

sxbp_status_t sxbp_render_backend_png ( sxbp_bitmap_t  bitmap,
sxbp_buffer_t *  buffer 
)

Renders a bitmap image to a PNG image.

Parameters
bitmapBitmap containing the image to render.
[out]bufferBuffer to write out the PBM image data to.
Returns
SXBP_OPERATION_OK on success.
SXBP_NOT_IMPLEMENTED if PNG support has not been enabled.
SXBP_MALLOC_REFUSED on memory allocation failure.
Note
Asserts:
  • That bitmap.pixels is not NULL
  • That buffer->bytes is NULL

Variable Documentation

const bool SXBP_PNG_SUPPORT

Flag for whether PNG output support has been enabled.

This is compiled into the library, based on a macro set at build time. The value of this constant is false if PNG support is not enabled and true if it is.