def view_file(filename, filter_names, options, view=None): if view is None: if options.show: offscreen = False else: offscreen = get_default(options.offscreen, True) view = Viewer(filename, watch=options.watch, ffmpeg_options=options.ffmpeg_options, output_dir=options.output_dir, offscreen=offscreen) if options.only_names is not None: options.only_names = options.only_names.split(',') view(show=options.show, is_3d=options.is_3d, view=options.view, roll=options.roll, parallel_projection=options.parallel_projection, fgcolor=options.fgcolor, bgcolor=options.bgcolor, colormap=options.colormap, layout=options.layout, scalar_mode=options.scalar_mode, vector_mode=options.vector_mode, rel_scaling=options.rel_scaling, clamping=options.clamping, ranges=options.ranges, is_scalar_bar=options.is_scalar_bar, is_wireframe=options.is_wireframe, opacity=options.opacity, subdomains_args=options.subdomains_args, rel_text_width=options.rel_text_width, fig_filename=options.filename, resolution=options.resolution, filter_names=filter_names, only_names=options.only_names, group_names=options.group_names, step=options.step, time=options.time, anti_aliasing=options.anti_aliasing, domain_specific=options.domain_specific) else: view.set_source_filename(filename) view.save_image(options.filename) return view