Return the alpha channel.
(cls, tex, fontsize=None, dpi=None)
| 333 | |
| 334 | @classmethod |
| 335 | def get_grey(cls, tex, fontsize=None, dpi=None): |
| 336 | """Return the alpha channel.""" |
| 337 | fontsize = mpl._val_or_rc(fontsize, 'font.size') |
| 338 | dpi = mpl._val_or_rc(dpi, 'savefig.dpi') |
| 339 | key = cls._get_tex_source(tex, fontsize), dpi |
| 340 | alpha = cls._grey_arrayd.get(key) |
| 341 | if alpha is None: |
| 342 | pngfile = cls.make_png(tex, fontsize, dpi) |
| 343 | rgba = mpl.image.imread(pngfile) |
| 344 | cls._grey_arrayd[key] = alpha = rgba[:, :, -1] |
| 345 | return alpha |
| 346 | |
| 347 | @classmethod |
| 348 | def get_rgba(cls, tex, fontsize=None, dpi=None, rgb=(0, 0, 0)): |
no test coverage detected