[][src]Struct blend2d::context::Context

#[repr(transparent)]
pub struct Context { /* fields omitted */ }

Methods

impl Context[src]

pub fn new(target: &mut Image) -> Result<Context>[src]

pub fn target_size(&self) -> SizeD[src]

pub fn target_width(&self) -> f64[src]

pub fn target_height(&self) -> f64[src]

pub fn context_type(&self) -> ContextType[src]

pub fn begin(&mut self, image: &mut Image) -> Result<()>[src]

pub fn end(self) -> Result<()>[src]

pub fn flush(&mut self, flags: ContextFlushFlags)[src]

pub fn saved_state_count(&self) -> usize[src]

pub fn save(&mut self) -> Result<()>[src]

pub fn restore(&mut self) -> Result<()>[src]

pub fn with_pushed_context<F>(&mut self, f: F) -> Result<()> where
    F: FnOnce(&mut Self) -> Result<()>, 
[src]

pub fn hints(&self) -> &ContextHints[src]

pub fn set_hint(&mut self, hint: ContextHint, value: u32) -> Result<()>[src]

pub fn approximation_options(&self) -> &ApproximationOptions[src]

pub fn flatten_mode(&self) -> FlattenMode[src]

pub fn set_flatten_mode(&mut self, mode: FlattenMode) -> Result<()>[src]

pub fn flatten_tolerance(&self) -> f64[src]

pub fn set_flatten_tolerance(&mut self, tolerance: f64) -> Result<()>[src]

pub fn comp_op(&self) -> CompOp[src]

pub fn set_comp_op(&mut self, comp_op: CompOp) -> Result<()>[src]

pub fn global_alpha(&self) -> f64[src]

pub fn set_global_alpha(&mut self, alpha: f64) -> Result<()>[src]

impl Context[src]

pub fn fill_style_type(&self) -> StyleType[src]

pub fn set_fill_style_gradient<T: GradientType>(
    &mut self,
    gradient: &Gradient<T>
) -> Result<()>
[src]

pub fn set_fill_style_pattern(&mut self, pattern: &Pattern) -> Result<()>[src]

pub fn set_fill_style_image(&mut self, image: &Image) -> Result<()>[src]

pub fn set_fill_style_rgba32(&mut self, color: u32) -> Result<()>[src]

pub fn set_fill_style_rgba64(&mut self, color: u64) -> Result<()>[src]

pub fn get_fill_style_gradient(&self) -> Result<DynamicGradient>[src]

pub fn get_fill_style_rgba32(&self) -> Result<u32>[src]

pub fn get_fill_style_rgba64(&self) -> Result<u64>[src]

pub fn stroke_width(&self) -> f64[src]

pub fn stroke_miter_limit(&self) -> f64[src]

pub fn stroke_dast_offset(&self) -> f64[src]

pub fn stroke_options(&self) -> &StrokeOptions[src]

pub fn set_stroke_miter_limit(&mut self, limit: f64) -> Result<()>[src]

pub fn set_stroke_width(&mut self, width: f64) -> Result<()>[src]

pub fn set_stroke_join(&mut self, join: StrokeJoin) -> Result<()>[src]

pub fn set_stroke_cap(
    &mut self,
    pos: StrokeCapPosition,
    cap: StrokeCap
) -> Result<()>
[src]

pub fn set_stroke_start_cap(&mut self, cap: StrokeCap) -> Result<()>[src]

pub fn set_stroke_end_cap(&mut self, cap: StrokeCap) -> Result<()>[src]

pub fn set_stroke_caps(&mut self, cap: u32) -> Result<()>[src]

pub fn set_stroke_dash_offset(&mut self, offset: f64) -> Result<()>[src]

pub fn set_stroke_dash_array(&mut self, dash_array: &Array<f64>) -> Result<()>[src]

pub fn set_stroke_options(&mut self, opts: &StrokeOptions) -> Result<()>[src]

pub fn stroke_alpha(&self) -> f64[src]

pub fn set_stroke_alpha(&mut self, alpha: f64) -> Result<()>[src]

pub fn stroke_style_type(&self) -> StyleType[src]

pub fn set_stroke_style_gradient<T: GradientType>(
    &mut self,
    gradient: &Gradient<T>
) -> Result<()>
[src]

pub fn set_stroke_style_image(&mut self, image: &Image) -> Result<()>[src]

