Trait gtk4::prelude::SnapshotExt

source ·
pub trait SnapshotExt: 'static {
Show 44 methods // Required methods fn append_cairo(&self, bounds: &Rect) -> Context; fn append_color(&self, color: &RGBA, bounds: &Rect); fn append_conic_gradient( &self, bounds: &Rect, center: &Point, rotation: f32, stops: &[ColorStop] ); fn append_inset_shadow( &self, outline: &RoundedRect, color: &RGBA, dx: f32, dy: f32, spread: f32, blur_radius: f32 ); fn append_layout(&self, layout: &Layout, color: &RGBA); fn append_linear_gradient( &self, bounds: &Rect, start_point: &Point, end_point: &Point, stops: &[ColorStop] ); fn append_node(&self, node: impl AsRef<RenderNode>); fn append_outset_shadow( &self, outline: &RoundedRect, color: &RGBA, dx: f32, dy: f32, spread: f32, blur_radius: f32 ); fn append_radial_gradient( &self, bounds: &Rect, center: &Point, hradius: f32, vradius: f32, start: f32, end: f32, stops: &[ColorStop] ); fn append_repeating_linear_gradient( &self, bounds: &Rect, start_point: &Point, end_point: &Point, stops: &[ColorStop] ); fn append_repeating_radial_gradient( &self, bounds: &Rect, center: &Point, hradius: f32, vradius: f32, start: f32, end: f32, stops: &[ColorStop] ); fn append_scaled_texture( &self, texture: &impl IsA<Texture>, filter: ScalingFilter, bounds: &Rect ); fn append_texture(&self, texture: &impl IsA<Texture>, bounds: &Rect); fn gl_shader_pop_texture(&self); fn perspective(&self, depth: f32); fn pop(&self); fn push_blend(&self, blend_mode: BlendMode); fn push_blur(&self, radius: f64); fn push_clip(&self, bounds: &Rect); fn push_color_matrix(&self, color_matrix: &Matrix, color_offset: &Vec4); fn push_cross_fade(&self, progress: f64); fn push_gl_shader(&self, shader: &GLShader, bounds: &Rect, take_args: Bytes); fn push_mask(&self, mask_mode: MaskMode); fn push_opacity(&self, opacity: f64); fn push_repeat(&self, bounds: &Rect, child_bounds: Option<&Rect>); fn push_rounded_clip(&self, bounds: &RoundedRect); fn push_shadow(&self, shadow: &[Shadow]); fn render_background( &self, context: &impl IsA<StyleContext>, x: f64, y: f64, width: f64, height: f64 ); fn render_focus( &self, context: &impl IsA<StyleContext>, x: f64, y: f64, width: f64, height: f64 ); fn render_frame( &self, context: &impl IsA<StyleContext>, x: f64, y: f64, width: f64, height: f64 ); fn render_insertion_cursor( &self, context: &impl IsA<StyleContext>, x: f64, y: f64, layout: &Layout, index: i32, direction: Direction ); fn render_layout( &self, context: &impl IsA<StyleContext>, x: f64, y: f64, layout: &Layout ); fn restore(&self); fn rotate(&self, angle: f32); fn rotate_3d(&self, angle: f32, axis: &Vec3); fn save(&self); fn scale(&self, factor_x: f32, factor_y: f32); fn scale_3d(&self, factor_x: f32, factor_y: f32, factor_z: f32); fn to_node(self) -> Option<RenderNode>; fn to_paintable(self, size: Option<&Size>) -> Option<Paintable>; fn transform(&self, transform: Option<&Transform>); fn transform_matrix(&self, matrix: &Matrix); fn translate(&self, point: &Point); fn translate_3d(&self, point: &Point3D);
}
Expand description

Trait containing all Snapshot methods.

Implementors

Snapshot

Required Methods§

source

fn append_cairo(&self, bounds: &Rect) -> Context

Creates a new gsk::CairoNode and appends it to the current render node of @self, without changing the current node.

bounds

the bounds for the new node

Returns

a cairo::Context suitable for drawing the contents of the newly created render node

source

fn append_color(&self, color: &RGBA, bounds: &Rect)

Creates a new render node drawing the @color into the given @bounds and appends it to the current render node of @self.

You should try to avoid calling this function if @color is transparent.

color

the color to draw

bounds

the bounds for the new node

source

fn append_conic_gradient( &self, bounds: &Rect, center: &Point, rotation: f32, stops: &[ColorStop] )

Appends a conic gradient node with the given stops to @self.

bounds

