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