summaryrefslogtreecommitdiffstats
path: root/libdimension
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-06-27 04:31:59 +0000
committerTavian Barnes <tavianator@gmail.com>2009-06-27 04:31:59 +0000
commitc4ce1e79e2f528623db4760ad864f4d68062cace (patch)
treeb20206e5b02d39eec9e033d8a1bfa851b0070cf8 /libdimension
parent3e6e49ed8c93fab4fe36e5f624700aec76263d4f (diff)
downloaddimension-c4ce1e79e2f528623db4760ad864f4d68062cace.tar.xz
Wrote more documentation.
Diffstat (limited to 'libdimension')
-rw-r--r--libdimension/dimension/canvas.h1
-rw-r--r--libdimension/dimension/color.h2
-rw-r--r--libdimension/dimension/geometry.h2
-rw-r--r--libdimension/geometry.c8
4 files changed, 12 insertions, 1 deletions
diff --git a/libdimension/dimension/canvas.h b/libdimension/dimension/canvas.h
index cd414a9..269763b 100644
--- a/libdimension/dimension/canvas.h
+++ b/libdimension/dimension/canvas.h
@@ -26,6 +26,7 @@
#define DIMENSION_CANVAS_H
typedef struct {
+ /* width, height */
unsigned int x, y;
/*
diff --git a/libdimension/dimension/color.h b/libdimension/dimension/color.h
index f1964c3..7095f88 100644
--- a/libdimension/dimension/color.h
+++ b/libdimension/dimension/color.h
@@ -60,7 +60,7 @@ typedef struct {
double R, G, B; /* sRGB R, G, and B values */
} dmnsn_sRGB;
-/* Standard whitepoint, determined by the conversion of sRGB white to XYZ */
+/* Standard whitepoint, determined by the conversion of sRGB white to CIE XYZ */
extern const dmnsn_CIE_XYZ dmnsn_whitepoint;
/* Color conversions */
diff --git a/libdimension/dimension/geometry.h b/libdimension/dimension/geometry.h
index c635fd9..9ddfbd9 100644
--- a/libdimension/dimension/geometry.h
+++ b/libdimension/dimension/geometry.h
@@ -52,6 +52,8 @@ dmnsn_matrix dmnsn_translation_matrix(dmnsn_vector d);
/* Left-handed rotation; theta/|theta| = axis, |theta| = angle */
dmnsn_matrix dmnsn_rotation_matrix(dmnsn_vector theta);
+dmnsn_line dmnsn_line_construct(dmnsn_vector x0, dmnsn_vector n);
+
/* Vector and matrix arithmetic */
dmnsn_vector dmnsn_vector_add(dmnsn_vector lhs, dmnsn_vector rhs);
diff --git a/libdimension/geometry.c b/libdimension/geometry.c
index 2446613..8008224 100644
--- a/libdimension/geometry.c
+++ b/libdimension/geometry.c
@@ -104,6 +104,14 @@ dmnsn_rotation_matrix(dmnsn_vector theta)
);
}
+/* Construct a line */
+dmnsn_line
+dmnsn_line_construct(dmnsn_vector x0, dmnsn_vector n)
+{
+ dmnsn_line l = { .x0 = x0, .n = n };
+ return l;
+}
+
/* Add two vectors */
dmnsn_vector
dmnsn_vector_add(dmnsn_vector lhs, dmnsn_vector rhs)