the rectangle to render the gradient into

center

the center point of the conic gradient

rotation

the clockwise rotation in degrees of the starting angle. 0 means the starting angle is the top.

stops

the color stops defining the gradient

source

fn append_inset_shadow( &self, outline: &RoundedRect, color: &RGBA, dx: f32, dy: f32, spread: f32, blur_radius: f32 )

Appends an inset shadow into the box given by @outline.

outline

outline of the region surrounded by shadow

color

color of the shadow

dx

horizontal offset of shadow

dy

vertical offset of shadow

spread

how far the shadow spreads towards the inside

blur_radius

how much blur to apply to the shadow

source

fn append_layout(&self, layout: &Layout, color: &RGBA)

source

fn append_linear_gradient( &self, bounds: &Rect, start_point: &Point, end_point: &Point, stops: &[ColorStop] )

Appends a linear gradient node with the given stops to @self.

bounds

the rectangle to render the linear gradient into

start_point

the point at which the linear gradient will begin

end_point

the point at which the linear gradient will finish

stops

the color stops defining the gradient

source

fn append_node(&self, node: impl AsRef<RenderNode>)

Appends @node to the current render node of @self, without changing the current node.

If @self does not have a current node yet, @node will become the initial node.

node

a gsk::RenderNode

source

fn append_outset_shadow( &self, outline: &RoundedRect, color: &RGBA, dx: f32, dy: f32, spread: f32, blur_radius: f32 )

source

fn append_radial_gradient( &self, bounds: &Rect, center: &Point, hradius: f32, vradius: f32, start: f32, end: f32, stops: &[ColorStop] )

source

fn append_repeating_linear_gradient( &self, bounds: &Rect, start_point: &Point, end_point: &Point, stops: &[ColorStop] )

source

fn append_repeating_radial_gradient( &self, bounds: &Rect, center: &Point, hradius: f32, vradius: f32, start: f32, end: f32, stops: &[ColorStop] )

source

fn append_scaled_texture( &self, texture: &impl IsA<Texture>, filter: ScalingFilter, bounds: &Rect )

Available on crate feature v4_10 only.
source

fn append_texture(&self, texture: &impl IsA<Texture>, bounds: &Rect)

source

fn gl_shader_pop_texture(&self)

source

fn perspective(&self, depth: f32)

source

fn pop(&self)

source

fn push_blend(&self, blend_mode: BlendMode)

source

fn push_blur(&self, radius: f64)

source

fn push_clip(&self, bounds: &Rect)

source

fn push_color_matrix(&self, color_matrix: &Matrix, color_offset: &Vec4)

source

fn push_cross_fade(&self, progress: f64)

source

fn push_gl_shader(&self, shader: &GLShader, bounds: &Rect, take_args: Bytes)

source

fn push_mask(&self, mask_mode: MaskMode)

Available on crate feature v4_10 only.
source

fn push_opacity(&self, opacity: f64)

source

fn push_repeat(&self, bounds: &Rect, child_bounds: Option<&Rect>)

source

fn push_rounded_clip(&self, bounds: &RoundedRect)

source

fn push_shadow(&self, shadow: &[Shadow])

source

fn render_background( &self, context: &impl IsA<StyleContext>, x: f64, y: f64, width: f64, height: f64 )

source

fn render_focus( &self, context: &impl IsA<StyleContext>, x: f64, y: f64, width: f64, height: f64 )

source

fn render_frame( &self, context: &impl IsA<StyleContext>, x: f64, y: f64, width: f64, height: f64 )

source

fn render_insertion_cursor( &self, context: &impl IsA<StyleContext>, x: f64, y: f64, layout: &Layout, index: i32, direction: Direction )

source

fn render_layout( &self, context: &impl IsA<StyleContext>, x: f64, y: f64, layout: &Layout )

source

fn restore(&self)

source

fn rotate(&self, angle: f32)

source

fn rotate_3d(&self, angle: f32, axis: &Vec3)

source

fn save(&self)

source

fn scale(&self, factor_x: f32, factor_y: f32)

source

fn scale_3d(&self, factor_x: f32, factor_y: f32, factor_z: f32)

source

fn to_node(self) -> Option<RenderNode>

source

fn to_paintable(self, size: Option<&Size>) -> Option<Paintable>

source

fn transform(&self, transform: Option<&Transform>)

source

fn transform_matrix(&self, matrix: &Matrix)

source

fn translate(&self, point: &Point)

source

fn translate_3d(&self, point: &Point3D)

Implementors§