AbstractImageMobject¶
限定名称: manim.mobject.types.image\_mobject.AbstractImageMobject
- class AbstractImageMobject(scale_to_resolution, pixel_array_dtype='uint8', resampling_algorithm=Resampling.BICUBIC, **kwargs)[来源]¶
基础类:
Mobject
自动过滤掉黑色像素
- Parameters:
scale_to_resolution (int) – 在此分辨率下,图像将逐像素放置在屏幕上,因此它将看起来最清晰和最佳。 这是ImageMobject的自定义参数,以便在使用例如
--quality low
或--quality medium
标志进行更快渲染的场景时,不会影响图像在屏幕上的位置。
方法
get_pixel_array
将
points
设置为图像的四个角。条件是一个函数,它接受一个参数,(x, y, z)。
设置用于放大图像的插值方法。
属性
animate
用于动画化
self
的任何方法的应用。animation_overrides
depth
mobject的深度。
height
mobject的高度。
width
mobject的宽度。
- _original__init__(scale_to_resolution, pixel_array_dtype='uint8', resampling_algorithm=Resampling.BICUBIC, **kwargs)¶
初始化自身。有关准确的签名,请参阅 help(type(self))。
- Parameters:
scale_to_resolution (int)
- set_color(color, alpha=None, family=True)[source]¶
条件是一个接受一个参数的函数,(x, y, z)。 这里它只是递归到子对象,但在子类中,这应该根据颜色的内部工作原理进一步实现。
- set_resampling_algorithm(resampling_algorithm)[source]¶
设置用于放大图像的插值方法。默认情况下,图像使用双三次算法进行插值。此方法允许您更改它。插值在内部使用Pillow完成,除了描述算法的字符串常量外,该函数还接受Pillow整数常量。
- Parameters:
resampling_algorithm (int) –
一个在Pillow库中描述的整数常量, 或来自RESAMPLING_ALGORITHMS全局字典中的一个, 根据以下键:
’bicubic’ 或 ‘cubic’
’nearest’ 或 ‘none’
’box’
’bilinear’ 或 ‘linear’
’hamming’
’lanczos’ 或 ‘antialias’