An abstract base class that provides color, line styles, etc.
| 699 | |
| 700 | |
| 701 | class GraphicsContextBase: |
| 702 | """An abstract base class that provides color, line styles, etc.""" |
| 703 | |
| 704 | def __init__(self): |
| 705 | self._alpha = 1.0 |
| 706 | self._forced_alpha = False # if True, _alpha overrides A from RGBA |
| 707 | self._antialiased = 1 # use 0, 1 not True, False for extension code |
| 708 | self._capstyle = CapStyle('butt') |
| 709 | self._cliprect = None |
| 710 | self._clippath = None |
| 711 | self._dashes = 0, None |
| 712 | self._joinstyle = JoinStyle('round') |
| 713 | self._linestyle = 'solid' |
| 714 | self._linewidth = 1 |
| 715 | self._rgb = (0.0, 0.0, 0.0, 1.0) |
| 716 | self._hatch = None |
| 717 | self._hatch_color = None |
| 718 | self._hatch_linewidth = rcParams['hatch.linewidth'] |
| 719 | self._url = None |
| 720 | self._gid = None |
| 721 | self._snap = None |
| 722 | self._sketch = None |
| 723 | |
| 724 | def copy_properties(self, gc): |
| 725 | """Copy properties from *gc* to self.""" |
| 726 | self._alpha = gc._alpha |
| 727 | self._forced_alpha = gc._forced_alpha |
| 728 | self._antialiased = gc._antialiased |
| 729 | self._capstyle = gc._capstyle |
| 730 | self._cliprect = gc._cliprect |
| 731 | self._clippath = gc._clippath |
| 732 | self._dashes = gc._dashes |
| 733 | self._joinstyle = gc._joinstyle |
| 734 | self._linestyle = gc._linestyle |
| 735 | self._linewidth = gc._linewidth |
| 736 | self._rgb = gc._rgb |
| 737 | self._hatch = gc._hatch |
| 738 | self._hatch_color = gc._hatch_color |
| 739 | self._hatch_linewidth = gc._hatch_linewidth |
| 740 | self._url = gc._url |
| 741 | self._gid = gc._gid |
| 742 | self._snap = gc._snap |
| 743 | self._sketch = gc._sketch |
| 744 | |
| 745 | def restore(self): |
| 746 | """ |
| 747 | Restore the graphics context from the stack - needed only |
| 748 | for backends that save graphics contexts on a stack. |
| 749 | """ |
| 750 | |
| 751 | def get_alpha(self): |
| 752 | """ |
| 753 | Return the alpha value used for blending - not supported on all |
| 754 | backends. |
| 755 | """ |
| 756 | return self._alpha |
| 757 | |
| 758 | def get_antialiased(self): |
no outgoing calls
no test coverage detected
searching dependent graphs…