pub fn set_stroke_style_rgba32(&mut self, color: u32) -> Result<()>[src]

pub fn set_stroke_style_rgba64(&mut self, color: u64) -> Result<()>[src]

pub fn get_stroke_style_gradient(&self) -> Result<DynamicGradient>[src]

pub fn get_stroke_style_rgba32(&self) -> Result<u32>[src]

pub fn get_stroke_style_rgba64(&self) -> Result<u64>[src]

pub fn set_op_style_rgba32(&mut self, op: ContextOpType, val: u32) -> Result<()>[src]

pub fn set_op_style_rgba64(&mut self, op: ContextOpType, val: u64) -> Result<()>[src]

pub fn get_op_style_rgba32(&self, op: ContextOpType) -> Result<u32>[src]

pub fn get_op_style_rgba64(&self, op: ContextOpType) -> Result<u64>[src]

pub fn op_alpha(&self, op: ContextOpType) -> f64[src]

pub fn set_op_alpha(&mut self, op: ContextOpType, alpha: f64) -> Result<()>[src]

impl Context[src]

Clip Operations

pub fn restore_clipping(&mut self) -> Result<()>[src]

pub fn clip_to_rect<R: Rect>(&mut self, rect: &R) -> Result<()>[src]

pub fn clip_to(&mut self, x: f64, y: f64, w: f64, h: f64) -> Result<()>[src]

impl Context[src]

Clear Operations

pub fn clear_all(&mut self) -> Result<()>[src]

pub fn clear_rect<R: Rect>(&mut self, rect: &R) -> Result<()>[src]

pub fn clear(&mut self, x: f64, y: f64, w: f64, h: f64) -> Result<()>[src]

pub fn blit_image<P: Point>(
    &mut self,
    dst: &P,
    src: &Image,
    src_area: Option<&RectI>
) -> Result<()>
[src]

pub fn blit_scaled_image<R: Rect>(
    &mut self,
    dst: &R,
    src: &Image,
    src_area: Option<&RectI>
) -> Result<()>
[src]

impl Context[src]

Fill Operations

pub fn fill_geometry<T: Geometry + ?Sized>(&mut self, geo: &T) -> Result<()>[src]

pub fn fill_all(&mut self) -> Result<()>[src]

pub fn fill_box(&mut self, x0: f64, y0: f64, x1: f64, y1: f64) -> Result<()>[src]

pub fn fill_rect(&mut self, x: f64, y: f64, w: f64, h: f64) -> Result<()>[src]

pub fn fill_circle(&mut self, cx: f64, cy: f64, r: f64) -> Result<()>[src]

pub fn fill_ellipse(&mut self, cx: f64, cy: f64, rx: f64, ry: f64) -> Result<()>[src]

pub fn fill_round_rect(
    &mut self,
    x: f64,
    y: f64,
    w: f64,
    h: f64,
    rx: f64,
    ry: f64
) -> Result<()>
[src]

pub fn fill_arc(
    &mut self,
    cx: f64,
    cy: f64,
    rx: f64,
    ry: f64,
    start: f64,
    sweep: f64
) -> Result<()>
[src]

pub fn fill_chord(
    &mut self,
    cx: f64,
    cy: f64,
    rx: f64,
    ry: f64,
    start: f64,
    sweep: f64
) -> Result<()>
[src]

pub fn fill_pie(
    &mut self,
    cx: f64,
    cy: f64,
    rx: f64,
    ry: f64,
    start: f64,
    sweep: f64
) -> Result<()>
[src]

pub fn fill_triangle(
    &mut self,
    x0: f64,
    y0: f64,
    x1: f64,
    y1: f64,
    x2: f64,
    y2: f64
) -> Result<()>
[src]

pub fn fill_path(&mut self, p: &Path) -> Result<()>[src]

pub fn fill_polygon<R, P>(&mut self, poly: R) -> Result<()> where
    [P]: Geometry,
    R: AsRef<[P]>,
    P: Point
[src]

pub fn fill_slice<R, P>(&mut self, slice: R) -> Result<()> where
    [P]: Geometry,
    R: AsRef<[P]>,
    P: GeoViewArray
[src]

impl Context[src]

Stroke Operations

pub fn stroke_geometry<T: Geometry + ?Sized>(&mut self, geo: &T) -> Result<()>[src]

pub fn stroke_box(&mut self, x0: f64, y0: f64, x1: f64, y1: f64) -> Result<()>[src]

