AbstractImageMobject

完全限定名: manim.mobject.types.image\_mobject.AbstractImageMobject

class AbstractImageMobject(scale_to_resolution, pixel_array_dtype='uint8', resampling_algorithm=Resampling.BICUBIC, **kwargs)[source]

基类: Mobject

自动过滤黑色像素

参数:
  • scale_to_resolution (int) – 在此分辨率下,图像会逐像素放置到屏幕上,因此看起来最清晰、最美观。这是ImageMobject的一个自定义参数,以便在使用例如 --quality low--quality medium 标志进行更快渲染时,不会影响图像在屏幕上的位置。

  • pixel_array_dtype (str)

  • resampling_algorithm (Resampling)

  • kwargs (Any)

方法

get_pixel_array

重置点

points 设置为图像的四个角。

设置颜色

条件是一个接受一个参数 (x, y, z) 的函数。

set_resampling_algorithm

设置图像放大时的插值方法。

属性

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))。

参数:
  • scale_to_resolution (int)

  • pixel_array_dtype (str)

  • resampling_algorithm (Resampling)

  • kwargs (Any)

返回类型:

reset_points()[source]

points 设置为图像的四个角。

返回类型:

set_color(color, alpha=None, family=True)[source]

条件是一个函数,它接受一个参数 (x, y, z)。这里它只是递归地作用于子对象,但在子类中,这应该根据颜色的内部工作原理进一步实现。

set_resampling_algorithm(resampling_algorithm)[source]

设置图像放大时的插值方法。默认情况下,图像使用双三次算法进行插值。此方法允许您更改它。插值在内部使用Pillow完成,除了描述算法的字符串常量外,该函数还接受Pillow整数常量。

参数:

resampling_algorithm (int) –

Pillow库中描述的整数常量,或来自RESAMPLING_ALGORITHMS全局字典中以下键之一:

  • ‘bicubic’ 或 ‘cubic’

  • ‘nearest’ 或 ‘none’

  • ‘box’

  • ‘bilinear’ 或 ‘linear’

  • ‘hamming’

  • ‘lanczos’ 或 ‘antialias’

返回类型:

自身