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
Required Methods§
sourcefn append_cairo(&self, bounds: &Rect) -> Context
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
sourcefn append_color(&self, color: &RGBA, bounds: &Rect)
fn append_color(&self, color: &RGBA, bounds: &Rect)
sourcefn append_conic_gradient(
&self,
bounds: &Rect,
center: &Point,
rotation: f32,
stops: &[ColorStop]
)
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
sourcefn append_inset_shadow(
&self,
outline: &RoundedRect,
color: &RGBA,
dx: f32,
dy: f32,
spread: f32,
blur_radius: f32
)
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)
sourcefn append_linear_gradient(
&self,
bounds: &Rect,
start_point: &Point,
end_point: &Point,
stops: &[ColorStop]
)
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
sourcefn append_node(&self, node: impl AsRef<RenderNode>)
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
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] )
sourcefn append_scaled_texture(
&self,
texture: &impl IsA<Texture>,
filter: ScalingFilter,
bounds: &Rect
)
fn append_scaled_texture( &self, texture: &impl IsA<Texture>, filter: ScalingFilter, bounds: &Rect )
v4_10
only.