# HG changeset patch # User Matti Hamalainen # Date 1352733693 -7200 # Node ID b89598501cec5d3b186071b3e709a5a6f4444bbd # Parent cb61c44f784637b275ab94e808536a398a67605a Move dmCompareColor() to libgfx. diff -r cb61c44f7846 -r b89598501cec gfxconv.c --- a/gfxconv.c Sun Nov 11 14:36:17 2012 +0200 +++ b/gfxconv.c Mon Nov 12 17:21:33 2012 +0200 @@ -753,16 +753,6 @@ } #endif -BOOL dmCompareColor(const DMColor *c1, const DMColor *c2, BOOL alpha) -{ - if (c1->r == c2->r && - c1->g == c2->g && - c1->b == c2->b) - return alpha ? (c1->a == c2->a) : TRUE; - else - return FALSE; -} - int dmRemapImageColors(DMImage *image) { diff -r cb61c44f7846 -r b89598501cec libgfx.c --- a/libgfx.c Sun Nov 11 14:36:17 2012 +0200 +++ b/libgfx.c Mon Nov 12 17:21:33 2012 +0200 @@ -15,6 +15,17 @@ #endif +BOOL dmCompareColor(const DMColor *c1, const DMColor *c2, BOOL alpha) +{ + if (c1->r == c2->r && + c1->g == c2->g && + c1->b == c2->b) + return alpha ? (c1->a == c2->a) : TRUE; + else + return FALSE; +} + + DMImage * dmImageAlloc(int width, int height) { DMImage *img = dmCalloc(1, sizeof(DMImage)); diff -r cb61c44f7846 -r b89598501cec libgfx.h --- a/libgfx.h Sun Nov 11 14:36:17 2012 +0200 +++ b/libgfx.h Mon Nov 12 17:21:33 2012 +0200 @@ -90,6 +90,8 @@ int dmImageGetBytesPerPixel(int format); int dmImageProbeGeneric(const Uint8 *buf, const size_t len, DMImageFormat **fmt, int *index); +BOOL dmCompareColor(const DMColor *c1, const DMColor *c2, BOOL alpha); + int dmWriteImageData(DMImage *img, void *cbdata, BOOL (*writeRowCB)(void *, Uint8 *, size_t), const DMImageSpec *spec);