Mercurial > hg > dmlib
comparison gfxconv.c @ 487:b89598501cec
Move dmCompareColor() to libgfx.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 12 Nov 2012 17:21:33 +0200 |
parents | f119ebe3ad25 |
children | 49f0ce2cc347 |
comparison
equal
deleted
inserted
replaced
486:cb61c44f7846 | 487:b89598501cec |
---|---|
751 | 751 |
752 return 0; | 752 return 0; |
753 } | 753 } |
754 #endif | 754 #endif |
755 | 755 |
756 BOOL dmCompareColor(const DMColor *c1, const DMColor *c2, BOOL alpha) | |
757 { | |
758 if (c1->r == c2->r && | |
759 c1->g == c2->g && | |
760 c1->b == c2->b) | |
761 return alpha ? (c1->a == c2->a) : TRUE; | |
762 else | |
763 return FALSE; | |
764 } | |
765 | |
766 | 756 |
767 int dmRemapImageColors(DMImage *image) | 757 int dmRemapImageColors(DMImage *image) |
768 { | 758 { |
769 DMColor *npal = dmCalloc(image->ncolors, sizeof(DMColor)); | 759 DMColor *npal = dmCalloc(image->ncolors, sizeof(DMColor)); |
770 int *mapping = dmMalloc(image->ncolors * sizeof(int)); | 760 int *mapping = dmMalloc(image->ncolors * sizeof(int)); |