pub struct GpuImageHistogram { /* private fields */ }Expand description
Resident exact 256-bin u32 counts for one logical u8 image channel.
Construction performs two compute passes without host readback. Input is
limited to u32::MAX pixels so every bin and their sum are exactly representable.
A live result is never recycled implicitly; call recycle when finished.
Implementations§
Source§impl GpuImageHistogram
impl GpuImageHistogram
Sourcepub const fn pixel_count(&self) -> u32
pub const fn pixel_count(&self) -> u32
Returns the source pixel count (also the sum of all bins).
Sourcepub const fn channel(&self) -> u32
pub const fn channel(&self) -> u32
Returns the selected logical channel, without implicit luma conversion.
Sourcepub const fn receipt(&self) -> &GpuImageReceipt
pub const fn receipt(&self) -> &GpuImageReceipt
Returns cumulative source transfers and histogram device-stage writes.
Sourcepub fn readback_u32(
&mut self,
runtime: &WgpuRuntime,
) -> SpatialResult<[u32; 256]>
pub fn readback_u32( &mut self, runtime: &WgpuRuntime, ) -> SpatialResult<[u32; 256]>
Explicitly synchronizes and reads exactly 1,024 bin bytes on native hosts. Each successful call adds another 1,024 bytes to the transfer receipt.
Sourcepub fn recycle(self, runtime: &WgpuRuntime)
pub fn recycle(self, runtime: &WgpuRuntime)
Returns bin storage to its runtime’s bounded buffer pool after submission. A different runtime discards this result instead of contaminating its pool.