From: <jd...@us...> - 2007-07-18 20:38:34
|
Revision: 3566 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3566&view=rev Author: jdh2358 Date: 2007-07-18 13:38:32 -0700 (Wed, 18 Jul 2007) Log Message: ----------- added mpl1 sketch Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/agg.py trunk/matplotlib/lib/matplotlib/axes.py trunk/matplotlib/makeswig.py trunk/matplotlib/src/agg.cxx trunk/matplotlib/src/swig_runtime.h trunk/matplotlib/swig/agg.i Added Paths: ----------- trunk/matplotlib/mpl1/ trunk/matplotlib/mpl1/mpl1.py trunk/matplotlib/mpl1/mtraits.py Modified: trunk/matplotlib/lib/matplotlib/agg.py =================================================================== --- trunk/matplotlib/lib/matplotlib/agg.py 2007-07-18 17:21:11 UTC (rev 3565) +++ trunk/matplotlib/lib/matplotlib/agg.py 2007-07-18 20:38:32 UTC (rev 3566) @@ -1,10 +1,16 @@ -# This file was created automatically by SWIG 1.3.30. +# This file was automatically generated by SWIG (http://www.swig.org). +# Version 1.3.31 +# # Don't modify this file, modify the SWIG interface instead. # This file is compatible with both classic and new-style classes. import _agg import new new_instancemethod = new.instancemethod +try: + _swig_property = property +except NameError: + pass # Python < 2.2 doesn't have 'property'. def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "thisown"): return self.this.own(value) if (name == "this"): @@ -90,11 +96,11 @@ __repr__ = _swig_repr __swig_setmethods__["x"] = _agg.point_type_x_set __swig_getmethods__["x"] = _agg.point_type_x_get - if _newclass:x = property(_agg.point_type_x_get, _agg.point_type_x_set) + if _newclass:x = _swig_property(_agg.point_type_x_get, _agg.point_type_x_set) __swig_setmethods__["y"] = _agg.point_type_y_set __swig_getmethods__["y"] = _agg.point_type_y_get - if _newclass:y = property(_agg.point_type_y_get, _agg.point_type_y_set) - def __init__(self, *args): + if _newclass:y = _swig_property(_agg.point_type_y_get, _agg.point_type_y_set) + def __init__(self, *args): this = _agg.new_point_type(*args) try: self.this.append(this) except: self.this = this @@ -113,14 +119,14 @@ __repr__ = _swig_repr __swig_setmethods__["x"] = _agg.vertex_type_x_set __swig_getmethods__["x"] = _agg.vertex_type_x_get - if _newclass:x = property(_agg.vertex_type_x_get, _agg.vertex_type_x_set) + if _newclass:x = _swig_property(_agg.vertex_type_x_get, _agg.vertex_type_x_set) __swig_setmethods__["y"] = _agg.vertex_type_y_set __swig_getmethods__["y"] = _agg.vertex_type_y_get - if _newclass:y = property(_agg.vertex_type_y_get, _agg.vertex_type_y_set) + if _newclass:y = _swig_property(_agg.vertex_type_y_get, _agg.vertex_type_y_set) __swig_setmethods__["cmd"] = _agg.vertex_type_cmd_set __swig_getmethods__["cmd"] = _agg.vertex_type_cmd_get - if _newclass:cmd = property(_agg.vertex_type_cmd_get, _agg.vertex_type_cmd_set) - def __init__(self, *args): + if _newclass:cmd = _swig_property(_agg.vertex_type_cmd_get, _agg.vertex_type_cmd_set) + def __init__(self, *args): this = _agg.new_vertex_type(*args) try: self.this.append(this) except: self.this = this @@ -137,17 +143,17 @@ __repr__ = _swig_repr __swig_setmethods__["x1"] = _agg.rect_x1_set __swig_getmethods__["x1"] = _agg.rect_x1_get - if _newclass:x1 = property(_agg.rect_x1_get, _agg.rect_x1_set) + if _newclass:x1 = _swig_property(_agg.rect_x1_get, _agg.rect_x1_set) __swig_setmethods__["y1"] = _agg.rect_y1_set __swig_getmethods__["y1"] = _agg.rect_y1_get - if _newclass:y1 = property(_agg.rect_y1_get, _agg.rect_y1_set) + if _newclass:y1 = _swig_property(_agg.rect_y1_get, _agg.rect_y1_set) __swig_setmethods__["x2"] = _agg.rect_x2_set __swig_getmethods__["x2"] = _agg.rect_x2_get - if _newclass:x2 = property(_agg.rect_x2_get, _agg.rect_x2_set) + if _newclass:x2 = _swig_property(_agg.rect_x2_get, _agg.rect_x2_set) __swig_setmethods__["y2"] = _agg.rect_y2_set __swig_getmethods__["y2"] = _agg.rect_y2_get - if _newclass:y2 = property(_agg.rect_y2_get, _agg.rect_y2_set) - def __init__(self, *args): + if _newclass:y2 = _swig_property(_agg.rect_y2_get, _agg.rect_y2_set) + def __init__(self, *args): this = _agg.new_rect(*args) try: self.this.append(this) except: self.this = this @@ -167,17 +173,17 @@ __repr__ = _swig_repr __swig_setmethods__["x1"] = _agg.rect_d_x1_set __swig_getmethods__["x1"] = _agg.rect_d_x1_get - if _newclass:x1 = property(_agg.rect_d_x1_get, _agg.rect_d_x1_set) + if _newclass:x1 = _swig_property(_agg.rect_d_x1_get, _agg.rect_d_x1_set) __swig_setmethods__["y1"] = _agg.rect_d_y1_set __swig_getmethods__["y1"] = _agg.rect_d_y1_get - if _newclass:y1 = property(_agg.rect_d_y1_get, _agg.rect_d_y1_set) + if _newclass:y1 = _swig_property(_agg.rect_d_y1_get, _agg.rect_d_y1_set) __swig_setmethods__["x2"] = _agg.rect_d_x2_set __swig_getmethods__["x2"] = _agg.rect_d_x2_get - if _newclass:x2 = property(_agg.rect_d_x2_get, _agg.rect_d_x2_set) + if _newclass:x2 = _swig_property(_agg.rect_d_x2_get, _agg.rect_d_x2_set) __swig_setmethods__["y2"] = _agg.rect_d_y2_set __swig_getmethods__["y2"] = _agg.rect_d_y2_get - if _newclass:y2 = property(_agg.rect_d_y2_get, _agg.rect_d_y2_set) - def __init__(self, *args): + if _newclass:y2 = _swig_property(_agg.rect_d_y2_get, _agg.rect_d_y2_set) + def __init__(self, *args): this = _agg.new_rect_d(*args) try: self.this.append(this) except: self.this = this @@ -201,11 +207,11 @@ __repr__ = _swig_repr __swig_setmethods__["size"] = _agg.binary_data_size_set __swig_getmethods__["size"] = _agg.binary_data_size_get - if _newclass:size = property(_agg.binary_data_size_get, _agg.binary_data_size_set) + if _newclass:size = _swig_property(_agg.binary_data_size_get, _agg.binary_data_size_set) __swig_setmethods__["data"] = _agg.binary_data_data_set __swig_getmethods__["data"] = _agg.binary_data_data_get - if _newclass:data = property(_agg.binary_data_data_get, _agg.binary_data_data_set) - def __init__(self, *args): + if _newclass:data = _swig_property(_agg.binary_data_data_get, _agg.binary_data_data_set) + def __init__(self, *args): this = _agg.new_binary_data(*args) try: self.this.append(this) except: self.this = this @@ -220,7 +226,7 @@ __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, buffer, name) __repr__ = _swig_repr - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_buffer(*args) try: self.this.append(this) except: self.this = this @@ -228,17 +234,17 @@ __del__ = lambda self : None; def to_string(*args): return _agg.buffer_to_string(*args) __swig_getmethods__["width"] = _agg.buffer_width_get - if _newclass:width = property(_agg.buffer_width_get) + if _newclass:width = _swig_property(_agg.buffer_width_get) __swig_getmethods__["height"] = _agg.buffer_height_get - if _newclass:height = property(_agg.buffer_height_get) + if _newclass:height = _swig_property(_agg.buffer_height_get) __swig_getmethods__["stride"] = _agg.buffer_stride_get - if _newclass:stride = property(_agg.buffer_stride_get) + if _newclass:stride = _swig_property(_agg.buffer_stride_get) __swig_setmethods__["data"] = _agg.buffer_data_set __swig_getmethods__["data"] = _agg.buffer_data_get - if _newclass:data = property(_agg.buffer_data_get, _agg.buffer_data_set) + if _newclass:data = _swig_property(_agg.buffer_data_get, _agg.buffer_data_set) __swig_setmethods__["freemem"] = _agg.buffer_freemem_set __swig_getmethods__["freemem"] = _agg.buffer_freemem_get - if _newclass:freemem = property(_agg.buffer_freemem_get, _agg.buffer_freemem_set) + if _newclass:freemem = _swig_property(_agg.buffer_freemem_get, _agg.buffer_freemem_set) buffer_swigregister = _agg.buffer_swigregister buffer_swigregister(buffer) @@ -252,7 +258,7 @@ G = _agg.order_rgb_G B = _agg.order_rgb_B rgb_tag = _agg.order_rgb_rgb_tag - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_order_rgb(*args) try: self.this.append(this) except: self.this = this @@ -271,7 +277,7 @@ G = _agg.order_bgr_G R = _agg.order_bgr_R rgb_tag = _agg.order_bgr_rgb_tag - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_order_bgr(*args) try: self.this.append(this) except: self.this = this @@ -291,7 +297,7 @@ B = _agg.order_rgba_B A = _agg.order_rgba_A rgba_tag = _agg.order_rgba_rgba_tag - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_order_rgba(*args) try: self.this.append(this) except: self.this = this @@ -311,7 +317,7 @@ G = _agg.order_argb_G B = _agg.order_argb_B rgba_tag = _agg.order_argb_rgba_tag - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_order_argb(*args) try: self.this.append(this) except: self.this = this @@ -331,7 +337,7 @@ G = _agg.order_abgr_G R = _agg.order_abgr_R rgba_tag = _agg.order_abgr_rgba_tag - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_order_abgr(*args) try: self.this.append(this) except: self.this = this @@ -351,7 +357,7 @@ R = _agg.order_bgra_R A = _agg.order_bgra_A rgba_tag = _agg.order_bgra_rgba_tag - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_order_bgra(*args) try: self.this.append(this) except: self.this = this @@ -368,16 +374,16 @@ __repr__ = _swig_repr __swig_setmethods__["r"] = _agg.rgba_r_set __swig_getmethods__["r"] = _agg.rgba_r_get - if _newclass:r = property(_agg.rgba_r_get, _agg.rgba_r_set) + if _newclass:r = _swig_property(_agg.rgba_r_get, _agg.rgba_r_set) __swig_setmethods__["g"] = _agg.rgba_g_set __swig_getmethods__["g"] = _agg.rgba_g_get - if _newclass:g = property(_agg.rgba_g_get, _agg.rgba_g_set) + if _newclass:g = _swig_property(_agg.rgba_g_get, _agg.rgba_g_set) __swig_setmethods__["b"] = _agg.rgba_b_set __swig_getmethods__["b"] = _agg.rgba_b_get - if _newclass:b = property(_agg.rgba_b_get, _agg.rgba_b_set) + if _newclass:b = _swig_property(_agg.rgba_b_get, _agg.rgba_b_set) __swig_setmethods__["a"] = _agg.rgba_a_set __swig_getmethods__["a"] = _agg.rgba_a_get - if _newclass:a = property(_agg.rgba_a_get, _agg.rgba_a_set) + if _newclass:a = _swig_property(_agg.rgba_a_get, _agg.rgba_a_set) def clear(*args): return _agg.rgba_clear(*args) def transparent(*args): return _agg.rgba_transparent(*args) def opacity(*args): return _agg.rgba_opacity(*args) @@ -388,7 +394,7 @@ if _newclass:no_color = staticmethod(_agg.rgba_no_color) __swig_getmethods__["from_wavelength"] = lambda x: _agg.rgba_from_wavelength if _newclass:from_wavelength = staticmethod(_agg.rgba_from_wavelength) - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_rgba(*args) try: self.this.append(this) except: self.this = this @@ -410,17 +416,17 @@ base_mask = _agg.rgba8_base_mask __swig_setmethods__["r"] = _agg.rgba8_r_set __swig_getmethods__["r"] = _agg.rgba8_r_get - if _newclass:r = property(_agg.rgba8_r_get, _agg.rgba8_r_set) + if _newclass:r = _swig_property(_agg.rgba8_r_get, _agg.rgba8_r_set) __swig_setmethods__["g"] = _agg.rgba8_g_set __swig_getmethods__["g"] = _agg.rgba8_g_get - if _newclass:g = property(_agg.rgba8_g_get, _agg.rgba8_g_set) + if _newclass:g = _swig_property(_agg.rgba8_g_get, _agg.rgba8_g_set) __swig_setmethods__["b"] = _agg.rgba8_b_set __swig_getmethods__["b"] = _agg.rgba8_b_get - if _newclass:b = property(_agg.rgba8_b_get, _agg.rgba8_b_set) + if _newclass:b = _swig_property(_agg.rgba8_b_get, _agg.rgba8_b_set) __swig_setmethods__["a"] = _agg.rgba8_a_set __swig_getmethods__["a"] = _agg.rgba8_a_get - if _newclass:a = property(_agg.rgba8_a_get, _agg.rgba8_a_set) - def __init__(self, *args): + if _newclass:a = _swig_property(_agg.rgba8_a_get, _agg.rgba8_a_set) + def __init__(self, *args): this = _agg.new_rgba8(*args) try: self.this.append(this) except: self.this = this @@ -456,17 +462,17 @@ base_mask = _agg.rgba16_base_mask __swig_setmethods__["r"] = _agg.rgba16_r_set __swig_getmethods__["r"] = _agg.rgba16_r_get - if _newclass:r = property(_agg.rgba16_r_get, _agg.rgba16_r_set) + if _newclass:r = _swig_property(_agg.rgba16_r_get, _agg.rgba16_r_set) __swig_setmethods__["g"] = _agg.rgba16_g_set __swig_getmethods__["g"] = _agg.rgba16_g_get - if _newclass:g = property(_agg.rgba16_g_get, _agg.rgba16_g_set) + if _newclass:g = _swig_property(_agg.rgba16_g_get, _agg.rgba16_g_set) __swig_setmethods__["b"] = _agg.rgba16_b_set __swig_getmethods__["b"] = _agg.rgba16_b_get - if _newclass:b = property(_agg.rgba16_b_get, _agg.rgba16_b_set) + if _newclass:b = _swig_property(_agg.rgba16_b_get, _agg.rgba16_b_set) __swig_setmethods__["a"] = _agg.rgba16_a_set __swig_getmethods__["a"] = _agg.rgba16_a_get - if _newclass:a = property(_agg.rgba16_a_get, _agg.rgba16_a_set) - def __init__(self, *args): + if _newclass:a = _swig_property(_agg.rgba16_a_get, _agg.rgba16_a_set) + def __init__(self, *args): this = _agg.new_rgba16(*args) try: self.this.append(this) except: self.this = this @@ -494,7 +500,7 @@ __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, trans_affine, name) __repr__ = _swig_repr - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_trans_affine(*args) try: self.this.append(this) except: self.this = this @@ -531,13 +537,13 @@ class trans_affine_rotation(trans_affine): __swig_setmethods__ = {} - for _s in [trans_affine]: __swig_setmethods__.update(_s.__swig_setmethods__) + for _s in [trans_affine]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{})) __setattr__ = lambda self, name, value: _swig_setattr(self, trans_affine_rotation, name, value) __swig_getmethods__ = {} - for _s in [trans_affine]: __swig_getmethods__.update(_s.__swig_getmethods__) + for _s in [trans_affine]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{})) __getattr__ = lambda self, name: _swig_getattr(self, trans_affine_rotation, name) __repr__ = _swig_repr - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_trans_affine_rotation(*args) try: self.this.append(this) except: self.this = this @@ -548,13 +554,13 @@ class trans_affine_scaling(trans_affine): __swig_setmethods__ = {} - for _s in [trans_affine]: __swig_setmethods__.update(_s.__swig_setmethods__) + for _s in [trans_affine]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{})) __setattr__ = lambda self, name, value: _swig_setattr(self, trans_affine_scaling, name, value) __swig_getmethods__ = {} - for _s in [trans_affine]: __swig_getmethods__.update(_s.__swig_getmethods__) + for _s in [trans_affine]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{})) __getattr__ = lambda self, name: _swig_getattr(self, trans_affine_scaling, name) __repr__ = _swig_repr - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_trans_affine_scaling(*args) try: self.this.append(this) except: self.this = this @@ -565,13 +571,13 @@ class trans_affine_translation(trans_affine): __swig_setmethods__ = {} - for _s in [trans_affine]: __swig_setmethods__.update(_s.__swig_setmethods__) + for _s in [trans_affine]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{})) __setattr__ = lambda self, name, value: _swig_setattr(self, trans_affine_translation, name, value) __swig_getmethods__ = {} - for _s in [trans_affine]: __swig_getmethods__.update(_s.__swig_getmethods__) + for _s in [trans_affine]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{})) __getattr__ = lambda self, name: _swig_getattr(self, trans_affine_translation, name) __repr__ = _swig_repr - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_trans_affine_translation(*args) try: self.this.append(this) except: self.this = this @@ -582,13 +588,13 @@ class trans_affine_skewing(trans_affine): __swig_setmethods__ = {} - for _s in [trans_affine]: __swig_setmethods__.update(_s.__swig_setmethods__) + for _s in [trans_affine]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{})) __setattr__ = lambda self, name, value: _swig_setattr(self, trans_affine_skewing, name, value) __swig_getmethods__ = {} - for _s in [trans_affine]: __swig_getmethods__.update(_s.__swig_getmethods__) + for _s in [trans_affine]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{})) __getattr__ = lambda self, name: _swig_getattr(self, trans_affine_skewing, name) __repr__ = _swig_repr - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_trans_affine_skewing(*args) try: self.this.append(this) except: self.this = this @@ -605,7 +611,7 @@ __repr__ = _swig_repr __swig_destroy__ = _agg.delete_path_storage __del__ = lambda self : None; - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_path_storage(*args) try: self.this.append(this) except: self.this = this @@ -657,7 +663,7 @@ __repr__ = _swig_repr __swig_destroy__ = _agg.delete_rendering_buffer __del__ = lambda self : None; - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_rendering_buffer(*args) try: self.this.append(this) except: self.this = this @@ -712,8 +718,8 @@ __repr__ = _swig_repr __swig_setmethods__["c"] = _agg.pixel64_type_c_set __swig_getmethods__["c"] = _agg.pixel64_type_c_get - if _newclass:c = property(_agg.pixel64_type_c_get, _agg.pixel64_type_c_set) - def __init__(self, *args): + if _newclass:c = _swig_property(_agg.pixel64_type_c_get, _agg.pixel64_type_c_set) + def __init__(self, *args): this = _agg.new_pixel64_type(*args) try: self.this.append(this) except: self.this = this @@ -731,7 +737,7 @@ base_shift = _agg.pixel_format_rgba_base_shift base_size = _agg.pixel_format_rgba_base_size base_mask = _agg.pixel_format_rgba_base_mask - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_pixel_format_rgba(*args) try: self.this.append(this) except: self.this = this @@ -766,7 +772,7 @@ __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, renderer_base_rgba, name) __repr__ = _swig_repr - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_renderer_base_rgba(*args) try: self.this.append(this) except: self.this = this @@ -823,7 +829,7 @@ __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, conv_curve_path, name) __repr__ = _swig_repr - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_conv_curve_path(*args) try: self.this.append(this) except: self.this = this @@ -842,7 +848,7 @@ __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, conv_curve_trans, name) __repr__ = _swig_repr - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_conv_curve_trans(*args) try: self.this.append(this) except: self.this = this @@ -861,7 +867,7 @@ __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, conv_transform_path, name) __repr__ = _swig_repr - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_conv_transform_path(*args) try: self.this.append(this) except: self.this = this @@ -880,7 +886,7 @@ __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, conv_transform_curve, name) __repr__ = _swig_repr - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_conv_transform_curve(*args) try: self.this.append(this) except: self.this = this @@ -899,7 +905,7 @@ __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, vcgen_stroke, name) __repr__ = _swig_repr - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_vcgen_stroke(*args) try: self.this.append(this) except: self.this = this @@ -932,7 +938,7 @@ def prepare_src(*args): return _agg.null_markers_prepare_src(*args) def rewind(*args): return _agg.null_markers_rewind(*args) def vertex(*args): return _agg.null_markers_vertex(*args) - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_null_markers(*args) try: self.this.append(this) except: self.this = this @@ -947,7 +953,7 @@ __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, conv_adaptor_vcgen_path, name) __repr__ = _swig_repr - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_conv_adaptor_vcgen_path(*args) try: self.this.append(this) except: self.this = this @@ -967,7 +973,7 @@ __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, conv_adaptor_vcgen_transpath, name) __repr__ = _swig_repr - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_conv_adaptor_vcgen_transpath(*args) try: self.this.append(this) except: self.this = this @@ -987,7 +993,7 @@ __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, conv_adaptor_vcgen_curve, name) __repr__ = _swig_repr - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_conv_adaptor_vcgen_curve(*args) try: self.this.append(this) except: self.this = this @@ -1007,7 +1013,7 @@ __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, conv_adaptor_vcgen_transcurve, name) __repr__ = _swig_repr - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_conv_adaptor_vcgen_transcurve(*args) try: self.this.append(this) except: self.this = this @@ -1027,7 +1033,7 @@ __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, conv_adaptor_vcgen_curvetrans, name) __repr__ = _swig_repr - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_conv_adaptor_vcgen_curvetrans(*args) try: self.this.append(this) except: self.this = this @@ -1043,13 +1049,13 @@ class conv_stroke_path(conv_adaptor_vcgen_path): __swig_setmethods__ = {} - for _s in [conv_adaptor_vcgen_path]: __swig_setmethods__.update(_s.__swig_setmethods__) + for _s in [conv_adaptor_vcgen_path]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{})) __setattr__ = lambda self, name, value: _swig_setattr(self, conv_stroke_path, name, value) __swig_getmethods__ = {} - for _s in [conv_adaptor_vcgen_path]: __swig_getmethods__.update(_s.__swig_getmethods__) + for _s in [conv_adaptor_vcgen_path]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{})) __getattr__ = lambda self, name: _swig_getattr(self, conv_stroke_path, name) __repr__ = _swig_repr - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_conv_stroke_path(*args) try: self.this.append(this) except: self.this = this @@ -1069,13 +1075,13 @@ class conv_stroke_transpath(conv_adaptor_vcgen_transpath): __swig_setmethods__ = {} - for _s in [conv_adaptor_vcgen_transpath]: __swig_setmethods__.update(_s.__swig_setmethods__) + for _s in [conv_adaptor_vcgen_transpath]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{})) __setattr__ = lambda self, name, value: _swig_setattr(self, conv_stroke_transpath, name, value) __swig_getmethods__ = {} - for _s in [conv_adaptor_vcgen_transpath]: __swig_getmethods__.update(_s.__swig_getmethods__) + for _s in [conv_adaptor_vcgen_transpath]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{})) __getattr__ = lambda self, name: _swig_getattr(self, conv_stroke_transpath, name) __repr__ = _swig_repr - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_conv_stroke_transpath(*args) try: self.this.append(this) except: self.this = this @@ -1095,13 +1101,13 @@ class conv_stroke_curve(conv_adaptor_vcgen_curve): __swig_setmethods__ = {} - for _s in [conv_adaptor_vcgen_curve]: __swig_setmethods__.update(_s.__swig_setmethods__) + for _s in [conv_adaptor_vcgen_curve]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{})) __setattr__ = lambda self, name, value: _swig_setattr(self, conv_stroke_curve, name, value) __swig_getmethods__ = {} - for _s in [conv_adaptor_vcgen_curve]: __swig_getmethods__.update(_s.__swig_getmethods__) + for _s in [conv_adaptor_vcgen_curve]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{})) __getattr__ = lambda self, name: _swig_getattr(self, conv_stroke_curve, name) __repr__ = _swig_repr - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_conv_stroke_curve(*args) try: self.this.append(this) except: self.this = this @@ -1125,7 +1131,7 @@ __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, conv_stroke_transcurve, name) __repr__ = _swig_repr - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_conv_stroke_transcurve(*args) try: self.this.append(this) except: self.this = this @@ -1149,7 +1155,7 @@ __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, conv_stroke_curvetrans, name) __repr__ = _swig_repr - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_conv_stroke_curvetrans(*args) try: self.this.append(this) except: self.this = this @@ -1173,7 +1179,7 @@ __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, rasterizer_scanline_aa, name) __repr__ = _swig_repr - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_rasterizer_scanline_aa(*args) try: self.this.append(this) except: self.this = this @@ -1208,7 +1214,7 @@ __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, renderer_scanline_aa_solid_rgba, name) __repr__ = _swig_repr - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_renderer_scanline_aa_solid_rgba(*args) try: self.this.append(this) except: self.this = this @@ -1228,7 +1234,7 @@ __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, renderer_scanline_bin_solid_rgba, name) __repr__ = _swig_repr - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_renderer_scanline_bin_solid_rgba(*args) try: self.this.append(this) except: self.this = this @@ -1250,7 +1256,7 @@ __repr__ = _swig_repr __swig_destroy__ = _agg.delete_scanline_p8 __del__ = lambda self : None; - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_scanline_p8(*args) try: self.this.append(this) except: self.this = this @@ -1274,7 +1280,7 @@ __repr__ = _swig_repr __swig_destroy__ = _agg.delete_scanline_bin __del__ = lambda self : None; - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_scanline_bin(*args) try: self.this.append(this) except: self.this = this @@ -1297,7 +1303,7 @@ __repr__ = _swig_repr __swig_destroy__ = _agg.delete_scanline32_bin __del__ = lambda self : None; - def __init__(self, *args): + def __init__(self, *args): this = _agg.new_scanline32_bin(*args) try: self.this.append(this) except: self.this = this @@ -1313,5 +1319,6 @@ scanline32_bin_swigregister(scanline32_bin) render_scanlines_rgba = _agg.render_scanlines_rgba +render_scanlines_bin_rgba = _agg.render_scanlines_bin_rgba Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2007-07-18 17:21:11 UTC (rev 3565) +++ trunk/matplotlib/lib/matplotlib/axes.py 2007-07-18 20:38:32 UTC (rev 3566) @@ -5820,7 +5820,8 @@ """ # this is some discarded code I was using to find the minimum positive # data point for some log scaling fixes. I realized there was a -# cleaner way to do it, but am keeping this around as an example for +# cleaner way to do it, but am ke +eping this around as an example for # how to get the data out of the axes. Might want to make something # like this a method one day, or better yet make get_verts and Artist # method Modified: trunk/matplotlib/makeswig.py =================================================================== --- trunk/matplotlib/makeswig.py 2007-07-18 17:21:11 UTC (rev 3565) +++ trunk/matplotlib/makeswig.py 2007-07-18 20:38:32 UTC (rev 3566) @@ -6,7 +6,7 @@ 'agg', ) #SWIG = 'swig' -SWIG = '/home/jdhunter/local/bin/swig' +SWIG = '/home/titan/johnh/dev/bin/swig' AGGINCLUDE = 'agg23/include' swigit = '%(SWIG)s -python -c++ -outdir lib/matplotlib -o src/%(SWIGFILE)s.cxx -I%(AGGINCLUDE)s swig/%(SWIGFILE)s.i ' Added: trunk/matplotlib/mpl1/mpl1.py =================================================================== --- trunk/matplotlib/mpl1/mpl1.py (rev 0) +++ trunk/matplotlib/mpl1/mpl1.py 2007-07-18 20:38:32 UTC (rev 3566) @@ -0,0 +1,421 @@ +from matplotlib.enthought.traits import HasTraits +import matplotlib.enthought.traits as traits + +from matplotlib import agg +import numpy as npy + +import mtraits # some handy traits for mpl + +class Func: + def __call__(self, X): + 'transform the numpy array with shape N,2' + raise NotImplementedError + + def invert(self, x, y): + 'invert the point x, y' + raise NotImplementedError + + def point(self, x, y): + 'transform the point x, y' + raise NotImplementedError + +class Identity(Func): + def __call__(self, X): + 'transform the numpy array with shape N,2' + return X + + def invert(self, x, y): + 'invert the point x, y' + return x, y + + def point(self, x, y): + 'transform the point x, y' + return x, y + + +class Polar(Func): + def __call__(self, X): + 'transform the numpy array with shape N,2' + r = X[:,0] + theta = X[:,1] + x = r*npy.cos(theta) + y = r*npy.sin(theta) + return npy.array([x,y]).T + + def invert(self, x, y): + 'invert the point x, y' + raise NotImplementedError + + def point(self, x, y): + 'transform the point x, y' + raise NotImplementedError + + +identity = Identity() + + +class Path(HasTraits): + """ + The path is an object that talks to the backends, and is an + intermediary between the high level path artists like Line and + Polygon, and the backend renderer + """ + MOVETO, LINETO, CLOSEPOLY = range(3) + + strokecolor = mtraits.color('black') + fillcolor = mtraits.color('blue') + alpha = mtraits.alpha(1.0) + linewidth = mtraits.linewidth(1.0) + antialiased = mtraits.flexible_true_trait + verts= mtraits.verts + codes = mtraits.codes + +mtraits.path = traits.Trait(Path()) + +class AggPath: + def __init__(self, path): + """ + Path stored with agg data structs + """ + MOVETO, LINETO, CLOSEPOLY = Path.MOVETO, Path.LINETO, Path.CLOSEPOLY + aggpath = agg.path_storage() + verts = path.verts + codes = path.codes + for i in range(len(verts)): + x, y = verts[i] + code = codes[i] + if code==MOVETO: + aggpath.move_to(x, y) + elif code==LINETO: + aggpath.line_to(x, y) + elif code==CLOSEPOLY: + aggpath.close_polygon() + + self.fillcolor = self.color_to_rgba8(path.fillcolor) + self.strokecolor = self.color_to_rgba8(path.strokecolor) + + self.aggpath = aggpath + self.alpha = float(path.alpha) + self.linewidth = float(path.linewidth) + self.antialiased = bool(path.antialiased) + + def color_to_rgba8(self, color): + if color is None: return None + rgba = [int(255*c) for c in color.r, color.g, color.b, color.a] + return agg.rgba8(*rgba) + +# coordinates: +# +# artist model : a possibly nonlinear transformation (Func instance) +# to a separable cartesian coordinate, eg for polar is takes r, +# theta -> r*cos(theta), r*sin(theta) +# +# affineData : an affine 3x3 matrix that takes model output and +# transforms it to axes 0,1. We are kind of stuck with the +# mpl/matlab convention that 0,0 is the bottom left of the axes, +# even though it contradicts pretty much every GUI layout in the +# world +# +# affineFigure: an affine 3x3 that transforms an axes.view into figure +# 0,1 +# +# affineDisplay : takes an affine 3x3 and puts figure view into display. 0, +# 0 is left, top, which is the typical coordinate system of most +# graphics formats + +class Renderer: + def __init__(self, width, height): + self.width, self.height = width, height + + # almost all renderers assume 0,0 is left, upper, so we'll flip y here by default + self.displayview = npy.array( + [[width, 0, 0], [0, -height, height], [0, 0, 1]], dtype=npy.float_) + self.pathd = dict() # dict mapping path id -> path instance + + def push_affine(self, affine): + 'set the current affine' + self.affine = npy.dot(self.displayview, affine) + + def add_path(self, pathid, path): + self.pathd[pathid] = path + + def remove_path(self, pathid): + if pathid in self.pathd: + del self.pathd[pathid] + + def render_path(self, pathid): + pass + + + +class RendererAgg(Renderer): + gray = agg.rgba8(128,128,128,255) + white = agg.rgba8(255,255,255,255) + blue = agg.rgba8(0,0,255,255) + + def __init__(self, width, height): + Renderer.__init__(self, width, height) + + self.aggpathd = dict() # map path ids to AggPaths + stride = width*4 + self.buf = buf = agg.buffer(width, height, stride) + + self.rbuf = rbuf = agg.rendering_buffer() + rbuf.attachb(buf) + + self.pf = pf = agg.pixel_format_rgba(rbuf) + self.rbase = rbase = agg.renderer_base_rgba(pf) + rbase.clear_rgba8(self.gray) + + # the antialiased renderers + self.renderer = agg.renderer_scanline_aa_solid_rgba(rbase); + self.rasterizer = agg.rasterizer_scanline_aa() + self.scanline = agg.scanline_p8() + self.trans = None + + # the aliased renderers + self.rendererbin = agg.renderer_scanline_bin_solid_rgba(rbase); + self.scanlinebin = agg.scanline_bin() + + def add_path(self, pathid, path): + pathid = Renderer.add_path(self, pathid, path) + self.aggpathd[pathid] = AggPath(path) + + def remove_path(self, pathid): + Renderer.remove_path(self, pathid) + if pathid in self.aggpathd: + del self.aggpathd[pathid] + + def push_affine(self, affine): + 'set the current affine' + Renderer.push_affine(self, affine) + a, b, tx = self.affine[0] + c, d, ty = self.affine[1] + self.trans = agg.trans_affine(a,b,c,d,tx,ty) + + + def render_path(self, pathid): + if self.trans is None: + raise RuntimeError('you must first push_affine') + + + + aggpath = self.aggpathd[pathid] + + if aggpath.antialiased: + renderer = self.renderer + scanline = self.scanline + render_scanlines = agg.render_scanlines_rgba + else: + renderer = self.rendererbin + scanline = self.scanlinebin + render_scanlines = agg.render_scanlines_bin_rgba + + renderer.color_rgba8( aggpath.strokecolor ) + transpath = agg.conv_transform_path(aggpath.aggpath, self.trans) + + if aggpath.fillcolor is not None: + self.rasterizer.add_path(transpath) + renderer.color_rgba8( aggpath.fillcolor ) + render_scanlines(self.rasterizer, scanline, renderer); + + stroke = agg.conv_stroke_transpath(transpath) + stroke.width(aggpath.linewidth) + self.rasterizer.add_path(stroke) + renderer.color_rgba8( aggpath.strokecolor ) + render_scanlines(self.rasterizer, scanline, renderer); + + + def show(self): + # we'll cheat a little and use pylab for display + + X = npy.fromstring(self.buf.to_string(), npy.uint8) + X.shape = self.height, self.width, 4 + if 1: + import pylab + fig = pylab.figure() + ax = fig.add_axes([0,0,1,1], xticks=[], yticks=[], + frameon=False, aspect='auto') + ax.imshow(X, aspect='auto') + pylab.show() + + + + + +def rectangle(l, b, w, h, facecolor='yellow', edgecolor='black', + edgewidth=1.0, alpha=1.0): + + t = b+h + r = l+w + verts = npy.array([(l,b), (l,t), (r, t), (r, b), (0,0)], npy.float_) + codes = Path.LINETO*npy.ones(5, npy.uint8) + codes[0] = Path.MOVETO + codes[-1] = Path.CLOSEPOLY + + path = Path() + part.verts = verts + path.codes = codes + path.strokecolor = edgecolor + path.fillcolor = facecolor + path.linewidth = edgewidth + path.alpha = alpha + return path + +def line(x, y, color='black', linewidth=1.0, alpha=1.0, antialiased=True, + model=identity): + X = npy.asarray([x,y]).T + numrows, numcols = X.shape + + codes = Path.LINETO*npy.ones(numrows, npy.uint8) + codes[0] = Path.MOVETO + + path = Path() + path.verts = model(X) + path.codes = codes + path.fillcolor = None + path.strokewidth = linewidth + path.alpha = alpha + path.antialiased = antialiased + return path + + + +class AxesCoords(HasTraits): + xviewlim = mtraits.interval + yviewlim = mtraits.interval + affineview = mtraits.affine + affineaxes = mtraits.affine + affine = mtraits.affine + + def _affineview_changed(self, old, new): + self.affine = npy.dot( + npy.dot(self.affineaxes, new), self.affinedata) + + def _affineaxes_changed(self, old, new): + self.affine = npy.dot( + npy.dot(new, self.affineview), self.affinedata) + + + def _xviewlim_changed(self, old, new): + xmin, xmax = new + scale = 1./(xmax-xmin) + tx = -xmin*scale + self.affineview[0][0] = scale + self.affineview[0][-1] = tx + + def _yviewlim_changed(self, old, new): + ymin, ymax = new + scale = 1./(ymax-ymin) + ty = -ymin*scale + self.affineview[1][1] = scale + self.affineview[1][-1] = ty + + + +class Figure: + def __init__(self): + self.renderer = None + self._pathid = 0 + self._pathd = dict() + + def add_path(self, path): + id_ = self._pathid + self.pathd[id_] = path + self._pathid += 1 + return id_ + + def remove_path(self, pathid): + if pathid in self.pathd: + del self.pathd[pathid] + if self.renderer is not None: + self.renderer.remove_path(pathid) + + def draw(self): + if self.renderer is None: + raise RuntimeError('call set_renderer renderer first') + + for pathid, path in self.pathd.items(): + renderer.push_affine(path.affine) + renderer.render_path(pathid) + + + def set_renderer(self, renderer): + self.renderer = renderer + for pathid, path in self.pathd.items(): + renderer.add_path(pathid, path) + + +def affine_axes(rect): + 'make an affine for a typical l,b,w,h axes rectangle' + l,b,w,h = rect + return npy.array([[w, 0, l], [0, h, b], [0, 0, 1]], dtype=npy.float_) + +def affine_identity(): + return npy.array([[1,0,0], + [0,1,0], + [0,0,1]], + dtype=npy.float_) + +def affine_translation(tx, ty): + return npy.array([[1,0,tx], + [0,1,ty], + [0,0,1]], + dtype=npy.float_) + +def affine_rotation(theta): + a = npy.cos(theta) + b = -npy.sin(theta) + c = npy.sin(theta) + d = npy.cos(theta) + + return npy.array([[a,b,0], + [c,d,0], + [0,0,1]], + dtype=npy.float_) + +xlim = mtraits.interval() +ylim1 = mtraits.interval() +ylim2 = mtraits.interval() + +affineaxes = affine_axes([0.1, 0.1, 0.4, 0.4]) # lower, left quadrant + +coords1 = AxesCoords() +coords1.xlim = xlim +coords1.ylim = ylim1 +print 'typedata', affineaxes.shape, affineaxes.dtype +coords1.affineaxes = affineaxes + +coords2 = AxesCoords() +coords2.xlim = xlim +coords2.ylim = ylim2 +coords2.affineaxes = affineaxes + + + +fig = Figure() + +x = npy.arange(0, 10, 0.01) +y1 = npy.cos(2*npy.pi*x) +y2 = 10*npy.exp(-x) + +line1 = line(x, y1, color='blue', linewidth=2.0) +line1.affine = coords1.affime + +line2 = line(x, y2, color='red', linewidth=2.0) +line2.affine = coords1.affime + +fig.add_path(line1) +fig.add_path(line2) + +# update the view limits, all the affines should be automagically updated +xlim = 0,10 +ylim1 = -1.1, 1.1 +ylim2 = 0, 10 + + +renderer = RendererAgg(600,400) +fig.set_renderer(renderer) +fig.draw() +print 'renderer affine', renderer.affine +renderer.show() Added: trunk/matplotlib/mpl1/mtraits.py =================================================================== --- trunk/matplotlib/mpl1/mtraits.py (rev 0) +++ trunk/matplotlib/mpl1/mtraits.py 2007-07-18 20:38:32 UTC (rev 3566) @@ -0,0 +1,113 @@ +# Here is some example code showing how to define some representative +# rc properties and construct a matplotlib artist using traits. +# Because matplotlib ships with enthought traits already, you can run +# this script with just matplotlib. Unfortunately, we do not ship the +# ex UI component so you can't test that part. I'm a bit of a traits +# newbie so there are probably better ways to do what I have done +# below. + +import sys, os, re +import matplotlib.enthought.traits as traits +from matplotlib.cbook import is_string_like +from matplotlib import colors as mcolors +import numpy as npy + +doprint = True +flexible_true_trait = traits.Trait( + True, + { 'true': True, 't': True, 'yes': True, 'y': True, 'on': True, True: True, + 'false': False, 'f': False, 'no': False, 'n': False, 'off': False, False: False + } ) +flexible_false_trait = traits.Trait( False, flexible_true_trait ) + +colors = mcolors.cnames + +def hex2color(s): + "Convert hex string (like html uses, eg, #efefef) to a r,g,b tuple" + return tuple([int(n, 16)/255.0 for n in (s[1:3], s[3:5], s[5:7])]) + +class RGBA(traits.HasTraits): + # r,g,b,a in the range 0-1 with default color 0,0,0,1 (black) + r = traits.Range(0., 1., 0.) + g = traits.Range(0., 1., 0.) + b = traits.Range(0., 1., 0.) + a = traits.Range(0., 1., 1.) + def __init__(self, r=0., g=0., b=0., a=1.): + self.r = r + self.g = g + self.b = b + self.a = a + def __repr__(self): + return 'r,g,b,a = (%1.2f, %1.2f, %1.2f, %1.2f)'%\ + (self.r, self.g, self.b, self.a) + +def tuple_to_rgba(ob, name, val): + tup = [float(x) for x in val] + if len(tup)==3: + r,g,b = tup + return RGBA(r,g,b) + elif len(tup)==4: + r,g,b,a = tup + return RGBA(r,g,b,a) + else: + raise ValueError +tuple_to_rgba.info = 'a RGB or RGBA tuple of floats' + +def hex_to_rgba(ob, name, val): + rgx = re.compile('^#[0-9A-Fa-f]{6}$') + + if not is_string_like(val): + raise TypeError + if rgx.match(val) is None: + raise ValueError + r,g,b = hex2color(val) + return RGBA(r,g,b,1.0) +hex_to_rgba.info = 'a hex color string' + +def colorname_to_rgba(ob, name, val): + hex = colors[val.lower()] + r,g,b = hex2color(hex) + return RGBA(r,g,b,1.0) +colorname_to_rgba.info = 'a named color' + +def float_to_rgba(ob, name, val): + val = float(val) + return RGBA(val, val, val, 1.) +float_to_rgba.info = 'a grayscale intensity' + + + +Color = traits.Trait(RGBA(), float_to_rgba, colorname_to_rgba, RGBA, + hex_to_rgba, tuple_to_rgba, None) + +def file_exists(ob, name, val): + fh = file(val, 'r') + return val + +def path_exists(ob, name, val): + os.path.exists(val) +linestyles = ('-', '--', '-.', ':', 'steps', 'None') +TICKLEFT, TICKRIGHT, TICKUP, TICKDOWN = range(4) +linemarkers = (None, '.', ',', 'o', '^', 'v', '<', '>', 's', + '+', 'x', 'd', 'D', '|', '_', 'h', 'H', + 'p', '1', '2', '3', '4', + TICKLEFT, + TICKRIGHT, + TICKUP, + TICKDOWN, + 'None') + + +linewidth = traits.Float(0.5) +linestyle = traits.Trait(*linestyles) +color = Color +marker = traits.Trait(*linemarkers) +markersize = traits.Float(6) +antialiased = flexible_true_trait +alpha = traits.Range(0., 1., 0.) +interval = traits.Array('d', (2,)) +affine = traits.Array('d', (3,3)) +verts = traits.Array('d') +codes = traits.Array('b') + + Modified: trunk/matplotlib/src/agg.cxx =================================================================== --- trunk/matplotlib/src/agg.cxx 2007-07-18 17:21:11 UTC (rev 3565) +++ trunk/matplotlib/src/agg.cxx 2007-07-18 20:38:32 UTC (rev 3566) @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.30 + * Version 1.3.31 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -795,11 +795,14 @@ #endif /* Py_ssize_t for old Pythons */ -#if PY_VERSION_HEX < 0x02050000 +/* This code is as recommended by: */ +/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */ +#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) typedef int Py_ssize_t; +# define PY_SSIZE_T_MAX INT_MAX +# define PY_SSIZE_T_MIN INT_MIN #endif - /* ----------------------------------------------------------------------------- * error manipulation * ----------------------------------------------------------------------------- */ @@ -2597,7 +2600,7 @@ #if (PY_VERSION_HEX <= 0x02000000) # if !defined(SWIG_PYTHON_CLASSIC) -# error "This python version requires to use swig with the '-classic' option" +# error "This python version requires swig to be run with the '-classic' option" # endif #endif @@ -2608,7 +2611,7 @@ #define SWIG_name "_agg" -#define SWIGVERSION 0x010330 +#define SWIGVERSION 0x010331 #define SWIG_VERSION SWIGVERSION @@ -30221,6 +30224,54 @@ } +SWIGINTERN PyObject *_wrap_render_scanlines_bin_rgba(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + agg::rasterizer_scanline_aa< > *arg1 = 0 ; + agg::scanline_bin *arg2 = 0 ; + agg::renderer_scanline_bin_solid<renderer_base_rgba_t > *arg3 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:render_scanlines_bin_rgba",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_rasterizer_scanline_aaT_t, 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "render_scanlines_bin_rgba" "', argument " "1"" of type '" "agg::rasterizer_scanline_aa< > &""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "render_scanlines_bin_rgba" "', argument " "1"" of type '" "agg::rasterizer_scanline_aa< > &""'"); + } + arg1 = reinterpret_cast< agg::rasterizer_scanline_aa< > * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_agg__scanline_bin, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "render_scanlines_bin_rgba" "', argument " "2"" of type '" "agg::scanline_bin &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "render_scanlines_bin_rgba" "', argument " "2"" of type '" "agg::scanline_bin &""'"); + } + arg2 = reinterpret_cast< agg::scanline_bin * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_agg__renderer_scanline_bin_solidTagg__renderer_baseTpixfmt_rgba_t_t_t, 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "render_scanlines_bin_rgba" "', argument " "3"" of type '" "agg::renderer_scanline_bin_solid<renderer_base_rgba_t > &""'"); + } + if (!argp3) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "render_scanlines_bin_rgba" "', argument " "3"" of type '" "agg::renderer_scanline_bin_solid<renderer_base_rgba_t > &""'"); + } + arg3 = reinterpret_cast< agg::renderer_scanline_bin_solid<renderer_base_rgba_t > * >(argp3); + agg::SWIGTEMPLATEDISAMBIGUATOR render_scanlines<agg::rasterizer_scanline_aa< >,agg::scanline_bin,agg::renderer_scanline_bin_solid<renderer_base_rgba_t > >(*arg1,*arg2,*arg3); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + static PyMethodDef SwigMethods[] = { { (char *)"deg2rad", _wrap_deg2rad, METH_VARARGS, NULL}, { (char *)"rad2deg", _wrap_rad2deg, METH_VARARGS, NULL}, @@ -30776,6 +30827,7 @@ { (char *)"scanline32_bin_num_spans", _wrap_scanline32_bin_num_spans, METH_VARARGS, NULL}, { (char *)"scanline32_bin_swigregister", scanline32_bin_swigregister, METH_VARARGS, NULL}, { (char *)"render_scanlines_rgba", _wrap_render_scanlines_rgba, METH_VARARGS, NULL}, + { (char *)"render_scanlines_bin_rgba", _wrap_render_scanlines_bin_rgba, METH_VARARGS, NULL}, { NULL, NULL, 0, NULL } }; @@ -31338,7 +31390,7 @@ * structures together. * * The generated swig_type_info structures are assigned staticly to an initial - * array. We just loop though that array, and handle each type individually. + * array. We just loop through that array, and handle each type individually. * First we lookup if this type has been already loaded, and if so, use the * loaded structure instead of the generated one. Then we have to fill in the * cast linked list. The cast data is initially stored in something like a Modified: trunk/matplotlib/src/swig_runtime.h =================================================================== --- trunk/matplotlib/src/swig_runtime.h 2007-07-18 17:21:11 UTC (rev 3565) +++ trunk/matplotlib/src/swig_runtime.h 2007-07-18 20:38:32 UTC (rev 3566) @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.30 + * Version 1.3.31 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -785,10 +785,13 @@ #endif /* Py_ssize_t for old Pythons */ -#if PY_VERSION_HEX < 0x02050000 +/* This code is as recommended by: */ +/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */ +#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) typedef int Py_ssize_t; +# define PY_SSIZE_T_MAX INT_MAX +# define PY_SSIZE_T_MIN INT_MIN #endif - /* ----------------------------------------------------------------------------- * error manipulation * ----------------------------------------------------------------------------- */ Modified: trunk/matplotlib/swig/agg.i =================================================================== --- trunk/matplotlib/swig/agg.i 2007-07-18 17:21:11 UTC (rev 3565) +++ trunk/matplotlib/swig/agg.i 2007-07-18 20:38:32 UTC (rev 3566) @@ -107,4 +107,8 @@ +%template(render_scanlines_bin_rgba) agg::render_scanlines< + agg::rasterizer_scanline_aa<>, + agg::scanline_bin, + agg::renderer_scanline_bin_solid<renderer_base_rgba_t> >; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |