⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bitmap.c

📁 source code to compute the visibility polygon of a point in a polygon.
💻 C
字号:
/* Brian O'Connor * bitmap.h * macros that facilitate treating a 32-bit int as a 32-bit bitmap. */#include "bitmap.h"#include <assert.h>#include <stdio.h>int TestBit(Bitmap b, int i){  assert(i < BITMAP_SIZE);  return( b & (1 << i) );}void SetBit(Bitmap& b, int i){  assert(i < BITMAP_SIZE);  b = b | (1 << i);}void ClearBit(Bitmap& b, int i){  assert(i < BITMAP_SIZE);  b = b & ( ~(1 << i) );}int MapIsClear(Bitmap b){  return( b == 0);}void PrintBitmap(Bitmap b){  int i;  for( i = BITMAP_SIZE - 1; i >= 0; i-- ) {    if( b & (1 << i) ) {	printf("1");    } else printf("0");  }  printf("\n");}Bitmap ZeroBitmap(void){  return( 0L );}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -