|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-ddeab64dbf
|

Go to the source code of this file.
Macros | |
| #define | BM_col_to_byte(x) ((x) >> 3) /* x / 8 */ |
| #define | BM_col_to_bit(x) ((x) & 7) /* x % 8 */ |
Functions | |
| struct BM * | BM_create_sparse (int x, int y) |
| Create a sparse bitmap of dimension 'x'/'y'. | |
| int | BM_destroy_sparse (struct BM *map) |
| Destroy sparse bitmap and free all associated memory. | |
| int | BM_set_sparse (struct BM *map, int x, int y, int val) |
| Set sparse bitmap value to 'val' at location 'x'/'y'. | |
| int | BM_get_sparse (struct BM *map, int x, int y) |
| Returns sparse bitmap value at location 'x'/'y'. | |
| size_t | BM_get_map_size_sparse (struct BM *map) |
| Returns size of sparse bitmap in bytes. | |
| int | BM_dump_map_sparse (struct BM *map) |
| Debugging code to dump out structure of links. | |
| int | BM_dump_map_row_sparse (struct BM *map, int y) |
| Debugging code to dump out structure of links for single row. | |
| int | BM_file_write_sparse (FILE *fp, struct BM *map) |
| Write sparse bitmap matrix out to disk file 'fp'. NOTE: 'fp' must already be opened and later closed by user. | |
Create a sparse bitmap of dimension 'x'/'y'.
Returns bitmap structure or NULL on error
| x | |
| y |
Definition at line 41 of file sparse.c.
References BM::bytes, BM::cols, BMlink::count, BM::data, free(), link_init(), link_new(), link_set_chunk_size(), malloc(), BMlink::next, NULL, BM::rows, BM::sparse, BM::token, BMlink::val, and x.
Referenced by BM_create(), and main().
Destroy sparse bitmap and free all associated memory.
Returns 0
| map |
Definition at line 86 of file sparse.c.
References BM::data, free(), link_cleanup(), link_dispose(), BMlink::next, NULL, BM::rows, BM::token, and VOID_T.
Referenced by BM_destroy().
Debugging code to dump out structure of links for single row.
Returns 0
| map | |
| y |
Definition at line 316 of file sparse.c.
References BMlink::count, BM::data, BMlink::next, NULL, and BMlink::val.
Referenced by main().
Debugging code to dump out structure of links.
Returns 0
| map |
Definition at line 288 of file sparse.c.
References BMlink::count, BM::data, BMlink::next, NULL, BM::rows, and BMlink::val.
Write sparse bitmap matrix out to disk file 'fp'. NOTE: 'fp' must already be opened and later closed by user.
Returns 0 on success or -1 on error
| fp | |
| map |
Definition at line 346 of file sparse.c.
References BM_MAGIC, BM_SPARSE, BM_TEXT, BM_TEXT_LEN, BM::cols, BMlink::count, BM::data, BMlink::next, NULL, BM::rows, and BMlink::val.
Referenced by BM_file_write().
Returns size of sparse bitmap in bytes.
| map |
Definition at line 260 of file sparse.c.
References BM::data, BMlink::next, NULL, and BM::rows.
Referenced by BM_get_map_size().
Returns sparse bitmap value at location 'x'/'y'.
Returns value or -1 on error
| map | |
| x | |
| y |
Definition at line 236 of file sparse.c.
References BMlink::count, cur_x, BM::data, BMlink::next, NULL, BMlink::val, and x.
Referenced by BM_get().
Set sparse bitmap value to 'val' at location 'x'/'y'.
Returns 0
| map | |
| x | |
| y | |
| val |
Definition at line 122 of file sparse.c.
References BMlink::count, cur_x, BM::data, link_dispose(), link_new(), BMlink::next, NULL, BM::token, BMlink::val, VOID_T, and x.
Referenced by BM_set().