Method summary
- __del__(self, destroy = _agg.destroy_graphics_context)
- __init__(self, *args, **kwargs)
- __init__(self, ary_or_size, pix_format = 'bgra32', interpolation = 'nearest', bottom_up = 1)
- add_path(*args)
- arc(*args)
- arc_to(*args)
- begin_page(*args)
- begin_path(*args)
- bottom_up(*args)
- clear(*args)
- clear_clip_path(*args)
- clip(*args)
- clip_to_rect(*args)
- clip_to_rects(*args)
- close_path(*args)
- concat_ctm(self, m)
- convert_pixel_format(self, pix_format, inplace = 0)
- curve_to(*args)
- draw_image(self, img, rect = None, force_copy = False)
- draw_marker_at_points(self, pts, size, kiva_marker_type)
- draw_path(*args)
- draw_path_at_points(*args)
- draw_rect(*args)
- end_page(*args)
- eof_fill_path(*args)
- even_odd_clip(*args)
- fill_path(*args)
- flush(*args)
- format(self)
- get_alpha(*args)
- get_antialias(*args)
- get_blend_mode(*args)
- get_character_spacing(*args)
- get_clip_region(*args)
- get_ctm(self)
- get_empty_path(self)
- get_fill_color(*args)
- get_font(*args)
- get_freetype_text_matrix(*args)
- get_full_text_extent(self, text)
- get_image_interpolation(self)
- get_num_clip_regions(*args)
- get_stroke_color(*args)
- get_text_extent(self, text)
- get_text_matrix(*args)
- get_text_position(*args)
- height(*args)
- is_font_initialized(*args)
- line_set(*args)
- line_to(*args)
- lines(*args)
- move_to(*args)
- quad_curve_to(*args)
- rect(*args)
- rects(*args)
- restore_state(*args)
- rotate_ctm(*args)
- save(self, filename, file_format = None, pil_options = None)
- save_state(*args)
- scale_ctm(*args)
- set_alpha(*args)
- set_antialias(*args)
- set_blend_mode(*args)
- set_character_spacing(*args)
- set_ctm(self, m)
- set_fill_color(self, color)
- set_flatness(*args)
- set_font(self, font)
- set_font_size(self, size)
- set_image_interpolation(self, interp)
- set_line_cap(*args)
- set_line_dash(*args)
- set_line_join(*args)
- set_line_width(*args)
- set_miter_limit(*args)
- set_stroke_color(self, color)
- set_text_drawing_mode(*args)
- set_text_matrix(*args)
- set_text_position(*args)
- show_text(self, text, point = None)
- show_text_at_point(self, text, dx, dy)
- show_text_simple(*args)
- stride(*args)
- stroke_path(*args)
- synchronize(*args)
- translate_ctm(*args)
- width(*args)
Methods
- __del__(self, destroy = _agg.destroy_graphics_context)
- __init__(self, *args, **kwargs)
- __init__(self, ary_or_size, pix_format = 'bgra32', interpolation = 'nearest', bottom_up = 1)
When specifying size, it must be a two element tuple. Array input is always treated as an image.
This class handles the polymorphism of the underlying template classes for individual pixel formats.
- add_path(*args)
- arc(*args)
- arc_to(*args)
- begin_page(*args)
- begin_path(*args)
- bottom_up(*args)
- clear(*args)
- clear_clip_path(*args)
- clip(*args)
- clip_to_rect(*args)
- clip_to_rects(*args)
- close_path(*args)
- concat_ctm(self, m)
- convert_pixel_format(self, pix_format, inplace = 0)
Convert gc from one pixel format to another.
!! This used to be done in C++ code, but difficult-to-find !! memory bugs pushed toward a simpler solution. !! HACK !! Now we just draw into a new gc and assume its underlying C++ !! object. We must be careful not to add any attributes in the !! Python GraphicsContextArray constructor other than the bmp_array. !! if we do, we need to copy them here also.
- curve_to(*args)
- draw_image(self, img, rect = None, force_copy = False)
- draw_marker_at_points(self, pts, size, kiva_marker_type)
- draw_path(*args)
- draw_path_at_points(*args)
- draw_rect(*args)
- end_page(*args)
- eof_fill_path(*args)
- even_odd_clip(*args)
- fill_path(*args)
- flush(*args)
- format(self)
- get_alpha(*args)
- get_antialias(*args)
- get_blend_mode(*args)
- get_character_spacing(*args)
- get_clip_region(*args)
- get_ctm(self)
- get_empty_path(self)
- get_fill_color(*args)
- get_font(*args)
- get_freetype_text_matrix(*args)
- get_full_text_extent(self, text)
- get_image_interpolation(self)
- get_num_clip_regions(*args)
- get_stroke_color(*args)
- get_text_extent(self, text)
- get_text_matrix(*args)
- get_text_position(*args)
- height(*args)
- is_font_initialized(*args)
- line_set(*args)
- line_to(*args)
- lines(*args)
- move_to(*args)
- quad_curve_to(*args)
- rect(*args)
- rects(*args)
- restore_state(*args)
- rotate_ctm(*args)
- save(self, filename, file_format = None, pil_options = None)
Save the GraphicsContext to a file. Output files are always saved in RGB or RGBA format; if this GC is not in one of these formats, it is automatically converted.
If filename includes an extension, the image format is inferred from it. file_format is only required if the format can't be inferred from the filename (e.g. if you wanted to save a PNG file as a .dat or .bin).
filename may also be "file-like" object such as a StringIO, in which case a file_format must be supplied
pil_options is a dict of format-specific options that are passed down to the PIL image file writer. If a writer doesn't recognize an option, it is silently ignored.
If the image has an alpha channel and the specified output file format does not support alpha, the image is saved in rgb24 format.
- save_state(*args)
- scale_ctm(*args)
- set_alpha(*args)
- set_antialias(*args)
- set_blend_mode(*args)
- set_character_spacing(*args)
- set_ctm(self, m)
- set_fill_color(self, color)
- set_flatness(*args)
- set_font(self, font)
- set_font_size(self, size)
- set_image_interpolation(self, interp)
- set_line_cap(*args)
- set_line_dash(*args)
- set_line_join(*args)
- set_line_width(*args)
- set_miter_limit(*args)
- set_stroke_color(self, color)
- set_text_drawing_mode(*args)
- set_text_matrix(*args)
- set_text_position(*args)
- show_text(self, text, point = None)
Displays text at point, or at the current text pen position if point is None. Returns true if text displayed properly, false if there was a font issue or a glyph could not be rendered. Will handle multi-line text separated by backslash-ns
- show_text_at_point(self, text, dx, dy)
- show_text_simple(*args)
- stride(*args)
- stroke_path(*args)
- synchronize(*args)
- translate_ctm(*args)
- width(*args)