Skip to content

musou1500/bmp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bmp

bmp reader can read uncompressed(BI_RGB) 8, 24, 32bit bmp.

build

$ make

usage

see example/main.c for more detail. (example requires sdl2)

FILE *fp = fopen(filename, "r");
bi_img_t img = bi_read_img(fp);
printf("width %d\n", img.info.width);
printf("height %d\n", img.info.height);

for (int i = img.info.height; i >= 0; i--) {
  for (int j = 0; j < img.info.width; j++) {
    bi_palette_t palette = bi_palette_at(img, j, i);
    printf("rgb %x %x %x", palette.r, palette.g, palette.b)
  }
}

bi_free_img(img);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published