pub struct GpuPixelBuffer {
pub pixels: Vec<f32>,
pub width: u32,
pub height: u32,
pub frame: u32,
pub seed: u32,
pub using_gpu: bool,
}Expand description
GPU pixel buffer for demo rendering
When gpu feature is enabled, this uses actual GPU compute via trueno/wgpu.
Otherwise falls back to CPU implementation.
Fields§
§pixels: Vec<f32>Pixel data (0.0 = uncovered, 1.0 = fully covered)
width: u32Buffer width
height: u32Buffer height
frame: u32Current frame number
seed: u32RNG seed
using_gpu: boolWhether GPU is being used
Implementations§
Source§impl GpuPixelBuffer
impl GpuPixelBuffer
Sourcepub fn new(width: u32, height: u32, seed: u64) -> Self
pub fn new(width: u32, height: u32, seed: u64) -> Self
Create new pixel buffer (tries GPU first, falls back to CPU)
Sourcepub fn gpu_available() -> bool
pub fn gpu_available() -> bool
Check if GPU acceleration is available
Sourcepub fn gpu_device_name() -> Option<String>
pub fn gpu_device_name() -> Option<String>
Get GPU device name if available
Sourcepub fn total_pixels(&self) -> usize
pub fn total_pixels(&self) -> usize
Total number of pixels
Sourcepub fn random_fill_pass(&mut self, probability: f32)
pub fn random_fill_pass(&mut self, probability: f32)
Execute random fill pass (GPU-accelerated when available)
Sourcepub fn fill_to_coverage(
&mut self,
target: f32,
probability: f32,
max_frames: u32,
)
pub fn fill_to_coverage( &mut self, target: f32, probability: f32, max_frames: u32, )
Run multiple fill passes until target coverage
Sourcepub fn coverage_stats(&self) -> CoverageStats
pub fn coverage_stats(&self) -> CoverageStats
Calculate coverage statistics
Sourcepub fn coverage_percentage(&self) -> f32
pub fn coverage_percentage(&self) -> f32
Get coverage percentage
Sourcepub fn find_gaps(&self) -> Vec<DemoGapRegion>
pub fn find_gaps(&self) -> Vec<DemoGapRegion>
Find gap regions (contiguous uncovered areas)
Sourcepub fn downsample(&self, term_width: usize, term_height: usize) -> Vec<f32>
pub fn downsample(&self, term_width: usize, term_height: usize) -> Vec<f32>
Downsample to terminal resolution
Sourcepub fn is_using_gpu(&self) -> bool
pub fn is_using_gpu(&self) -> bool
Check if this buffer is using GPU acceleration
Trait Implementations§
Source§impl Clone for GpuPixelBuffer
impl Clone for GpuPixelBuffer
Source§fn clone(&self) -> GpuPixelBuffer
fn clone(&self) -> GpuPixelBuffer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GpuPixelBuffer
impl RefUnwindSafe for GpuPixelBuffer
impl Send for GpuPixelBuffer
impl Sync for GpuPixelBuffer
impl Unpin for GpuPixelBuffer
impl UnsafeUnpin for GpuPixelBuffer
impl UnwindSafe for GpuPixelBuffer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more