44 lines
1.2 KiB
C
44 lines
1.2 KiB
C
#ifndef FX_DS_BITMAP_H_
|
|
#define FX_DS_BITMAP_H_
|
|
|
|
#include <fx/macros.h>
|
|
#include <fx/misc.h>
|
|
#include <stdbool.h>
|
|
|
|
FX_DECLS_BEGIN;
|
|
|
|
#define FX_TYPE_BITMAP (fx_bitmap_get_type())
|
|
|
|
FX_DECLARE_TYPE(fx_bitmap);
|
|
|
|
FX_TYPE_CLASS_DECLARATION_BEGIN(fx_bitmap)
|
|
FX_TYPE_CLASS_DECLARATION_END(fx_bitmap)
|
|
|
|
FX_API fx_type fx_bitmap_get_type(void);
|
|
|
|
FX_API fx_bitmap *fx_bitmap_create(size_t nr_bits);
|
|
|
|
FX_API void fx_bitmap_set_bit(fx_bitmap *map, size_t bit);
|
|
FX_API void fx_bitmap_clear_bit(fx_bitmap *map, size_t bit);
|
|
FX_API void fx_bitmap_set_range(fx_bitmap *map, size_t first_bit, size_t nbits);
|
|
FX_API void fx_bitmap_clear_range(
|
|
fx_bitmap *map,
|
|
size_t first_bit,
|
|
size_t nbits);
|
|
FX_API void fx_bitmap_set_all(fx_bitmap *map);
|
|
FX_API void fx_bitmap_clear_all(fx_bitmap *map);
|
|
|
|
FX_API bool fx_bitmap_check_bit(const fx_bitmap *map, size_t bit);
|
|
|
|
FX_API size_t fx_bitmap_count_set_bits(const fx_bitmap *map);
|
|
FX_API size_t fx_bitmap_count_clear_bits(const fx_bitmap *map);
|
|
|
|
FX_API size_t fx_bitmap_highest_set_bit(const fx_bitmap *map);
|
|
FX_API size_t fx_bitmap_highest_clear_bit(const fx_bitmap *map);
|
|
FX_API size_t fx_bitmap_lowest_set_bit(const fx_bitmap *map);
|
|
FX_API size_t fx_bitmap_lowest_clear_bit(const fx_bitmap *map);
|
|
|
|
FX_DECLS_END;
|
|
|
|
#endif
|