1/*
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 *
6 * Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
7 */
8
9#ifndef _COLOR_H
10#define _COLOR_H
11typedef unsigned int color;
12
13mal_export str CLRstr(str *val, const color *c);
14mal_export str CLRcolor(color *c, const char **val);
15mal_export str CLRred(int *r, const color *c);
16mal_export str CLRgreen(int *g, const color *c);
17mal_export str CLRblue(int *b, const color *c);
18mal_export str CLRhue(flt *r, const color *c);
19mal_export str CLRsaturation(flt *g, const color *c);
20mal_export str CLRvalue(flt *b, const color *c);
21mal_export str CLRhueInt(int *r, const color *c);
22mal_export str CLRsaturationInt(int *g, const color *c);
23mal_export str CLRvalueInt(int *b, const color *c);
24mal_export str CLRluminance(int *r, const color *c);
25mal_export str CLRcr(int *r, const color *c);
26mal_export str CLRcb(int *g, const color *c);
27mal_export str CLRhsv(color *c, const flt *h, const flt *s, const flt *v);
28mal_export str CLRrgb(color *rgb, const int *r, const int *g, const int *b);
29mal_export str CLRycc(color *c, const int *y, const int *cr, const int *cb);
30mal_export ssize_t color_fromstr(const char *colorStr, size_t *len, color **c, bool external);
31mal_export ssize_t color_tostr(char **colorStr, size_t *len, const color *c, bool external);
32
33#define color_nil ((color)int_nil)
34#define is_color_nil(v) is_int_nil((int) (v))
35
36#endif
37