color.h
Go to the documentation of this file.
1 #ifndef COLORH
2 #define COLORH
3 
4 #include "boolean.h"
5 
6 #include <stdio.h>
7 
23 typedef struct {
24  double r;
25  double g;
26  double b;
27 } Tcolor;
28 
29 
40 void NewColor(double r,double g,double b,Tcolor *c);
41 
42 
51 void CopyColor(Tcolor *c_dst,Tcolor *c_src);
52 
66 boolean NullColor(Tcolor *c);
67 
78 void ScaleColor(double s,Tcolor *c);
79 
94 void CostColor(double cost,double minCost,Tcolor *c);
95 
104 void SetRed(double r,Tcolor *c);
105 
114 void SetGreen(double g,Tcolor *c);
115 
124 void SetBlue(double b,Tcolor *c);
125 
134 double GetRed(Tcolor *c);
135 
144 double GetGreen(Tcolor *c);
145 
154 double GetBlue(Tcolor *c);
155 
170 void PrintColor(FILE *f,Tcolor *c);
171 
179 void DeleteColor(Tcolor *c);
180 
181 #endif
182 
Definition of the boolean type.
void CopyColor(Tcolor *c_dst, Tcolor *c_src)
Copy constructor.
Definition: color.c:21
double b
Definition: color.h:26
double GetRed(Tcolor *c)
Gets the red component of a color.
Definition: color.c:73
A color.
Definition: color.h:23
double GetBlue(Tcolor *c)
Gets the blue component of a color.
Definition: color.c:83
double g
Definition: color.h:25
double GetGreen(Tcolor *c)
Gets the green component of a color.
Definition: color.c:78
boolean NullColor(Tcolor *c)
Identifies a non-valid color.
Definition: color.c:28
void DeleteColor(Tcolor *c)
Destructor.
Definition: color.c:93
void NewColor(double r, double g, double b, Tcolor *c)
Constructor.
Definition: color.c:14
double r
Definition: color.h:24
void CostColor(double cost, double minCost, Tcolor *c)
Definees a color in function of a cost.
Definition: color.c:40
void ScaleColor(double s, Tcolor *c)
Scales a color.
Definition: color.c:33
void SetBlue(double b, Tcolor *c)
Changes the blue component of a color.
Definition: color.c:68
void SetRed(double r, Tcolor *c)
Changes the red component of a color.
Definition: color.c:58
void PrintColor(FILE *f, Tcolor *c)
Prints the color.
Definition: color.c:88
void SetGreen(double g, Tcolor *c)
Changes the green component of a color.
Definition: color.c:63