(self, gc, fillcolor=None)
| 1885 | self.file.output(*self.gc.finalize()) |
| 1886 | |
| 1887 | def check_gc(self, gc, fillcolor=None): |
| 1888 | orig_fill = getattr(gc, '_fillcolor', (0., 0., 0.)) |
| 1889 | gc._fillcolor = fillcolor |
| 1890 | |
| 1891 | orig_alphas = getattr(gc, '_effective_alphas', (1.0, 1.0)) |
| 1892 | |
| 1893 | if gc.get_rgb() is None: |
| 1894 | # It should not matter what color here since linewidth should be |
| 1895 | # 0 unless affected by global settings in rcParams, hence setting |
| 1896 | # zero alpha just in case. |
| 1897 | gc.set_foreground((0, 0, 0, 0), isRGBA=True) |
| 1898 | |
| 1899 | if gc._forced_alpha: |
| 1900 | gc._effective_alphas = (gc._alpha, gc._alpha) |
| 1901 | elif fillcolor is None or len(fillcolor) < 4: |
| 1902 | gc._effective_alphas = (gc._rgb[3], 1.0) |
| 1903 | else: |
| 1904 | gc._effective_alphas = (gc._rgb[3], fillcolor[3]) |
| 1905 | |
| 1906 | delta = self.gc.delta(gc) |
| 1907 | if delta: |
| 1908 | self.file.output(*delta) |
| 1909 | |
| 1910 | # Restore gc to avoid unwanted side effects |
| 1911 | gc._fillcolor = orig_fill |
| 1912 | gc._effective_alphas = orig_alphas |
| 1913 | |
| 1914 | def get_image_magnification(self): |
| 1915 | return self.image_dpi/72.0 |
no test coverage detected