comparison tools/libgfx.h @ 1886:1af79412f249

Remove the stdio FILE support from libgfx API, now only DMResource is supported.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 25 Jun 2018 13:52:20 +0300
parents a20655e40e6c
children cbc911ffd21e
comparison
equal deleted inserted replaced
1885:e69de47d2419 1886:1af79412f249
100 char *fext; 100 char *fext;
101 char *name; 101 char *name;
102 int fmtid; // DM_IMGFMT_* 102 int fmtid; // DM_IMGFMT_*
103 int flags; // DM_FMT_* flags 103 int flags; // DM_FMT_* flags
104 int (*probe)(const Uint8 *buf, const size_t len); 104 int (*probe)(const Uint8 *buf, const size_t len);
105 int (*read)(const char *filename, DMImage **pimg); 105 int (*read)(DMResource *fp, DMImage **pimg);
106 int (*readFILE)(DMResource *fp, DMImage **pimg); 106 int (*write)(DMResource *fp, const DMImage *pimg, const DMImageConvSpec *spec);
107 int (*write)(const char *filename, const DMImage *pimg, const DMImageConvSpec *spec);
108 int (*writeFILE)(DMResource *fp, const DMImage *pimg, const DMImageConvSpec *spec);
109 } DMImageFormat; 107 } DMImageFormat;
110 108
111 109
112 extern const DMImageFormat dmImageFormatList[]; 110 extern const DMImageFormat dmImageFormatList[];
113 extern const int ndmImageFormatList; 111 extern const int ndmImageFormatList;
122 BOOL dmCompareColor(const DMColor *c1, const DMColor *c2, BOOL alpha); 120 BOOL dmCompareColor(const DMColor *c1, const DMColor *c2, BOOL alpha);
123 BOOL dmPaletteAlloc(DMColor **ppal, int ncolors, int ctransp); 121 BOOL dmPaletteAlloc(DMColor **ppal, int ncolors, int ctransp);
124 BOOL dmImagePaletteAlloc(DMImage *img, int ncolors, int ctransp); 122 BOOL dmImagePaletteAlloc(DMImage *img, int ncolors, int ctransp);
125 123
126 124
127 int dmWriteImageData(const DMImage *img, void *cbdata, int (*writeRowCB)(void *, const Uint8 *, const size_t), const DMImageConvSpec *spec); 125 int dmWriteImageData(const DMImage *img, void *cbdata,
126 int (*writeRowCB)(void *, const Uint8 *, const size_t), const DMImageConvSpec *spec);
128 127
129 int dmWriteRAWImageFILE(DMResource *fp, const DMImage *img, const DMImageConvSpec *spec);
130 int dmWriteRAWImage(const char *filename, const DMImage *img, const DMImageConvSpec *spec);
131 128
132 int dmWritePPMImageFILE(DMResource *fp, const DMImage *img, const DMImageConvSpec *spec); 129 int dmWriteIFFMasterRAWHeader(DMResource *fp, const char *filename, const char *prefix, const DMImage *img, const DMImageConvSpec *spec, const int fmtid);
133 int dmWritePPMImage(const char *filename, const DMImage *img, const DMImageConvSpec *spec); 130 int dmWriteRAWImage(DMResource *fp, const DMImage *img, const DMImageConvSpec *spec);
131
132 int dmWritePPMImage(DMResource *fp, const DMImage *img, const DMImageConvSpec *spec);
134 133
135 #ifdef DM_USE_LIBPNG 134 #ifdef DM_USE_LIBPNG
136 int dmWritePNGImageFILE(DMResource *fp, const DMImage *img, const DMImageConvSpec *spec); 135 int dmWritePNGImage(DMResource *fp, const DMImage *img, const DMImageConvSpec *spec);
137 int dmWritePNGImage(const char *filename, const DMImage *img, const DMImageConvSpec *spec); 136 int dmReadPNGImage(DMResource *fp, DMImage **pimg);
138 #endif 137 #endif
139 138
140 int dmWritePCXImageFILE(DMResource *fp, const DMImage *img, const DMImageConvSpec *spec); 139 int dmWritePCXImage(DMResource *fp, const DMImage *img, const DMImageConvSpec *spec);
141 int dmWritePCXImage(const char *filename, const DMImage *img, const DMImageConvSpec *spec); 140 int dmReadPCXImage(DMResource *fp, DMImage **pimg);
142 int dmReadPCXImageFILE(DMResource *fp, DMImage **pimg);
143 int dmReadPCXImage(const char *filename, DMImage **pimg);
144 141
145 int dmReadILBMImageFILE(DMResource *fp, DMImage **pimg); 142 int dmReadILBMImage(DMResource *fp, DMImage **pimg);
146 int dmReadILBMImage(const char *filename, DMImage **pimg);
147 143
148 144
149 typedef struct _DMBitStreamContext 145 typedef struct _DMBitStreamContext
150 { 146 {
151 void *handle; 147 void *handle;