summaryrefslogtreecommitdiffstats
path: root/libdimension/map.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-11-23 13:14:16 -0500
committerTavian Barnes <tavianator@gmail.com>2010-11-23 13:14:16 -0500
commitd6cfecdc224e95f1379f918d642074eada40627f (patch)
treea51324383ad8f1cf5d968ba41690d1f7ac7cbad5 /libdimension/map.c
parentb49cf79b57af160ba190fea76d7143cce3428985 (diff)
downloaddimension-d6cfecdc224e95f1379f918d642074eada40627f.tar.xz
Implement pigment maps.
Diffstat (limited to 'libdimension/map.c')
-rw-r--r--libdimension/map.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libdimension/map.c b/libdimension/map.c
index 3ea4b0c..ba1adb6 100644
--- a/libdimension/map.c
+++ b/libdimension/map.c
@@ -124,3 +124,12 @@ dmnsn_evaluate_map(const dmnsn_map *map, double n,
memcpy(obj1, o2, map->obj_size);
memcpy(obj2, o2, map->obj_size);
}
+
+void
+dmnsn_map_apply(dmnsn_map *map, dmnsn_callback_fn *callback)
+{
+ for (size_t i = 0; i < dmnsn_array_size(map->array); ++i) {
+ dmnsn_map_entry *entry = dmnsn_array_at(map->array, i);
+ (*callback)(entry->object);
+ }
+}