-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbit2.h
39 lines (31 loc) · 859 Bytes
/
bit2.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
32
33
34
35
36
37
38
39
/*
* COMP 40 HW 2
*
* X. Victor Gao and Yifan Yang
*
* bit2.h : interface of bit2
*/
#include "bit.h"
#include <stdio.h>
#include <stdlib.h>
#include "assert.h"
#include "except.h"
#ifndef BIT2_INCLUDED
#define BIT2_INCLUDED
#define T Bit2_T
typedef struct T *T;
extern T Bit2_new (int width, int height);
extern void Bit2_free (T *bit2);
extern int Bit2_width (T bit2);
extern int Bit2_height (T bit2);
extern int Bit2_count (T bit2);
extern int Bit2_get (T bit2, int col, int row);
extern int Bit2_put (T bit2, int col, int row, int bit);
extern void Bit2_map_row_major(T bit2,
void apply(int col, int row, int bit, void *cl),
void *cl);
extern void Bit2_map_col_major(T bit2,
void apply(int col, int row, int bit, void *cl),
void *cl);
#undef T
#endif