pub struct Context {
pub inner: ContextInner,
}
Expand description
Rendering context and API start point.
Fields§
§inner: ContextInner
Implementations§
Source§impl Context
impl Context
Sourcepub fn pixel_format(&self) -> PixelFormat
pub fn pixel_format(&self) -> PixelFormat
Returns the context’s pixel format.
Sourcepub fn path_builder(&self) -> Option<PathBuilder>
pub fn path_builder(&self) -> Option<PathBuilder>
Optionally returns a PathBuilder
. May return None
of old builder is still alive.
Sourcepub fn raster_builder(&self) -> Option<RasterBuilder>
pub fn raster_builder(&self) -> Option<RasterBuilder>
Optionally returns a RasterBuilder
. May return None
of old builder is still alive.
Sourcepub fn new_image_from_png<R: Read>(
&mut self,
reader: &mut Reader<R>,
) -> Result<Image, Error>
pub fn new_image_from_png<R: Read>( &mut self, reader: &mut Reader<R>, ) -> Result<Image, Error>
Creates a new image from PNG reader
.
Sourcepub fn get_current_image(&mut self, context: &ViewAssistantContext) -> Image
pub fn get_current_image(&mut self, context: &ViewAssistantContext) -> Image
Returns the context
’s current image.
Sourcepub fn render(
&mut self,
composition: &mut Composition,
clip: Option<Rect<u32>>,
image: Image,
ext: &RenderExt,
)
pub fn render( &mut self, composition: &mut Composition, clip: Option<Rect<u32>>, image: Image, ext: &RenderExt, )
Renders the composition with an optional clip to the image.
Sourcepub fn render_with_clip(
&mut self,
composition: &mut Composition,
clip: Rect<u32>,
image: Image,
ext: &RenderExt,
)
pub fn render_with_clip( &mut self, composition: &mut Composition, clip: Rect<u32>, image: Image, ext: &RenderExt, )
Renders the composition with a clip to the image.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl !RefUnwindSafe for Context
impl !Send for Context
impl !Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
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