Struct geng_draw2d::Quad

source ·
pub struct Quad {
    pub transform: mat3<f32>,
    pub color: Rgba<f32>,
}

Fields§

§transform: mat3<f32>§color: Rgba<f32>

Implementations§

source§

impl Quad

source

pub fn new(aabb: Aabb2<f32>, color: Rgba<f32>) -> Self

source

pub fn unit(color: Rgba<f32>) -> Self

Trait Implementations§

source§

impl Draw2d for Quad

source§

fn draw2d_transformed( &self, helper: &Helper, framebuffer: &mut Framebuffer<'_>, camera: &dyn AbstractCamera2d, transform: mat3<f32> )

source§

fn draw2d( &self, helper: &Helper, framebuffer: &mut Framebuffer<'_>, camera: &dyn AbstractCamera2d )

source§

impl Transform2d<f32> for Quad

source§

fn bounding_quad(&self) -> Quad<f32>

Object’s bounding Quad
source§

fn apply_transform(&mut self, transform: mat3<f32>)

Apply transformation matrix to this object

Auto Trait Implementations§

§

impl RefUnwindSafe for Quad

§

impl Send for Quad

§

impl Sync for Quad

§

impl Unpin for Quad

§

impl UnwindSafe for Quad

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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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

impl<F, T> Transform2dExt<F> for T
where F: Float, T: Transform2d<F> + ?Sized,

source§

fn transform(self, transform: mat3<F>) -> Self
where Self: Sized,

Apply transformation to the object, returning a modified value to allow chaining methods
source§

fn align_bounding_box(self, alignment: vec2<F>) -> Self
where Self: Sized,

Align bounding box of this object, making its origin located at (0, 0) Read more
source§

fn rotate(self, angle: Angle<F>) -> Self
where Self: Sized,

Rotate object around (0, 0) by given angle
source§

fn translate(self, delta: vec2<F>) -> Self
where Self: Sized,

Translate object by given vector
source§

fn scale(self, factor: vec2<F>) -> Self
where Self: Sized,

Scale object around (0, 0) by given factor
source§

fn scale_uniform(self, factor: F) -> Self
where Self: Sized,

Scale object around (0, 0) by given factor uniformly along both axis
source§

fn transformed(&self) -> Transformed2d<'_, F, Self>

Create a reference to this object with additional transformation applied
source§

fn bounding_box(&self) -> Aabb2<F>

Calculate bounding box of this object, getting Aabb2 instead of a Quad
source§

fn fit_into(self, target: impl FitTarget2d<F>) -> Self
where Self: Sized,

Make this object’s bounding Quad fit into given target
source§

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

§

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>,

§

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.
§

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

§

fn vzip(self) -> V