1 /* bitmap.h: definition for a bitmap type. No packing is done by 2 default; each pixel is represented by an entire byte. Among other 3 things, this means the type can be used for both grayscale and binary 4 images. */ 5 6 #ifndef BITMAP_H 7 #define BITMAP_H 8 9 #include "autotrace.h" 10 #include "input.h" 11 #include <stdio.h> 12 13 /* at_ prefix removed version */ 14 typedef at_bitmap_type bitmap_type; 15 #define BITMAP_PLANES(b) AT_BITMAP_PLANES(b) 16 #define BITMAP_BITS(b) AT_BITMAP_BITS(b) 17 #define BITMAP_WIDTH(b) AT_BITMAP_WIDTH(b) 18 #define BITMAP_HEIGHT(b) AT_BITMAP_HEIGHT(b) 19 #define BITMAP_PIXEL(b, row, col) AT_BITMAP_PIXEL(b, row, col) 20 21 #define BITMAP_VALID_PIXEL(b, row, col) \ 22 ((row) < BITMAP_HEIGHT (b) && (col) < BITMAP_WIDTH (b)) 23 24 /* Allocate storage for the bits, set them all to white, and return an 25 initialized structure. */ 26 extern bitmap_type new_bitmap (unsigned short width, unsigned short height); 27 28 /* Free that storage. */ 29 extern void free_bitmap (bitmap_type *); 30 31 #endif /* not BITMAP_H */ 32