00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _GLPNG_H_
00024 #define _GLPNG_H_
00025
00026 #include <stdio.h>
00027
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef APIENTRY
00043 #if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
00044 #define APIENTRY __stdcall
00045 #else
00046 #define APIENTRY
00047 #endif
00048 #endif
00049
00050
00051 #define PNG_NOMIPMAPS 0
00052 #define PNG_BUILDMIPMAPS -1
00053 #define PNG_SIMPLEMIPMAPS -2
00054
00055
00056 #define PNG_NOMIPMAP PNG_NOMIPMAPS
00057 #define PNG_BUILDMIPMAP PNG_BUILDMIPMAPS
00058 #define PNG_SIMPLEMIPMAP PNG_SIMPLEMIPMAPS
00059
00060
00061 #define PNG_CALLBACK -3
00062 #define PNG_ALPHA -2
00063 #define PNG_SOLID -1
00064 #define PNG_STENCIL 0
00065 #define PNG_BLEND1 1
00066 #define PNG_BLEND2 2
00067 #define PNG_BLEND3 3
00068 #define PNG_BLEND4 4
00069 #define PNG_BLEND5 5
00070 #define PNG_BLEND6 6
00071 #define PNG_BLEND7 7
00072 #define PNG_BLEND8 8
00073
00074 typedef struct {
00075 unsigned int Width;
00076 unsigned int Height;
00077 unsigned int Depth;
00078 unsigned int Alpha;
00079 } pngInfo;
00080
00081 typedef struct {
00082 unsigned int Width;
00083 unsigned int Height;
00084 unsigned int Depth;
00085 unsigned int Alpha;
00086
00087 unsigned int Components;
00088 unsigned char *Data;
00089 unsigned char *Palette;
00090 } pngRawInfo;
00091
00092 extern int APIENTRY pngLoadRaw(const char *filename, pngRawInfo *rawinfo);
00093 extern int APIENTRY pngLoadRawF(FILE *file, pngRawInfo *rawinfo);
00094
00095 extern int APIENTRY pngLoad(const char *filename, int mipmap, int trans, pngInfo *info);
00096 extern int APIENTRY pngLoadF(FILE *file, int mipmap, int trans, pngInfo *info);
00097
00098 extern unsigned int APIENTRY pngBind(const char *filename, int mipmap, int trans, pngInfo *info, int wrapst, int minfilter, int magfilter);
00099 extern unsigned int APIENTRY pngBindF(FILE *file, int mipmap, int trans, pngInfo *info, int wrapst, int minfilter, int magfilter);
00100
00101 extern void APIENTRY pngSetStencil(unsigned char red, unsigned char green, unsigned char blue);
00102 extern void APIENTRY pngSetAlphaCallback(unsigned char (*callback)(unsigned char red, unsigned char green, unsigned char blue));
00103 extern void APIENTRY pngSetViewingGamma(double viewingGamma);
00104 extern void APIENTRY pngSetStandardOrientation(int standardorientation);
00105
00106 #ifdef __cplusplus
00107 }
00108 #endif
00109
00110 #endif