[−][src]Struct imagine::bitmaps::BitmapRGBA8
A grid of RGBA8
values, with a width
and height
.
- The
(0,0)
position is UNSPECIFIED, and depends on context.- If the bitmap is part of a parsed file then the file format probably has a convention.
- Image files usually place the origin in the Top Left, but OpenGL places
(0,0)
in the Bottom Left.
Methods
impl BitmapRGBA8
[src]
pub fn new(width: usize, height: usize) -> Self
[src]
Makes a new bitmap of default pixels.
pub fn width(&self) -> usize
[src]
Width of the bitmap.
pub fn height(&self) -> usize
[src]
Height of the bitmap.
pub fn pixels(&self) -> &[RGBA8]
[src]
pub fn pixels_mut(&mut self) -> &mut [RGBA8]
[src]
pub fn index_two_scanlines_mut(
&mut self,
a: usize,
b: usize
) -> (&mut [RGBA8], &mut [RGBA8])
[src]
&mut self,
a: usize,
b: usize
) -> (&mut [RGBA8], &mut [RGBA8])
Grabs two scanlines mutably. Kinda like "split at mut".
Panics
- If
a == b
. - If
a
orb
are illegal index values.
pub fn flip_scanlines(&mut self)
[src]
Vertically flip all the scanlines of the image.
Trait Implementations
impl Clone for BitmapRGBA8
[src]
fn clone(&self) -> BitmapRGBA8
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for BitmapRGBA8
[src]
impl Index<(usize, usize)> for BitmapRGBA8
[src]
type Output = RGBA8
The returned type after indexing.
fn index(&self, (x, y): (usize, usize)) -> &RGBA8
[src]
Index to a pixel
impl Index<(u32, u32)> for BitmapRGBA8
[src]
type Output = RGBA8
The returned type after indexing.
fn index(&self, (x, y): (u32, u32)) -> &RGBA8
[src]
Index to a pixel
impl Index<usize> for BitmapRGBA8
[src]
type Output = [RGBA8]
The returned type after indexing.
fn index(&self, y: usize) -> &[RGBA8]
[src]
Index to a scanline of pixels
impl Index<u32> for BitmapRGBA8
[src]
type Output = [RGBA8]
The returned type after indexing.
fn index(&self, y: u32) -> &[RGBA8]
[src]
Index to a scanline of pixels
impl IndexMut<(usize, usize)> for BitmapRGBA8
[src]
impl IndexMut<(u32, u32)> for BitmapRGBA8
[src]
impl IndexMut<usize> for BitmapRGBA8
[src]
impl IndexMut<u32> for BitmapRGBA8
[src]
Auto Trait Implementations
impl Send for BitmapRGBA8
impl Sync for BitmapRGBA8
impl Unpin for BitmapRGBA8
impl UnwindSafe for BitmapRGBA8
impl RefUnwindSafe for BitmapRGBA8
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,