pub fn eval_bytecode(
prog: &CompiledProgram,
bands: &[&[f64]],
pixel_idx: usize,
cache: &mut [f64],
stack: &mut Vec<f64>,
) -> Result<f64>Expand description
Execute the bytecode program for a single pixel.
§Arguments
prog– The compiled program (constant, shared across all pixels).bands– A slice of band data slices, 0-indexed (bands[0]= B1).pixel_idx– Linear index into each band slice for the current pixel.cache– Pre-allocatedVec<f64>withprog.cache_slot_countentries. Values are populated byStoreCacheSlotduring the prelude.stack– Pre-allocated scratchVec<f64>; cleared at the start of each call. Capacity should be>= prog.estimated_stack_depth.
§Errors
Returns AlgorithmError on stack underflow or band out-of-range. Division
by zero and invalid power operations return f64::NAN (not an error).