Skip to main content

RendererMclip

Struct RendererMclip 

Source
pub struct RendererMclip<PF: PixelFormat> { /* private fields */ }
Expand description

Renderer that supports multiple independent clipping rectangles.

Port of C++ renderer_mclip<PixelFormat>. Each rendering call is automatically repeated for every clip box.

Implementations§

Source§

impl<PF: PixelFormat> RendererMclip<PF>

Source

pub fn new(ren: RendererBase<PF>) -> Self

Source

pub fn ren(&self) -> &RendererBase<PF>

Source

pub fn ren_mut(&mut self) -> &mut RendererBase<PF>

Source

pub fn add_clip_box(&mut self, x1: i32, y1: i32, x2: i32, y2: i32)

Add a clip box. The box is normalized and clipped to the buffer bounds.

Source

pub fn reset_clipping(&mut self, visibility: bool)

Reset clipping. If visibility is true, adds the full buffer as a clip box.

Source

pub fn bounding_clip_box(&self) -> &RectI

Source

pub fn clip_box_count(&self) -> usize

Source

pub fn copy_pixel(&mut self, x: i32, y: i32, c: &PF::ColorType)

Source

pub fn blend_pixel( &mut self, x: i32, y: i32, c: &PF::ColorType, cover: CoverType, )

Source

pub fn pixel(&self, x: i32, y: i32) -> PF::ColorType
where PF::ColorType: Default,

Source

pub fn copy_hline(&mut self, x1: i32, y: i32, x2: i32, c: &PF::ColorType)

Source

pub fn blend_hline( &mut self, x1: i32, y: i32, x2: i32, c: &PF::ColorType, cover: CoverType, )

Source

pub fn blend_vline( &mut self, x: i32, y1: i32, y2: i32, c: &PF::ColorType, cover: CoverType, )

Source

pub fn blend_solid_hspan( &mut self, x: i32, y: i32, len: i32, c: &PF::ColorType, covers: &[CoverType], )

Source

pub fn blend_color_hspan( &mut self, x: i32, y: i32, len: i32, colors: &[PF::ColorType], covers: &[CoverType], cover: CoverType, )

Auto Trait Implementations§

§

impl<PF> Freeze for RendererMclip<PF>
where PF: Freeze,

§

impl<PF> RefUnwindSafe for RendererMclip<PF>
where PF: RefUnwindSafe,

§

impl<PF> Send for RendererMclip<PF>
where PF: Send,

§

impl<PF> Sync for RendererMclip<PF>
where PF: Sync,

§

impl<PF> Unpin for RendererMclip<PF>
where PF: Unpin,

§

impl<PF> UnwindSafe for RendererMclip<PF>
where PF: UnwindSafe,

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