URL
https://opencores.org/ocsvn/kiss-board/kiss-board/trunk
Subversion Repositories kiss-board
[/] [kiss-board/] [trunk/] [kiss-board_soc/] [sw/] [bmp2c/] [bmp2bmp_white_black.c] - Rev 2
Go to most recent revision | Compare with Previous | Blame | View Log
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "bmp.h" int WIDTH; int HEIGHT; int xx,yy; BITMAP bitmap; int main(int,char **); void start_blue(void); int main(int argc,char *argv[]){ unsigned char r,g,b; BmpRead((BITMAP*)&bitmap); WIDTH = bitmap.bitMapInfo.biWidth; HEIGHT = bitmap.bitMapInfo.biHeight; for (yy=0;yy<HEIGHT;yy++) { for (xx=0;xx<WIDTH;xx++) { r = bitmap.bitColor[xx][yy].r; g = bitmap.bitColor[xx][yy].g; b = bitmap.bitColor[xx][yy].b; r = (r!=0x00) ? 255: 0; g = (g!=0x00) ? 255: 0; b = (b!=0x00) ? 255: 0; bitmap.bitColor[xx][yy].r = r; bitmap.bitColor[xx][yy].g = g; bitmap.bitColor[xx][yy].b = b; } } BmpWrite((BITMAP*)&bitmap); return 0; }
Go to most recent revision | Compare with Previous | Blame | View Log