Mercurial > hg > dmlib
changeset 2458:f6278408bfae
Reorder the function prototypes, cosmetics, comments.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 16 Apr 2020 07:39:19 +0300 |
parents | 16426e9dc238 |
children | 567b4543f73b |
files | tools/libgfx.h |
diffstat | 1 files changed, 22 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/tools/libgfx.h Wed Apr 15 15:10:18 2020 +0300 +++ b/tools/libgfx.h Thu Apr 16 07:39:19 2020 +0300 @@ -148,6 +148,9 @@ } DMPaletteFormat; +// +// Global variables +// extern const DMImageFormat dmImageFormatList[]; extern const int ndmImageFormatList; extern const DMPaletteFormat dmPaletteFormatList[]; @@ -155,13 +158,9 @@ extern int dmGFXErrorMode; -DMImage * dmImageAlloc(const int width, const int height, const int format, const int bpp); -void dmImageFree(DMImage *img); -int dmImageGetBytesPerPixel(const int format); -int dmImageGetBitsPerPixel(const int format); -int dmImageProbeGeneric(const Uint8 *buf, const size_t len, const DMImageFormat **fmt, int *index); -int dmGetNPlanesFromNColors(const int ncolors); - +// +// Palette handling +// BOOL dmCompareColor(const DMColor *c1, const DMColor *c2, const BOOL alpha); int dmPaletteAlloc(DMPalette **ppal, const int ncolors, const int ctransp); int dmPaletteResize(DMPalette **ppal, const int ncolors); @@ -170,14 +169,24 @@ int dmPaletteProbeGeneric(const Uint8 *buf, const size_t len, const DMPaletteFormat **fmt, int *index); -int dmReadACTPalette(DMResource *fp, DMPalette **pdst); -int dmWriteACTPalette(DMResource *fp, const DMPalette *pdst); -int dmReadRAWPalette(DMResource *fp, DMPalette **pdst); -int dmWriteRAWPalette(DMResource *fp, const DMPalette *ppal); +int dmReadACTPalette(DMResource *fp, DMPalette **pdst); +int dmWriteACTPalette(DMResource *fp, const DMPalette *pdst); +int dmReadRAWPalette(DMResource *fp, DMPalette **pdst); +int dmWriteRAWPalette(DMResource *fp, const DMPalette *ppal); -int dmWriteImageData(const DMImage *img, void *cbdata, - int (*writeRowCB)(void *, const Uint8 *, const size_t), const DMImageWriteSpec *spec); +// +// Image formats +// +DMImage * dmImageAlloc(const int width, const int height, const int format, const int bpp); +void dmImageFree(DMImage *img); +int dmImageGetBytesPerPixel(const int format); +int dmImageGetBitsPerPixel(const int format); +int dmImageProbeGeneric(const Uint8 *buf, const size_t len, const DMImageFormat **fmt, int *index); +int dmGetNPlanesFromNColors(const int ncolors); + +int dmWriteImageData(const DMImage *img, void *cbdata, + int (*writeRowCB)(void *, const Uint8 *, const size_t), const DMImageWriteSpec *spec); int dmWriteIFFMasterRAWHeader(DMResource *fp, const char *filename, const char *prefix, const DMImage *img, const DMImageWriteSpec *spec);