pub struct RenderCtx<'a, D>where
D: DrawTarget<Color = Rgb565>,{ /* private fields */ }Implementations§
Source§impl<'a, D> RenderCtx<'a, D>where
D: DrawTarget<Color = Rgb565>,
impl<'a, D> RenderCtx<'a, D>where
D: DrawTarget<Color = Rgb565>,
pub fn new(target: &'a mut D, viewport: Rect) -> Self
pub fn with_dirty(target: &'a mut D, viewport: Rect, dirty: Rect) -> Self
pub const fn clip(&self) -> Rect
pub fn set_clip(&mut self, clip: Rect)
pub const fn quality(&self) -> RenderQuality
pub fn set_quality(&mut self, quality: RenderQuality)
pub const fn backend_caps(&self) -> RenderBackendCaps
pub fn set_backend_caps(&mut self, caps: RenderBackendCaps)
pub fn push_transform(&mut self, transform: Transform2D)
pub fn pop_transform(&mut self)
pub fn translate(&mut self, x: f32, y: f32)
pub fn scale(&mut self, x: f32, y: f32)
pub fn rotate(&mut self, deg: f32)
pub fn skew(&mut self, x_deg: f32, y_deg: f32)
pub fn push_layer(&mut self, layer: LayerState)
pub fn pop_layer(&mut self)
pub const fn shadow_spread_for(&self, spread: u8) -> u8
pub fn fill_rect(&mut self, rect: Rect, color: Rgb565) -> Result<(), D::Error>
pub fn fill_rect_alpha( &mut self, rect: Rect, color: Rgb565, opacity: u8, ) -> Result<(), D::Error>
pub fn fill_rounded_rect( &mut self, rect: Rect, radius: u8, color: Rgb565, ) -> Result<(), D::Error>
pub fn fill_rounded_rect_alpha( &mut self, rect: Rect, radius: u8, color: Rgb565, opacity: u8, ) -> Result<(), D::Error>
pub fn fill_rounded_rect_gradient_alpha( &mut self, rect: Rect, radius: u8, gradient: LinearGradient, opacity: u8, ) -> Result<(), D::Error>
pub fn stroke_rect( &mut self, rect: Rect, border: Border, ) -> Result<(), D::Error>
pub fn stroke_rect_alpha( &mut self, rect: Rect, border: Border, opacity: u8, ) -> Result<(), D::Error>
pub fn stroke_rounded_rect( &mut self, rect: Rect, radius: u8, border: Border, ) -> Result<(), D::Error>
pub fn stroke_rounded_rect_alpha( &mut self, rect: Rect, radius: u8, border: Border, opacity: u8, ) -> Result<(), D::Error>
pub fn draw_text( &mut self, x: i32, y: i32, text: &str, color: Rgb565, ) -> Result<(), D::Error>
pub fn draw_text_with_font( &mut self, x: i32, y: i32, text: &str, color: Rgb565, font: FontId, ) -> Result<(), D::Error>
pub fn draw_text_in( &mut self, rect: Rect, text: &str, style: TextStyle, ) -> Result<(), D::Error>
pub fn draw_text_shaped_in<S, const N: usize>(
&mut self,
rect: Rect,
text: &str,
style: TextStyle,
shaper: &S,
config: ShapingConfig,
) -> Result<(), D::Error>where
S: TextShaper,
pub fn draw_text_in_with_font( &mut self, rect: Rect, text: &str, style: TextStyle, font: FontId, ) -> Result<(), D::Error>
pub fn draw_line_in( &mut self, rect: Rect, line: Line<'_>, ) -> Result<(), D::Error>
pub fn draw_line( &mut self, x0: i32, y0: i32, x1: i32, y1: i32, color: Rgb565, ) -> Result<(), D::Error>
pub fn draw_line_styled( &mut self, x0: i32, y0: i32, x1: i32, y1: i32, style: StrokeStyle, ) -> Result<(), D::Error>
pub fn fill_circle( &mut self, center_x: i32, center_y: i32, radius: u32, color: Rgb565, ) -> Result<(), D::Error>
pub fn stroke_circle( &mut self, center_x: i32, center_y: i32, radius: u32, color: Rgb565, ) -> Result<(), D::Error>
pub fn stroke_arc( &mut self, center_x: i32, center_y: i32, radius: u32, start_deg: i32, end_deg: i32, color: Rgb565, ) -> Result<(), D::Error>
pub fn stroke_arc_styled( &mut self, center_x: i32, center_y: i32, radius: u32, start_deg: i32, end_deg: i32, style: StrokeStyle, ) -> Result<(), D::Error>
Sourcepub fn fill_sector_sweep(
&mut self,
center_x: i32,
center_y: i32,
radius: u32,
start_deg: f32,
sweep_deg: f32,
color: Rgb565,
) -> Result<(), D::Error>
pub fn fill_sector_sweep( &mut self, center_x: i32, center_y: i32, radius: u32, start_deg: f32, sweep_deg: f32, color: Rgb565, ) -> Result<(), D::Error>
Fill a sector (“pie slice”) using a start angle and sweep angle in degrees.
Positive sweep draws counterclockwise, negative sweep clockwise.
pub fn fill_polygon( &mut self, points: &[Point], color: Rgb565, ) -> Result<(), D::Error>
pub fn draw_image( &mut self, rect: Rect, image: ImageRef<'_>, fit: ImageFit, ) -> Result<(), D::Error>
pub fn draw_image_region( &mut self, rect: Rect, image: ImageRef<'_>, fit: ImageFit, src_rect: Rect, ) -> Result<(), D::Error>
pub fn draw_image_transformed( &mut self, rect: Rect, image: ImageRef<'_>, scale: f32, rotation_deg: f32, ) -> Result<(), D::Error>
pub fn fill_rect_masked( &mut self, rect: Rect, color: Rgb565, mask: fn(i32, i32) -> bool, ) -> Result<(), D::Error>
pub fn draw_text_model_in( &mut self, rect: Rect, text: Text<'_>, ) -> Result<(), D::Error>
pub fn text_metrics(text: &str) -> TextMetrics
pub fn text_metrics_with_font(text: &str, font: FontId) -> TextMetrics
pub fn text_metrics_wrapped( text: &str, max_width: u32, wrap: TextWrap, ) -> TextMetrics
pub fn text_metrics_wrapped_with_font( text: &str, max_width: u32, wrap: TextWrap, font: FontId, ) -> TextMetrics
Auto Trait Implementations§
impl<'a, D> !UnwindSafe for RenderCtx<'a, D>
impl<'a, D> Freeze for RenderCtx<'a, D>
impl<'a, D> RefUnwindSafe for RenderCtx<'a, D>where
D: RefUnwindSafe,
impl<'a, D> Send for RenderCtx<'a, D>where
D: Send,
impl<'a, D> Sync for RenderCtx<'a, D>where
D: Sync,
impl<'a, D> Unpin for RenderCtx<'a, D>
impl<'a, D> UnsafeUnpin for RenderCtx<'a, D>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.