Skip to main content

GpuRasterBuffer

Struct GpuRasterBuffer 

Source
pub struct GpuRasterBuffer<T: Pod> { /* private fields */ }
Expand description

GPU raster buffer for multi-band raster data.

This struct manages GPU buffers for multi-band raster data with efficient interleaved or planar storage.

Implementations§

Source§

impl<T: Pod + Zeroable> GpuRasterBuffer<T>

Source

pub fn new( context: &GpuContext, width: u32, height: u32, num_bands: usize, usage: BufferUsages, ) -> GpuResult<Self>

Create a new GPU raster buffer.

§Errors

Returns an error if buffer creation fails.

Source

pub fn from_bands( context: &GpuContext, width: u32, height: u32, bands_data: &[Vec<T>], usage: BufferUsages, ) -> GpuResult<Self>

Create a GPU raster buffer from data.

§Errors

Returns an error if buffer creation or upload fails.

Source

pub fn band(&self, index: usize) -> Option<&GpuBuffer<T>>

Get a specific band buffer.

Source

pub fn band_mut(&mut self, index: usize) -> Option<&mut GpuBuffer<T>>

Get mutable reference to a specific band buffer.

Source

pub fn bands(&self) -> &[GpuBuffer<T>]

Get all band buffers.

Source

pub fn num_bands(&self) -> usize

Get the number of bands.

Source

pub fn dimensions(&self) -> (u32, u32)

Get raster dimensions.

Source

pub fn width(&self) -> u32

Get raster width.

Source

pub fn height(&self) -> u32

Get raster height.

Source

pub async fn read_all_bands(&self) -> GpuResult<Vec<Vec<T>>>

Read all bands from GPU asynchronously.

§Errors

Returns an error if reading fails.

Source

pub fn read_all_bands_blocking(&self) -> GpuResult<Vec<Vec<T>>>

Read all bands from GPU synchronously.

§Errors

Returns an error if reading fails.

Trait Implementations§

Source§

impl<T: Pod> Debug for GpuRasterBuffer<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> Freeze for GpuRasterBuffer<T>

§

impl<T> !RefUnwindSafe for GpuRasterBuffer<T>

§

impl<T> Send for GpuRasterBuffer<T>
where T: Send,

§

impl<T> Sync for GpuRasterBuffer<T>
where T: Sync,

§

impl<T> Unpin for GpuRasterBuffer<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for GpuRasterBuffer<T>

§

impl<T> !UnwindSafe for GpuRasterBuffer<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,