GRASS 8 Programmer's Manual  8.5.0dev(2025)-c070206eb1
defs/bitmap.h
Go to the documentation of this file.
1 #ifndef GRASS_BITMAPDEFS_H
2 #define GRASS_BITMAPDEFS_H
3 
4 /* bitmap.c */
5 struct BM *BM_create(int, int);
6 int BM_destroy(struct BM *);
7 int BM_set_mode(int, int);
8 int BM_set(struct BM *, int, int, int);
9 int BM_get(struct BM *, int, int);
10 size_t BM_get_map_size(struct BM *);
11 int BM_file_write(FILE *, struct BM *);
12 struct BM *BM_file_read(FILE *);
13 
14 /* sparse.c */
15 struct BM *BM_create_sparse(int, int);
16 int BM_destroy_sparse(struct BM *);
17 int BM_set_sparse(struct BM *, int, int, int);
18 int BM_get_sparse(struct BM *, int, int);
19 size_t BM_get_map_size_sparse(struct BM *);
20 int BM_dump_map_sparse(struct BM *);
21 int BM_dump_map_row_sparse(struct BM *, int);
22 int BM_file_write_sparse(FILE *, struct BM *);
23 
24 #endif /* GRASS_BITMAPDEFS_H */
int BM_get(struct BM *, int, int)
Gets 'val' from the bitmap.
Definition: bitmap.c:213
int BM_file_write(FILE *, struct BM *)
Write bitmap out to file.
Definition: bitmap.c:258
int BM_dump_map_row_sparse(struct BM *, int)
Debugging code to dump out structure of links for single row.
Definition: sparse.c:316
struct BM * BM_create_sparse(int, int)
Create a sparse bitmap of dimension 'x'/'y'.
Definition: sparse.c:41
int BM_destroy(struct BM *)
Destroy bitmap and free all associated memory.
Definition: bitmap.c:88
size_t BM_get_map_size(struct BM *)
Returns size in bytes that bitmap is taking up.
Definition: bitmap.c:236
int BM_set(struct BM *, int, int, int)
Sets bitmap value to 'val' at location 'x' 'y'.
Definition: bitmap.c:182
int BM_set_sparse(struct BM *, int, int, int)
Set sparse bitmap value to 'val' at location 'x'/'y'.
Definition: sparse.c:122
size_t BM_get_map_size_sparse(struct BM *)
Returns size of sparse bitmap in bytes.
Definition: sparse.c:260
int BM_file_write_sparse(FILE *, struct BM *)
Write sparse bitmap matrix out to disk file 'fp'. NOTE: 'fp' must already be opened and later closed ...
Definition: sparse.c:346
int BM_dump_map_sparse(struct BM *)
Debugging code to dump out structure of links.
Definition: sparse.c:288
int BM_set_mode(int, int)
Specify the type of data structure to use for bitmap. 'mode' can be either BM_FLAT or BM_SPARSE:
Definition: bitmap.c:145
int BM_get_sparse(struct BM *, int, int)
Returns sparse bitmap value at location 'x'/'y'.
Definition: sparse.c:236
int BM_destroy_sparse(struct BM *)
Destroy sparse bitmap and free all associated memory.
Definition: sparse.c:86
struct BM * BM_file_read(FILE *)
Create map structure and load it from file.
Definition: bitmap.c:299
struct BM * BM_create(int, int)
Create bitmap of dimension x/y and return structure token.
Definition: bitmap.c:57
Definition: bitmap.h:17