def render(locs, info=None, oversampling=1, viewport=None, blur_method=None, min_blur_width=0):
if viewport is None:
try:
viewport = [(0, 0), (info[0]['Height'], info[0]['Width'])]
except TypeError:
raise ValueError('Need info if no viewport is provided.')
(y_min, x_min), (y_max, x_max) = viewport
if blur_method is None:
return render_hist(locs, oversampling, y_min, x_min, y_max, x_max)
elif blur_method == 'gaussian':
return render_gaussian(locs, oversampling, y_min, x_min, y_max, x_max, min_blur_width)
elif blur_method == 'gaussian_iso':
return render_gaussian_iso(locs, oversampling, y_min, x_min, y_max, x_max, min_blur_width)
elif blur_method == 'smooth':
return render_smooth(locs, oversampling, y_min, x_min, y_max, x_max)
elif blur_method == 'convolve':
return render_convolve(locs, oversampling, y_min, x_min, y_max, x_max, min_blur_width)
else:
raise Exception('blur_method not understood.')
评论列表
文章目录