pub struct BitmapBand<'bmp, P: Pixel> {
pub width: u32,
pub height: u32,
pub y_start: u32,
pub stride: usize,
/* private fields */
}Expand description
A mutable view into a horizontal band of a Bitmap.
Created by Bitmap::bands_mut. Provides the same row-access interface
as Bitmap<P> but covers only the rows [y_start, y_start + height).
Row indices passed to BitmapBand::row_and_alpha_mut and
BitmapBand::row_bytes_mut are absolute (i.e. in the same coordinate
space as the parent bitmap), not band-local.
Fields§
§width: u32Pixel width of the band (same as the parent bitmap width).
height: u32Number of rows in this band.
y_start: u32Absolute y-coordinate of the first row in the full bitmap.
stride: usizeByte distance between the start of consecutive rows.
Implementations§
Source§impl<P: Pixel> BitmapBand<'_, P>
impl<P: Pixel> BitmapBand<'_, P>
Sourcepub fn row_and_alpha_mut(&mut self, y: u32) -> (&mut [u8], Option<&mut [u8]>)
pub fn row_and_alpha_mut(&mut self, y: u32) -> (&mut [u8], Option<&mut [u8]>)
Simultaneous mutable access to the pixel row and the alpha row.
y is the absolute row index (must satisfy y_start ≤ y < y_start + height).
Returns (pixel_row_bytes, Some(alpha_row)) or (pixel_row_bytes, None).
§Panics
Panics if y is outside [y_start, y_start + height).