GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - aditisrinivas97/Bitmap4Rust: A Rust library for creating and manipulating Bitmaps.

BranchesTags
Open more actions menu

Latest commit

 

History

17 Commits
17 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
Cargo.toml
Cargo.toml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

Bitmap4Rust

Status Open Source Love License Build Status

A Rust library for creating and manipulating Bitmaps.

API

The bitmap is maintained in a byte vector of appropriate size. Hence, it's type should be Vec<u8>.


pub fn bitmap_create(bitmap_size: &mut u64) -> Vec<u8>

Used to create the bitmap. Since the bitmap is maintained as a byte vector, it must be of type Vec<u8>.


pub fn clear_bit(bitmap: &mut Vec<u8>, bitno: u64) -> i32

Used to clear the bit at bitno, i.e, set it to 0. If bitno is larger than the bitmap's size, -1 is returned.


pub fn set_bit(bitmap: &mut Vec<u8>, bitno: u64) -> i32

Used to set the bit at bitno, i.e, set it to 1. If bitno is larger than the bitmap's size, -1 is returned.


pub fn get_first_set_bit(bitmap: &mut Vec<u8>) -> i64

Used to get the first bit of bitmap that is set to 1. Returns -1 if none are set.


pub fn get_first_unset_bit(bitmap: &mut Vec<u8>) -> i64 

Used to get the first bit of bitmap that is set to 0. Returns -1 if all bits are set.


pub fn check_bit(bitmap: &mut Vec<u8>, bitno: u64) -> i32

Used to check the value of the bit corresponding to bitno.


Usage

  • Add the dependency bitmap4rust in Cargo.toml
[dependencies]
bitmap4rust = "1.0.1"
  • Include the crate bitmap4rust
extern crate bitmap4rust;

About

A Rust library for creating and manipulating Bitmaps.

Topics

bit-manipulationbitmapsbitwise-operationfree-space-bitmapsrustrust-library

Resources

Readme
MIT license
Activity

Stars

6 stars

Watchers

2 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.