#ifndef ASCII_PIXMAP_H_INCLUDED #define ASCII_PIXMAP_H_INCLUDED #include "pixmap.h" /* A pixmap backed by a matrix of ASCII characters. * * Each bit corresponds to a character. The background character is * the space character (' '); the foreground character is '*'. These * are the default values, which may be changed by the user. * * The pixels are laid out line-by-line. So, the memory buffer starts * with the character corresponding to the pixel at position x=0, y=0, * followed by the pixel at position x=1, y=0, up to x=width-1, y=0, * which is followed by the pixel at position x=0, y=1, and so on. */ struct ascii_pixmap; /* Create a new ascii pixmap backed by the given memory buffer. * * width is the number of characters in each line; height is the * number of lines; map is a pointer to a memory region used to store * the pixels. This region is passed and owned by the user. It is * also assumed to be large enough to hold width*height characters. */ extern struct pixmap * ascii_pixmap_new(unsigned int width, unsigned int height, char * map); /* Set the background character for the given ascii pixmap. */ extern void ascii_pixmap_set_background(struct pixmap * this, char bg); /* Set the foreground character for the given ascii pixmap. */ extern void ascii_pixmap_set_foreground(struct pixmap * this, char fg); /* Get the background character for the given ascii pixmap. */ extern char ascii_pixmap_get_background(const struct pixmap * this); /* Get the foreground character for the given ascii pixmap. */ extern char ascii_pixmap_get_foreground(const struct pixmap * this); #endif