Welcome! Log In Create A New Profile


jpeg converter

Posted by oldmetalbasher 
jpeg converter
February 17, 2013 02:11PM
hello all, my project requires me to connect a serial camera to a bv 523 and send an image to be processed before display on the screen.
now the camera file format is jpg and cant be changed, the bv523 requires a mbc format.
although there is a file converter supplied i require the bv523 to make this conversion.
does any one know how a mbc file is composed ? i have failed on google to find any usefull info on mbc files
thank you for reading this
Re: jpeg converter
February 17, 2013 06:15PM
The file format is:

Height and width are 16 bits (high byte first) and r,g,b (red green and blue) are one byte each. A 24 bit bmp colour file is converted with Quick and Dirty BMP. The maximum colour is 63 so the output for r,g,b is divided by 4. All that is added from the output of qdbmp.c is the height and width values at the font of the output file.
        // just output binary for use with a display program
        // write height and width as 2 bytes (high low)
        if(addhw) {
        	fputc(((UCHAR)(height >> 8) & 0xff), outf);
                fputc((UCHAR)(height & 0xff), outf);
                fputc(((UCHAR)(width >> 8) & 0xff), outf);
                fputc((UCHAR)(width & 0xff), outf);
	for(y=0;y<height;y++) {
	   for(x=0;x<width;x++) {
	        BMP_GetPixelRGB(input, x, y, &r, &g, &b );
        	fputc(r/4, outf);
        	fputc(g/4, outf);
	       	fputc(b/4, outf);
The above is from BMPConvert that will output a binary file for downloading.
Sorry, you do not have permission to post/reply in this forum.