def __init__(self,data,data_renderer,alpha=1.0): """ Argument data needs to have __getitem__ defined OR being callable (function) Argument data_renderer(context,data_point) and renderers it """ wlayer.__init__(self,alpha) self.data=data self.data_renderer=data_renderer
def __init__(self,input_data,alpha=1.0): """ Constructor for video @Param input_data, can be string or ordered vector with elements valid wimage.input_data """ wlayer.__init__(self,alpha) if isinstance(input_data,basestring): self.init_with_filename(input_data) elif isinstance(input_data,wanimation): self.init_with_list(input_data.export()) elif isinstance(input_data,(list)): self.init_with_list(input_data) else: raise Exception("input_data has incorrect type:"+type(input_data))
def __init__(self,input_data,alpha=1.0, width=settings.IMAGE_WIDTH, height=settings.IMAGE_HEIGHT): """ The input data can be a filename,numpy array or cairo.ImageSurface If numpy.array it connects the data else is just copied at __init__ """ wlayer.__init__(self,alpha) #Handles different argument types if isinstance(input_data,numpy.ndarray): self.init_with_array(input_data) elif isinstance(input_data,tuple): self.init_with_size(input_data) elif isinstance(input_data,basestring): self.init_with_filename(input_data) elif isinstance(input_data,cairo.ImageSurface): self.init_with_imagesurface(input_data) elif isinstance(input_data, wlayer): if isinstance(input_data, wimage): self.init_with_array(input_data.data.copy()) else: self.init_with_imagesurface(input_data.get_imagesurface(width=width, height=height)) else: raise Exception("Invalid input type, not (ndarray/basestring/imagesurface):"+str(type(input_data)))
def __init__(self, particle, dl=5, length=200, width=1, alpha=1,rotation=0.,translate=(0,0)): wlayer.__init__(self, alpha) self.particle = particle self.renderer = GWhiskerRenderer(dl,length,width,rotation,translate)
def __init__(self, particle, alpha=1): wlayer.__init__(self, alpha) self.particle = particle self.renderer = PendulumRenderer(400.0 / 512, 24.0 / 512)
def __init__(self, particle, alpha=1): wlayer.__init__(self, alpha) self.particle = particle self.renderer = SquareRenderer(50)