00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef _MX_JPEG_H_
00017 #define _MX_JPEG_H_
00018 #include<stdio.h>
00019 #include<stdlib.h>
00020
00021 extern "C" {
00022 #include"jpeglib.h"
00023 }
00024
00025 #ifdef HAVE_STDLIB_H
00026 #undef HAVE_STDLIB_H
00027 #endif
00028
00029 #ifdef HAVE_PROTOTYPES
00030 #undef HAVE_PROTOTYPES
00031 #endif
00032
00033
00034 #include "mx_types.h"
00035 #include<string>
00036
00037
00038 namespace mx {
00039
00040
00041 using std::string;
00042
00044 class mxJpeg {
00045 public:
00046
00048 mxJpeg() {
00049 data = 0;
00050 }
00052 ~mxJpeg() {
00053 if(data) delete [] data;
00054 data = 0;
00055 }
00060 bool jpgOpen(string fileName);
00065 bool jpgOpen(FILE *fptr);
00067 void jpgClose();
00068
00072 SDL_Surface *LoadJPG();
00073 protected:
00075 unsigned char *data;
00076 int w,h,bytes;
00077 private:
00078 mxJpeg(const mxJpeg &);
00079 mxJpeg &operator=(const mxJpeg &);
00080
00081 };
00082
00083 }
00084
00085 #endif
00086
00087