summaryrefslogtreecommitdiffstats
path: root/libdimension/dimension/camera.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-11-14 21:20:43 -0500
committerTavian Barnes <tavianator@gmail.com>2010-11-14 21:20:43 -0500
commit8fe33a340b8979a73fa84f201c15519a9b5d0266 (patch)
tree12cdbb1c1b9a48f533ab36980602785be1e1deeb /libdimension/dimension/camera.h
parent20a55aa78050d94b187d4edfaac91ea00efea505 (diff)
downloaddimension-8fe33a340b8979a73fa84f201c15519a9b5d0266.tar.xz
Document libdimension with Doxygen.
Diffstat (limited to 'libdimension/dimension/camera.h')
-rw-r--r--libdimension/dimension/camera.h40
1 files changed, 34 insertions, 6 deletions
diff --git a/libdimension/dimension/camera.h b/libdimension/dimension/camera.h
index e95ad18..e63cd80 100644
--- a/libdimension/dimension/camera.h
+++ b/libdimension/dimension/camera.h
@@ -18,8 +18,9 @@
* <http://www.gnu.org/licenses/>. *
*************************************************************************/
-/*
- * A camera.
+/**
+ * @file
+ * Cameras.
*/
#ifndef DIMENSION_CAMERA_H
@@ -28,20 +29,47 @@
/* Forward-declare dmnsn_camera */
typedef struct dmnsn_camera dmnsn_camera;
-/* Camera callback types */
+/**
+ * Camera ray callback.
+ * @param[in] camera The camera itself.
+ * @param[in] x The x coordinate of the pixel (in [0, 1]).
+ * @param[in] y The y coordinate of the pixel (in [0, 1]).
+ * @return The ray through (\p x, \p y).
+ */
typedef dmnsn_line dmnsn_camera_ray_fn(const dmnsn_camera *camera,
double x, double y);
+/** A camera. */
struct dmnsn_camera {
/* Callback functions */
- dmnsn_camera_ray_fn *ray_fn;
- dmnsn_free_fn *free_fn;
+ dmnsn_camera_ray_fn *ray_fn; /**< Camera ray callback. */
+ dmnsn_free_fn *free_fn; /**< Destructor callback. */
+
+ dmnsn_matrix trans; /**< Transformation matrix. */
- /* Generic pointer for camera info */
+ /** Generic pointer for camera info */
void *ptr;
};
+/**
+ * Create a dummy camera.
+ * @return The allocated camera.
+ */
dmnsn_camera *dmnsn_new_camera(void);
+
+/**
+ * Delete a camera.
+ * @param[in,out] camera The camera to delete.
+ */
void dmnsn_delete_camera(dmnsn_camera *camera);
+/**
+ * Invoke the camera ray callback, then correctly transform the ray.
+ * @param[in] camera The camera itself.
+ * @param[in] x The x coordinate of the pixel (in [0, 1]).
+ * @param[in] y The y coordinate of the pixel (in [0, 1]).
+ * @return The ray through (\p x, \p y).
+ */
+dmnsn_line dmnsn_camera_ray(const dmnsn_camera *camera, double x, double y);
+
#endif /* DIMENSION_CAMERA_H */