BMPlib v1.0 [BETA]

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Rangu2057
Posts: 87
Joined: Mon Jul 23, 2007 8:37 am
Location: wilmington, NC

BMPlib v1.0 [BETA]

Post by Rangu2057 »

this is a small basic lib for displaying BMP images on the psp, its currently in beta stages

I havent had a lot of time on my hand these days so its hard to actually add more stuff to it

If anyone has any other info specific to displaying BMP images please let me know

Two more things, can anyone help me out with coding a basic server for receiving messages from a client, and also i was thinking is it worth trying to code another pnglib, as the current one is greatly complex and i can never seem to get my image to print to the screen, and end up with around 2000 errors and warnings in the png.h file

Code: Select all

/************************************************************************************
* BMPLib.h	-	DIB / BMP library by Bernard Jacobs made @ 2 - 26 - 08, 3:12	*
*************************************************************************************/

#ifndef BMPLib		/* research " 24 bit image data, indexed color data, rgb"	*/
#define BMPLib		/* SIDE NOTE - this piece of code is best used to handle uncompressed BMP files */

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#define compression

#define none 0		/* no compression 		*/
#define BI_RLE8 1		/* 8-bit run length encoding	*/
#define BI_RLE4 2		/* 4-bit run length encoding	*/
#define BI_BITFIELDS 3	/* RGB bitmap with RGB mask	*/


#endif /* compression */

#define magic1 0x42	/* magic numbers used to identify file as BMP */
#define magic2 0x4D	/* both are ASCII code points for "B" and "M" */
#define rowsize 


/******************************
* Private BMPLib functions 	*
*******************************/

extern int Init_BMPLib(void); 			/* starts BMPLib	*/
extern int LoadBMP(const char *file);		/* loads BMP file	*/


typedef struct {					/* stores general information about the BMP file 					*/
unsigned int magic;				/* magic number used to identify the BMP file	 					*/
unsigned int Sze;					/* size of BMP file in bytes				 					*/
unsign short int reserved1;			/* reserved, actual value depends on application that made image 			*/
unsign short int reserved2;			/* reserved, actual value depends on application that made image 			*/
unsigned int offSet;				/* the offset, starting address of the byte where bitmap data can be found 	*/
}HEADER;

typedef struct {			/* shows detailed information about the bitmap image 	*/
unsigned int size;		/* header size in bytes						*/
signed int width;			/* bitmap width in pixels					*/
signed int height;		/* bitmap height in pixels					*/
unsigned short int planes;	/* # of color planes, must be set to 1			*/
unsigned short int bits;	/* # of bits per pixel, which is color depth of image	*/
unsigned int compression;	/* compression type						*/
unsigned int imageSze;		/* size of image in bytes					*/
int xresolution, yresolution;	/* pixels per meter						*/
unsigned int colors;		/* number of the colors						*/
unsigned int important;		/* very important colors					*/
}INFOHEADER;

typedef struct {			/* 
unsigned char rgbBlue;		/* Blue value 	*/
unsigned char rgbGreen;		/* Green value 	*/
unsigned char rgbRed;		/* Red value 	*/
unsigned char rgbReserved;	/* Reserved		*/
}RGBQUAD;
the questions of today are awnswered by the blood and bullets of tomorrow! ---EagleEye--- (Socom FTB2)
Post Reply