[][src]Struct msdfgen::Bitmap

#[repr(C)]
pub struct Bitmap<T> { /* fields omitted */ }

Bitmap object

Methods

impl<T> Bitmap<T> where
    T: PngColorType + Copy,
    T::PngPixelType: From<T>, 
[src]

pub fn write_png(&self, writer: impl Write) -> Result<(), EncodingError>[src]

Save bitmap as png

impl<T> Bitmap<T> where
    T: PngColorType,
    T: From<<T as PngColorType>::PngPixelType>,
    T::PngPixelType: Copy
[src]

pub fn read_png(reader: impl Read) -> Result<Bitmap<T>, DecodingError>[src]

Load bitmap from png

impl<T> Bitmap<T>[src]

pub fn new(width: u32, height: u32) -> Self[src]

Create new bitmap with specified size

impl<T> Bitmap<T>[src]

pub fn width(&self) -> u32[src]

Get width of bitmap in pixels

pub fn height(&self) -> u32[src]

Get height of bitmap in pixels

pub fn pixels(&self) -> &[T][src]

Get pixel data slice for reading from

pub fn pixels_mut(&mut self) -> &mut [T][src]

Get pixel data slice for writing to

pub fn raw_pixels(&self) -> &[u8][src]

Get raw pixels data for reading from

pub fn raw_pixels_mut(&mut self) -> &mut [u8][src]

Get raw pixels data for writing to

pub fn pixel(&self, x: u32, y: u32) -> &T[src]

Get pixel with specified coordinates

pub fn pixel_mut(&mut self, x: u32, y: u32) -> &mut T[src]

Get pixel with specified coordinates

pub fn invert(&mut self) where
    T: Pixel
[src]

Invert pixels colors

pub fn flip_x(&mut self)[src]

Flip pixels around y axis

pub fn flip_y(&mut self)[src]

Flip pixels around y axis

pub fn convert<R>(&self) -> Bitmap<R> where
    T: Copy,
    R: From<T>, 
[src]

Convert bitmap data type

impl<S> Bitmap<S>[src]

pub fn render<T: RenderTarget<S>>(&self, target: &mut Bitmap<T>, px_range: f64)[src]

Trait Implementations

impl<T> Drop for Bitmap<T>[src]

impl<'a, A, T> From<&'a Bitmap<A>> for Bitmap<T> where
    A: Copy,
    T: From<A>, 
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Bitmap<T> where
    T: RefUnwindSafe

impl<T> !Send for Bitmap<T>

impl<T> !Sync for Bitmap<T>

impl<T> Unpin for Bitmap<T>

impl<T> UnwindSafe for Bitmap<T> where
    T: RefUnwindSafe

Blanket Implementations

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

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

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

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

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

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

type Error = Infallible

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.