[][src]Struct imagine::bitmaps::BitmapRGBA8

pub struct BitmapRGBA8 { /* fields omitted */ }

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]

Grabs two scanlines mutably. Kinda like "split at mut".

Panics

  • If a == b.
  • If a or b 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]

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]

fn index_mut(&mut self, (x, y): (usize, usize)) -> &mut RGBA8[src]

IndexMut to a pixel

impl IndexMut<(u32, u32)> for BitmapRGBA8[src]

fn index_mut(&mut self, (x, y): (u32, u32)) -> &mut RGBA8[src]

IndexMut to a pixel

impl IndexMut<usize> for BitmapRGBA8[src]

fn index_mut(&mut self, y: usize) -> &mut [RGBA8][src]

IndexMut to a scanline of pixels

impl IndexMut<u32> for BitmapRGBA8[src]

fn index_mut(&mut self, y: u32) -> &mut [RGBA8][src]

IndexMut to a scanline of pixels

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]