From bfbe9e43e108f6816c17b9b7764b75284ac78313 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 14 Dec 2011 19:27:22 -0500 Subject: Re-think colors. Color is a property of light, and thus doesn't include information about transparency. But canvas pixels and object pigments represent a color and a degree of transparency. The new type dmnsn_tcolor/ TColor encapsulates that information. Also, fix the transparent shadow implementation. --- libdimension/dimension/pigment.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libdimension/dimension/pigment.h') diff --git a/libdimension/dimension/pigment.h b/libdimension/dimension/pigment.h index 716c28b..176ff28 100644 --- a/libdimension/dimension/pigment.h +++ b/libdimension/dimension/pigment.h @@ -32,8 +32,8 @@ typedef struct dmnsn_pigment dmnsn_pigment; * @param[in] v The point to color. * @return The color of the pigment at \p v. */ -typedef dmnsn_color dmnsn_pigment_fn(const dmnsn_pigment *pigment, - dmnsn_vector v); +typedef dmnsn_tcolor dmnsn_pigment_fn(const dmnsn_pigment *pigment, + dmnsn_vector v); /** * Pigment initializer callback. @@ -51,7 +51,7 @@ struct dmnsn_pigment { dmnsn_matrix trans_inv; /**< The inverse of the transformation matrix. */ /** Quick color -- used for low-quality renders. */ - dmnsn_color quick_color; + dmnsn_tcolor quick_color; /** Generic pointer. */ void *ptr; @@ -86,5 +86,5 @@ void dmnsn_pigment_initialize(dmnsn_pigment *pigment); * @param[in] v The point to color. * @return The color at \p v. */ -dmnsn_color dmnsn_pigment_evaluate(const dmnsn_pigment *pigment, - dmnsn_vector v); +dmnsn_tcolor dmnsn_pigment_evaluate(const dmnsn_pigment *pigment, + dmnsn_vector v); -- cgit v1.2.3