1. David Jones
  2. c-experiments

Commits

David Jones  committed 52c6311

added comments.

  • Participants
  • Parent commits c63b827
  • Branches default

Comments (0)

Files changed (1)

File color.h

View file
  • Ignore whitespace
 #ifndef HEADER_GUARD_COLOR_H
 #define HEADER_GUARD_COLOR_H
 
-
+/* 
+   Data structure to hold rgb values for a color.  
+   Functions to manipulate data are provided.
+*/
+   
 typedef struct
 {
   float r;
   float b;
 } Color;
 
+
+/* Add color a to b and store in x */
 void
 color_add(Color * a, Color *b, 
           Color *x);
 
+/* clear the color */
 void
 color_clear(Color * x);
 
-
+/* Multiply the color by a scalar (intensity?) */
 void 
 color_scalar_mult(Color * a, float b, Color *x);
 
+/* Multiply two colors, effectively changing the intensity of the
+   components individualy.
+   a * b -> x
+*/
 void 
 color_mult(Color * a, Color *b, Color *x);
 
+/* Force the colors values to be inside a valid range. */
 void 
 color_truncate(Color *a);