Noise Effect

Copyright 2023 Ethan Christensen

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

class bruhanimate.bruheffect.noise_effect.NoiseEffect(buffer: Buffer, background: str, settings: NoiseSettings = None)[source]

Bases: BaseEffect

A noise effect that adds random pixels to the screen with a specified intensity.

__init__(buffer: Buffer, background: str, settings: NoiseSettings = None)[source]

Initializes the NoiseEffect class.

Parameters:
  • buffer (Buffer) – Effect buffer to push updates to.

  • background (str) – Character or string for background.

  • settings (NoiseSettings, optional) – Configuration for the noise effect. Defaults to None.

set_intensity(intensity: int)[source]

Updates the intensity of the effect.

Parameters:

intensity (int) – New intensity value between 1 and 999.

set_color(color: bool, characters: bool = True)[source]

Updates the color and character rendering mode.

Parameters:
  • color (bool) – Whether to render with color.

  • characters (bool, optional) – Whether to render noise characters or background blocks. Defaults to True.

render_frame(frame_number: int)[source]

Renders a frame of the noise effect.

Parameters:

frame_number (int) – The current frame number.