Jump to content
xisto Community
Sign in to follow this  

Help Me With Loadpng()

Recommended Posts

can anyone tell me how to use this png.h?? I want to use loadPNG for my last assignment. thx in advance.

/***************************************************************************** *  ENTROPY - emerging network to reduce orwellian potency yield * *  Copyright Š 2002 Juergen Buchmueller <pullmoll@stop1984.com> * *  This program is free software; you can redistribute it and/or modify *  it under the terms of the GNU General Public License as published by *  the Free Software Foundation; either version 2 of the License, or *  (at your option) any later version. * *  This program is distributed in the hope that it will be useful, *  but WITHOUT ANY WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *  GNU General Public License for more details. * *  You should have received a copy of the GNU General Public License *  along with this program; if not, write to the Free Software *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA * *	  $Id: png.h,v 1.7 2003/11/03 17:31:34 pullmoll Exp $ *****************************************************************************/#ifndef _png_h#define _png_h//#include "osd.h"#define COLOR_GRAYSCALE 0#define COLOR_RGBTRIPLE 2#define COLOR_PALETTE   3#define COLOR_GRAYALPHA 4#define COLOR_RGBALPHA  6typedef struct png_s {		void *user;		int (*input)(void *user);		int (*output)(void *user, u_int8_t data);		u_int32_t crc;		/* image header information */		int w, h, bpp;		u_int8_t color;		u_int8_t depth;		u_int8_t compression;		u_int8_t filter;		u_int8_t interlace;		/* physical pixel dimensions */		u_int32_t px, py;		u_int8_t unit;		/* time stamp C,Y,M,D,H,M,S */		u_int8_t time[7];		/* background color */		size_t bkgd_size;		u_int8_t bkgd[6];		/* transparency */		size_t trns_size;		u_int8_t trns[256];		/* working variables */		size_t row, offs, size;		u_int8_t *img;		u_int8_t pal[3*256];		char *comment;		char *author;}	   png_t;#ifdef  __cplusplusextern "C" {#endif#define PNG_RGB(r,g,B)  (((Ž&0xff)<<16)|(((g)&0xff)<<8)|((B)&0xff))png_t *png_read(const char *filename,		void *user, int (*output)(void *user, u_int8_t data));png_t *png_create(int w, int h, int color, int depth,		void *user, int (*output)(void *user, u_int8_t data));int png_finish(png_t *png);int png_set_palette(png_t *png, int idx, int color);int png_put_pixel(png_t *png, int x, int y, int color, int alpha);int png_get_pixel(png_t *png, int x, int y, int *color, int *alpha);int png_rectangle(png_t *png, int x0, int y0, int x1, int y1,		int color, int alpha);int png_filled_rectangle(png_t *png, int x0, int y0, int x1, int y1,		int color, int alpha);int png_tinted_rectangle(png_t *png, int x0, int y0, int x1, int y1,		int color, int alpha);int png_printf(png_t *png, int x, int y, int color, int alpha,		const char *fmt, ...);int png(void);#ifdef  __cplusplus}#endif#endif  /* _png_h */

Edited by .hack//GU (see edit history)

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.