Struct Image

Source
pub struct Image { /* private fields */ }

Implementations§

Source§

impl Image

Source

pub fn new(width: u32, height: u32) -> SharedImage

Source

pub fn from_image(filename: &str, include_colors: Option<bool>) -> SharedImage

Source

pub const fn width(&self) -> u32

Source

pub const fn height(&self) -> u32

Source

pub fn data_ptr(&mut self) -> *mut Color

Source

pub fn set(&mut self, x: i32, y: i32, data_str: &[&str])

Source

pub fn load( &mut self, x: i32, y: i32, filename: &str, include_colors: Option<bool>, )

Source

pub fn save(&self, filename: &str, scale: u32)

Source

pub fn clip(&mut self, x: f64, y: f64, width: f64, height: f64)

Source

pub fn clip0(&mut self)

Source

pub fn camera(&mut self, x: f64, y: f64)

Source

pub fn camera0(&mut self)

Source

pub fn pal(&mut self, src_color: Color, dst_color: Color)

Source

pub fn pal0(&mut self)

Source

pub fn dither(&mut self, alpha: f32)

Source

pub fn cls(&mut self, color: Color)

Source

pub fn pget(&mut self, x: f64, y: f64) -> Color

Source

pub fn pset(&mut self, x: f64, y: f64, color: Color)

Source

pub fn line(&mut self, x1: f64, y1: f64, x2: f64, y2: f64, color: Color)

Source

pub fn rect(&mut self, x: f64, y: f64, width: f64, height: f64, color: Color)

Source

pub fn rectb(&mut self, x: f64, y: f64, width: f64, height: f64, color: Color)

Source

pub fn circ(&mut self, x: f64, y: f64, radius: f64, color: Color)

Source

pub fn circb(&mut self, x: f64, y: f64, radius: f64, color: Color)

Source

pub fn elli(&mut self, x: f64, y: f64, width: f64, height: f64, color: Color)

Source

pub fn ellib(&mut self, x: f64, y: f64, width: f64, height: f64, color: Color)

Source

pub fn tri( &mut self, x1: f64, y1: f64, x2: f64, y2: f64, x3: f64, y3: f64, color: Color, )

Source

pub fn trib( &mut self, x1: f64, y1: f64, x2: f64, y2: f64, x3: f64, y3: f64, color: Color, )

Source

pub fn fill(&mut self, x: f64, y: f64, color: Color)

Source

pub fn blt( &mut self, x: f64, y: f64, image: SharedImage, image_x: f64, image_y: f64, width: f64, height: f64, transparent: Option<Color>, rotate: Option<f64>, scale: Option<f64>, )

Source

pub fn bltm( &mut self, x: f64, y: f64, tilemap: SharedTilemap, tilemap_x: f64, tilemap_y: f64, width: f64, height: f64, transparent: Option<Color>, rotate: Option<f64>, scale: Option<f64>, )

Source

pub fn text( &mut self, x: f64, y: f64, string: &str, color: Color, font: Option<SharedFont>, )

Auto Trait Implementations§

§

impl Freeze for Image

§

impl RefUnwindSafe for Image

§

impl Send for Image

§

impl Sync for Image

§

impl Unpin for Image

§

impl UnwindSafe for Image

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V