diff options
author | Tavian Barnes <tavianator@gmail.com> | 2010-11-23 13:14:16 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2010-11-23 13:14:16 -0500 |
commit | d6cfecdc224e95f1379f918d642074eada40627f (patch) | |
tree | a51324383ad8f1cf5d968ba41690d1f7ac7cbad5 /libdimension/map.c | |
parent | b49cf79b57af160ba190fea76d7143cce3428985 (diff) | |
download | dimension-d6cfecdc224e95f1379f918d642074eada40627f.tar.xz |
Implement pigment maps.
Diffstat (limited to 'libdimension/map.c')
-rw-r--r-- | libdimension/map.c | 9 |
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); + } +} |