Function plasma::render_part
source · pub fn render_part<'a, B, L, M, P>(
buffer: &mut [u8],
pitch: usize,
pw: usize,
ph: usize,
phase_amps: &'a P,
x: usize,
y: usize,
w: usize,
h: usize,
wrkspc: Option<&mut Vec<u8>>,
)where
B: PixelBuffer,
L: IntermediateCalculatorProducer<'a, P, f32>,
M: Mixer<f32>,
P: PhaseAmpsSelect<'a> + ?Sized,
Expand description
Renders the part of the plasma into the provided buffer
without the Plasma instance.
You must also provide a struct implementing PixelBuffer trait.
The pitch
should contain the number of bytes of a single line in a buffer.
The pw
is the plasma total pixel width, the ph
is the total pixel height.
This static method allows to use directly exported plasma state
from Plasma::export_phase_amps without the instance of the Plasma struct.
The phase_amps
type should implement trait PhaseAmpsSelect.
The boundary of rendered part should be provided by x
, y
, w
and h
arguments
in pixel coordinates starting from left/top corner.
The wrkspc
is an optional temporary memory scractchpad.
If None is provided the new memory will be allocated.
§Panics
Panics if PhaseAmpsSelect::select panics.