OpenCores
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 11

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;
}
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.