From 275c2542c4e414ffe01558cfca2445dcad6bbd29 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 28 Jul 2011 12:47:10 -0600 Subject: Remove color_maps. --- libdimension-python/dimension.pxd | 4 ---- libdimension-python/dimension.pyx | 33 --------------------------------- 2 files changed, 37 deletions(-) (limited to 'libdimension-python') diff --git a/libdimension-python/dimension.pxd b/libdimension-python/dimension.pxd index 8b0ccbb..da4ac12 100644 --- a/libdimension-python/dimension.pxd +++ b/libdimension-python/dimension.pxd @@ -217,7 +217,6 @@ cdef extern from "../libdimension/dimension.h": void dmnsn_add_map_entry(dmnsn_map *map, double n, void *obj) size_t dmnsn_map_size(dmnsn_map *map) - dmnsn_map *dmnsn_new_color_map() dmnsn_map *dmnsn_new_pigment_map() ############ @@ -236,9 +235,6 @@ cdef extern from "../libdimension/dimension.h": dmnsn_pigment *dmnsn_new_solid_pigment(dmnsn_color color) dmnsn_pigment *dmnsn_new_canvas_pigment(dmnsn_canvas *canvas) - dmnsn_pigment *dmnsn_new_color_map_pigment(dmnsn_pattern *pattern, - dmnsn_map *map, - dmnsn_pigment_map_flags flags) dmnsn_pigment *dmnsn_new_pigment_map_pigment(dmnsn_pattern *pattern, dmnsn_map *map, dmnsn_pigment_map_flags flags) diff --git a/libdimension-python/dimension.pyx b/libdimension-python/dimension.pyx index dd91b0e..2cde396 100644 --- a/libdimension-python/dimension.pyx +++ b/libdimension-python/dimension.pyx @@ -617,39 +617,6 @@ cdef _Pigment(dmnsn_pigment *pigment): DMNSN_INCREF(self._pigment) return self -cdef class ColorMap(Pigment): - """A color map""" - def __init__(self, Pattern pattern not None, map, bool sRGB not None = True, - *args, **kwargs): - """ - Create a ColorMap. - - Keyword arguments: - pattern -- the pattern to use for the mapping - map -- a dictionary of the form { val1: color1, val2: color2, ... }, - or a list of the form [color1, color2, ...] - sRGB -- whether the gradients should be in sRGB or linear space - (default True) - """ - cdef dmnsn_map *color_map = dmnsn_new_color_map() - if hasattr(map, "items"): - for i, color in map.items(): - dmnsn_add_map_entry(color_map, i, &Color(color)._c) - else: - for i, color in enumerate(map): - dmnsn_add_map_entry(color_map, i/len(map), &Color(color)._c) - - cdef dmnsn_pigment_map_flags flags - if sRGB: - flags = DMNSN_PIGMENT_MAP_SRGB - else: - flags = DMNSN_PIGMENT_MAP_REGULAR - - DMNSN_INCREF(pattern._pattern) - self._pigment = dmnsn_new_color_map_pigment(pattern._pattern, color_map, - flags) - Pigment.__init__(self, *args, **kwargs) - cdef class PigmentMap(Pigment): """A pigment map.""" def __init__(self, Pattern pattern not None, map, bool sRGB not None = True, -- cgit v1.2.3