pub fn stroke_rect(&mut self, x: f64, y: f64, w: f64, h: f64) -> Result<()>[src]

pub fn stroke_line(&mut self, x0: f64, y0: f64, x1: f64, y1: f64) -> Result<()>[src]

pub fn stroke_circle(&mut self, cx: f64, cy: f64, r: f64) -> Result<()>[src]

pub fn stroke_ellipse(
    &mut self,
    cx: f64,
    cy: f64,
    rx: f64,
    ry: f64
) -> Result<()>
[src]

pub fn stroke_round_rect(
    &mut self,
    x: f64,
    y: f64,
    w: f64,
    h: f64,
    rx: f64,
    ry: f64
) -> Result<()>
[src]

pub fn stroke_arc(
    &mut self,
    cx: f64,
    cy: f64,
    rx: f64,
    ry: f64,
    start: f64,
    sweep: f64
) -> Result<()>
[src]

pub fn stroke_chord(
    &mut self,
    cx: f64,
    cy: f64,
    rx: f64,
    ry: f64,
    start: f64,
    sweep: f64
) -> Result<()>
[src]

pub fn stroke_pie(
    &mut self,
    cx: f64,
    cy: f64,
    rx: f64,
    ry: f64,
    start: f64,
    sweep: f64
) -> Result<()>
[src]

pub fn stroke_triangle(
    &mut self,
    x0: f64,
    y0: f64,
    x1: f64,
    y1: f64,
    x2: f64,
    y2: f64
) -> Result<()>
[src]

pub fn stroke_path(&mut self, p: &Path) -> Result<()>[src]

pub fn stroke_polygon<R, P>(&mut self, poly: R) -> Result<()> where
    [P]: Geometry,
    R: AsRef<[P]>,
    P: Point
[src]

pub fn stroke_polyline<R, P>(&mut self, poly: R) -> Result<()> where
    [P]: Geometry,
    R: AsRef<[P]>,
    P: Point
[src]

pub fn stroke_slice<R, P>(&mut self, slice: R) -> Result<()> where
    [P]: Geometry,
    R: AsRef<[P]>,
    P: GeoViewArray
[src]

Trait Implementations

impl ArrayType for Context[src]

impl MatrixTransform for Context[src]

fn set_matrix(&mut self, m: &Matrix2D) -> Result<()>[src]

fn reset_matrix(&mut self) -> Result<()>[src]

fn translate(&mut self, x: f64, y: f64) -> Result<()>[src]

fn translate_point<P: Point>(&mut self, p: &P) -> Result<()>[src]

fn scale(&mut self, x: f64, y: f64) -> Result<()>[src]

fn scale_point<P: Point>(&mut self, p: &P) -> Result<()>[src]

fn skew(&mut self, x: f64, y: f64) -> Result<()>[src]

fn skew_point<P: Point>(&mut self, p: &P) -> Result<()>[src]

fn rotate(&mut self, angle: f64) -> Result<()>[src]

fn rotate_around(&mut self, angle: f64, x: f64, y: f64) -> Result<()>[src]

fn rotate_around_point<P: Point>(&mut self, angle: f64, p: &P) -> Result<()>[src]

fn transform(&mut self, mat: &Matrix2D) -> Result<()>[src]

fn post_translate(&mut self, x: f64, y: f64) -> Result<()>[src]

fn post_translate_point<P: Point>(&mut self, p: &P) -> Result<()>[src]

fn post_scale(&mut self, x: f64, y: f64) -> Result<()>[src]

fn post_scale_point<P: Point>(&mut self, p: &P) -> Result<()>[src]

fn post_skew(&mut self, x: f64, y: f64) -> Result<()>[src]

fn post_skew_point<P: Point>(&mut self, p: &P) -> Result<()>[src]

fn post_rotate(&mut self, angle: f64) -> Result<()>[src]

fn post_rotate_around(&mut self, angle: f64, x: f64, y: f64) -> Result<()>[src]

fn post_rotate_around_point<P: Point>(
    &mut self,
    angle: f64,
    p: &P
) -> Result<()>
[src]

fn post_transform(&mut self, mat: &Matrix2D) -> Result<()>[src]

impl Drop for Context[src]

impl PartialEq<Context> for Context[src]

#[must_use]
default fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

Auto Trait Implementations

impl !Send for Context

impl !Sync for Context

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.