pub struct RasterStream { /* private fields */ }Expand description
A stream of raster chunks.
Implementations§
Source§impl RasterStream
impl RasterStream
Sourcepub fn new(config: RasterStreamConfig, metadata: RasterMetadata) -> Result<Self>
pub fn new(config: RasterStreamConfig, metadata: RasterMetadata) -> Result<Self>
Create a new raster stream.
Sourcepub fn calculate_chunks(
width: usize,
height: usize,
chunk_width: usize,
chunk_height: usize,
overlap: usize,
) -> (usize, usize)
pub fn calculate_chunks( width: usize, height: usize, chunk_width: usize, chunk_height: usize, overlap: usize, ) -> (usize, usize)
Calculate the number of chunks needed.
Sourcepub fn chunk_bbox(&self, row: usize, col: usize) -> Result<BoundingBox>
pub fn chunk_bbox(&self, row: usize, col: usize) -> Result<BoundingBox>
Get the bounding box for a specific chunk.
Sourcepub fn chunk_geotransform(&self, row: usize, col: usize) -> Result<GeoTransform>
pub fn chunk_geotransform(&self, row: usize, col: usize) -> Result<GeoTransform>
Get the geotransform for a specific chunk.
Sourcepub async fn memory_stats(&self) -> MemoryStats
pub async fn memory_stats(&self) -> MemoryStats
Get memory usage statistics.
Trait Implementations§
Source§impl RasterStreaming for RasterStream
impl RasterStreaming for RasterStream
Source§fn next_chunk<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<RasterChunk>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn next_chunk<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<RasterChunk>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the next chunk from the stream.
Source§fn next_chunks<'life0, 'async_trait>(
&'life0 mut self,
count: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<RasterChunk>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn next_chunks<'life0, 'async_trait>(
&'life0 mut self,
count: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<RasterChunk>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get multiple chunks in parallel.
Source§fn seek_to_chunk<'life0, 'async_trait>(
&'life0 mut self,
row: usize,
col: usize,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn seek_to_chunk<'life0, 'async_trait>(
&'life0 mut self,
row: usize,
col: usize,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Skip to a specific chunk by index.
Source§fn total_chunks(&self) -> (usize, usize)
fn total_chunks(&self) -> (usize, usize)
Get the total number of chunks.
Source§fn current_position(&self) -> (usize, usize)
fn current_position(&self) -> (usize, usize)
Get the current position in the stream.
Source§fn has_more_chunks(&self) -> bool
fn has_more_chunks(&self) -> bool
Check if the stream has more chunks.
Auto Trait Implementations§
impl !RefUnwindSafe for RasterStream
impl !UnwindSafe for RasterStream
impl Freeze for RasterStream
impl Send for RasterStream
impl Sync for RasterStream
impl Unpin for RasterStream
impl UnsafeUnpin for RasterStream
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