~amavect/makeu

makeu/fns.h -rw-r--r-- 715 bytes
8a2a5c28amavect revise error exiting, allocation errors 1 year, 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
typedef struct RGBd RGBd;
typedef struct HSVd HSVd;
typedef struct Ratioxy Ratioxy;

struct RGBd{
	double red;
	double green;
	double blue;
};

struct HSVd{
	double hue; /* hue [0,6] */
	double sat; /* saturation [0,1] */
	double val; /* value [0,1] */
};

struct Ratioxy{
	double x;
	double y;
};

/* color funcs */
ulong unsetalpha(ulong);
void colortoarray(uchar col[3], ulong);
RGBd torgbd(RGB);
RGB torgb(RGBd);
RGB colortorgb(ulong);
ulong rgbtocolor(RGB);
RGBd hsvdtorgbd(HSVd);
HSVd rgbdtohsvd(RGBd);
HSVd rgbtohsvd(RGB);
RGB hsvdtorgb(HSVd);
ulong strtocolor(char *str);

/* util */
Point ptclip(Point, Rectangle);
void error(char*);
Image *eallocimage(Rectangle, ulong, int, ulong);
void *emalloc(ulong);