color.c File Reference
Implementation of the functions operating on Tcolor.
More...
#include "color.h"
Go to the source code of this file.
Detailed Description
Implementation of the functions working on colors as red/green/blue components.
- See also:
- Tcolor, color.h.
Definition in file color.c.
Function Documentation
void NewColor |
( |
double |
r, |
|
|
double |
g, |
|
|
double |
b, |
|
|
Tcolor * |
c | |
|
) |
| | |
Creates new color.
- Parameters:
-
| r | The red component for the new color. |
| g | The green component for the new color. |
| b | The blue component for the new color. |
| c | The color to intialize. |
Definition at line 14 of file color.c.
References Tcolor::b, Tcolor::g, and Tcolor::r.
Referenced by InitPlot3d(), main(), NewFixJoint(), NewFreeJoint(), NewPrismaticJoint(), NewRevoluteJoint(), NewSphericalJoint(), NewUniversalJoint(), and PlotLink().
Creates new color from another color.
- Parameters:
-
| c_dst | The color to create. |
| c_src | The color from where to copy. |
Definition at line 21 of file color.c.
References Tcolor::b, Tcolor::g, and Tcolor::r.
Referenced by CopyCPolyhedron(), CopyJoint(), GetCPolyhedronColor(), InitCPolyhedronFromFile(), NewCylinder(), NewSphere(), NewSphSphJoint(), SetCPolyhedronColor(), and StartNew3dObject().
void SetRed |
( |
double |
r, |
|
|
Tcolor * |
c | |
|
) |
| | |
Changes the red component of a color.
- Parameters:
-
| r | The new red component. |
| c | The color to update. |
Definition at line 28 of file color.c.
References Tcolor::r.
void SetGreen |
( |
double |
g, |
|
|
Tcolor * |
c | |
|
) |
| | |
Changes the green component of a color.
- Parameters:
-
| g | The new green component. |
| c | The color to update. |
Definition at line 33 of file color.c.
References Tcolor::g.
void SetBlue |
( |
double |
b, |
|
|
Tcolor * |
c | |
|
) |
| | |
Changes the blue component of a color.
- Parameters:
-
| b | The new blue component. |
| c | The color to update. |
Definition at line 38 of file color.c.
References Tcolor::b.
Gets the red component of a color.
- Parameters:
-
- Returns:
- The red component of the color.
Definition at line 43 of file color.c.
References Tcolor::r.
double GetGreen |
( |
Tcolor * |
c |
) |
|
Gets the green component of a color.
- Parameters:
-
- Returns:
- The green component of the color.
Definition at line 48 of file color.c.
References Tcolor::r.
Gets the blue component of a color.
- Parameters:
-
- Returns:
- The blue component of the color.
Definition at line 53 of file color.c.
References Tcolor::r.
void PrintColor |
( |
FILE * |
f, |
|
|
Tcolor * |
c | |
|
) |
| | |
Prints the three components of a color in a file.
The componts (red, blue, and green) are printed as doubles, without any separation mark. This is the way in which Geomview uses colors.
- See also:
- plot3d.h, Tplot3d.
- Parameters:
-
| f | The file where to write the color |
| c | The color to print. |
Definition at line 58 of file color.c.
References Tcolor::b, Tcolor::g, and Tcolor::r.
Referenced by PlotVect3d(), and SetColor3dObject().
void DeleteColor |
( |
Tcolor * |
c |
) |
|
Deletes the information stored in a Tcolor and frees the allocated memory, if any.
- Parameters:
-
Definition at line 63 of file color.c.
Referenced by main(), and PlotLink().
|