displayarray.effects.lens

Create lens effects. Currently only 2D+color arrays are supported.

class Barrel(use_bleed=False, barrel_power=1, pincushion_power=1, zoom=1, center=None)[source]

A barrel lens distortion callback.

property barrel_power

Guarded barrel power. Avoids divide by zero conditions.

property center

Guarded get center. Limits to within input.

enable_mouse_control(crop_size=None)[source]

Enable the default mouse controls.

Move the mouse to center the image scroll to increase/decrease barrel ctrl+scroll to increase/decrease zoom

property zoom

Guarded zoom. Avoids divide by zero conditions.

class BarrelPyTorch(use_bleed=False, barrel_power=1, pincushion_power=1, zoom=1, center=None)[source]

A barrel distortion callback class accelerated by PyTorch.

class ControllableLens(use_bleed=False, zoom=1, center=None)[source]

A lens callback that can be controlled by the program or the user.

run_bleed(arr, x, y)[source]

Spread color outwards, like food coloring in water.

class Mustache(use_bleed=False, barrel_power=1, pincushion_power=1, zoom=1, center=None)[source]

A mustache distortion callback.

enable_mouse_control()[source]

Enable the default mouse loop to control the mustache distortion.

ctrl+scroll wheel: zoom in and out shift+scroll wheel: adjust pincushion power scroll wheel: adjust barrel power

class Barrel(use_bleed=False, barrel_power=1, pincushion_power=1, zoom=1, center=None)[source]

A barrel lens distortion callback.

property barrel_power

Guarded barrel power. Avoids divide by zero conditions.

property center

Guarded get center. Limits to within input.

enable_mouse_control(crop_size=None)[source]

Enable the default mouse controls.

Move the mouse to center the image scroll to increase/decrease barrel ctrl+scroll to increase/decrease zoom

property zoom

Guarded zoom. Avoids divide by zero conditions.

class Mustache(use_bleed=False, barrel_power=1, pincushion_power=1, zoom=1, center=None)[source]

A mustache distortion callback.

enable_mouse_control()[source]

Enable the default mouse loop to control the mustache distortion.

ctrl+scroll wheel: zoom in and out shift+scroll wheel: adjust pincushion power scroll wheel: adjust barrel power