00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _MX_PNG_H_
00018 #define _MX_PNG_H_
00019
00020
00021 #include<png.h>
00022 #include<string>
00023 #include "SDL.h"
00024 #include "mx_types.h"
00025
00026 namespace mx
00027 {
00028
00031 class mxPng {
00032
00033 public:
00035 mxPng();
00039 mxPng(std::string fname);
00040
00044 int pngOpen(std::string fname);
00046 int pngClose();
00050 SDL_Surface *LoadPNG();
00051 private:
00052 int x, y;
00053 int width, height;
00054 png_byte color_type;
00055 png_byte bit_depth;
00056 png_structp png_ptr;
00057 png_infop info_ptr;
00058 int number_of_passes;
00059 png_bytep * row_pointers;
00060
00061 };
00062
00063 }
00064
00065 #endif
00066
00067
00068
00069