pub struct GpuAlgebra;Expand description
Pure-Rust raster algebra executor.
Implementations§
Source§impl GpuAlgebra
impl GpuAlgebra
Sourcepub fn execute(
band_a: &[f32],
band_b: Option<&[f32]>,
op: AlgebraOp,
nodata: Option<f32>,
) -> Result<Vec<f32>, GpuError>
pub fn execute( band_a: &[f32], band_b: Option<&[f32]>, op: AlgebraOp, nodata: Option<f32>, ) -> Result<Vec<f32>, GpuError>
Execute an algebra operation pixel-by-pixel (CPU fallback).
band_b is required for binary operations (Add, Subtract,
Multiply, Divide, Min, Max). For unary operations it is
ignored.
§Errors
Returns GpuError::InvalidKernelParams if band_a is empty.
Sourcepub fn evaluate_expression(
bands: &[&[f32]],
expression: &BandExpression,
nodata: Option<f32>,
) -> Result<Vec<f32>, GpuError>
pub fn evaluate_expression( bands: &[&[f32]], expression: &BandExpression, nodata: Option<f32>, ) -> Result<Vec<f32>, GpuError>
Evaluate a multi-band expression for every pixel.
All bands in bands must have the same length. Pixels where any
band holds the nodata value are written as nodata without evaluating
the expression.
§Errors
Returns GpuError::InvalidKernelParams if no bands are provided.
Propagates any error from expression.evaluate.
Auto Trait Implementations§
impl Freeze for GpuAlgebra
impl RefUnwindSafe for GpuAlgebra
impl Send for GpuAlgebra
impl Sync for GpuAlgebra
impl Unpin for GpuAlgebra
impl UnsafeUnpin for GpuAlgebra
impl UnwindSafe for GpuAlgebra
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more