summaryrefslogtreecommitdiffstats
path: root/libdimension/dimension
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-03-01 23:43:56 +0000
committerTavian Barnes <tavianator@gmail.com>2009-03-01 23:43:56 +0000
commit5ac6158f8ff999d4db18fb805c02b5c733e75ddb (patch)
treec595048bae6b2860ef5264e1096eaac8c25b7f52 /libdimension/dimension
parentef4dbe789201bcb92596a67eb3fb3f3f03a09b49 (diff)
downloaddimension-5ac6158f8ff999d4db18fb805c02b5c733e75ddb.tar.xz
Use CIE xyY internally, rather than CIE XYZ.
Diffstat (limited to 'libdimension/dimension')
-rw-r--r--libdimension/dimension/canvas.h4
-rw-r--r--libdimension/dimension/color.h15
2 files changed, 10 insertions, 9 deletions
diff --git a/libdimension/dimension/canvas.h b/libdimension/dimension/canvas.h
index 251c64a..8959e12 100644
--- a/libdimension/dimension/canvas.h
+++ b/libdimension/dimension/canvas.h
@@ -27,8 +27,8 @@
/* 48-bit sRGB color for pixels. */
typedef struct {
- uint16_t r, g, b;
- uint16_t a, t;
+ uint16_t r, g, b; /* Red, green, blue */
+ uint16_t a, t; /* Filtered transparancy, normal transparancy */
} dmnsn_pixel;
dmnsn_pixel dmnsn_pixel_from_color(dmnsn_color color);
diff --git a/libdimension/dimension/color.h b/libdimension/dimension/color.h
index 1f4a42e..34668e3 100644
--- a/libdimension/dimension/color.h
+++ b/libdimension/dimension/color.h
@@ -29,14 +29,15 @@
extern "C" {
#endif
-/* CIE 1931 XYZ color. */
+/* CIE 1931 xyY color. */
typedef struct {
- double X, Y, Z; /* X, Y, and Z are the tristimulus values of a color in CIE
- 1931 XYZ color space. We use an unlimited light model
- here, where the range of X, Y, and Z are unbounded >= 0. */
- double alpha, trans; /* Alpha transparancy only lets light of this color
- through; regular transparancy lets all colors
- through */
+ double x, y, Y; /* x and y are chromaticity coordinates, and Y is luminance,
+ in the CIE 1931 xyZ color space. We use an unlimited light
+ model, so x,y in [0, 1] and Y >= 0, with 1 = diffuse
+ white */
+ double filter, trans; /* Filter transparancy only lets light of this color
+ through; regular transparancy lets all colors
+ through */
} dmnsn_color;
#ifdef __cplusplus