Struct nannou::draw::Drawing

source ·
pub struct Drawing<'a, T> { /* private fields */ }
Expand description

A Drawing in progress.

Drawing provides a way of chaining together method calls describing properties of the thing that we are drawing. Drawing ends when the instance is Dropped, at which point the properties of the drawing are inserted into the Draw type.

When a Drawing begins, a node is immediately created for the drawing within the Draw’s inner geom::Graph. This ensures the correct instantiation order is maintained within the graph. As a result, each Drawing is associated with a single, unique node. Thus a Drawing can be thought of as a way of specifying properties for a node.

Implementations§

source§

impl<'a, T> Drawing<'a, T>

source

pub fn finish(self)

Complete the drawing and insert it into the parent Draw instance.

This will be called when the Drawing is Dropped if it has not yet been called.

source

pub fn map_ty<F, T2>(self, map: F) -> Drawing<'a, T2>
where F: FnOnce(T) -> T2, T2: Into<Primitive>, Primitive: Into<Option<T>>,

Apply the given function to the type stored within Draw.

The function is only applied if the node has not yet been Drawn.

Panics if the primitive does not contain type T.

source§

impl<'a, T> Drawing<'a, T>

source

pub fn color<C>(self, color: C) -> Self

Specify a color.

This method supports any color type that can be converted into RGBA.

Colors that have no alpha channel will be given an opaque alpha channel value 1.0.

source

pub fn rgb(self, r: ColorScalar, g: ColorScalar, b: ColorScalar) -> Self

Specify the color via red, green and blue channels.

source

pub fn rgb8(self, r: u8, g: u8, b: u8) -> Self

Specify the color via red, green and blue channels as bytes

source

pub fn rgba( self, r: ColorScalar, g: ColorScalar, b: ColorScalar, a: ColorScalar ) -> Self

Specify the color via red, green, blue and alpha channels.

source

pub fn rgba8(self, r: u8, g: u8, b: u8, a: u8) -> Self

Specify the color via red, green, blue and alpha channels as bytes.

source

pub fn hsl(self, h: ColorScalar, s: ColorScalar, l: ColorScalar) -> Self

Specify the color via hue, saturation and luminance.

If you’re looking for HSVA or HSBA, use the hsva method instead.

The given hue expects a value between 0.0 and 1.0 where 0.0 is 0 degress and 1.0 is 360 degrees (or 2 PI radians).

See the wikipedia entry for more details on this color space.

source

pub fn hsla( self, h: ColorScalar, s: ColorScalar, l: ColorScalar, a: ColorScalar ) -> Self

Specify the color via hue, saturation, luminance and an alpha channel.

If you’re looking for HSVA or HSBA, use the hsva method instead.

The given hue expects a value between 0.0 and 1.0 where 0.0 is 0 degress and 1.0 is 360 degrees (or 2 PI radians).

See the wikipedia entry for more details on this color space.

source

pub fn hsv(self, h: ColorScalar, s: ColorScalar, v: ColorScalar) -> Self

Specify the color via hue, saturation and value (brightness).

This is sometimes also known as “hsb”.

The given hue expects a value between 0.0 and 1.0 where 0.0 is 0 degress and 1.0 is 360 degrees (or 2 PI radians).

See the wikipedia entry for more details on this color space.

source

pub fn hsva( self, h: ColorScalar, s: ColorScalar, v: ColorScalar, a: ColorScalar ) -> Self

Specify the color via hue, saturation, value (brightness) and an alpha channel.

This is sometimes also known as “hsba”.

The given hue expects a value between 0.0 and 1.0 where 0.0 is 0 degress and 1.0 is 360 degrees (or 2 PI radians).

See the wikipedia entry for more details on this color space.

source

pub fn gray(self, g: ColorScalar) -> Self

Specify the color as gray scale

The given g expects a value between 0.0 and 1.0 where 0.0 is black and 1.0 is white

source§

impl<'a, T> Drawing<'a, T>

source

pub fn width(self, w: f32) -> Self

Set the absolute width for the node.

source

pub fn height(self, h: f32) -> Self

Set the absolute height for the node.

source

pub fn depth(self, d: f32) -> Self

Set the absolute depth for the node.

source

pub fn w(self, w: f32) -> Self

Short-hand for the width method.

source

pub fn h(self, h: f32) -> Self

Short-hand for the height method.

source

pub fn d(self, d: f32) -> Self

Short-hand for the depth method.

source

pub fn wh(self, v: Vec2) -> Self

Set the x and y dimensions for the node.

source

pub fn whd(self, v: Vec3) -> Self

Set the x, y and z dimensions for the node.

source

pub fn w_h(self, x: f32, y: f32) -> Self

Set the width and height for the node.

source

pub fn w_h_d(self, x: f32, y: f32, z: f32) -> Self

Set the width and height for the node.

source§

impl<'a, T> Drawing<'a, T>

source

pub fn x(self, x: f32) -> Self

Build with the given Absolute Position along the x axis.

source

pub fn y(self, y: f32) -> Self

Build with the given Absolute Position along the y axis.

source

pub fn z(self, z: f32) -> Self

Build with the given Absolute Position along the z axis.

source

pub fn xy(self, p: Point2) -> Self

Set the Position with some two-dimensional point.

source

pub fn xyz(self, p: Point3) -> Self

Set the Position with some three-dimensional point.

source

pub fn x_y(self, x: f32, y: f32) -> Self

Set the Position with x y coordinates.

source

pub fn x_y_z(self, x: f32, y: f32, z: f32) -> Self

Set the Position with x y z coordinates.

source§

impl<'a, T> Drawing<'a, T>

source

pub fn look_at(self, target: Point3) -> Self

Describe orientation via the vector that points to the given target.

source

pub fn x_radians(self, x: f32) -> Self

Specify the orientation around the x axis as an absolute value in radians.

source

pub fn y_radians(self, y: f32) -> Self

Specify the orientation around the y axis as an absolute value in radians.

source

pub fn z_radians(self, z: f32) -> Self

Specify the orientation around the z axis as an absolute value in radians.

source

pub fn x_degrees(self, x: f32) -> Self

Specify the orientation around the x axis as an absolute value in degrees.

source

pub fn y_degrees(self, y: f32) -> Self

Specify the orientation around the y axis as an absolute value in degrees.

source

pub fn z_degrees(self, z: f32) -> Self

Specify the orientation around the z axis as an absolute value in degrees.

source

pub fn x_turns(self, x: f32) -> Self

Specify the orientation around the x axis as a number of turns around the axis.

source

pub fn y_turns(self, y: f32) -> Self

Specify the orientation around the y axis as a number of turns around the axis.

source

pub fn z_turns(self, z: f32) -> Self

Specify the orientation around the z axis as a number of turns around the axis.

source

pub fn radians(self, v: Vec3) -> Self

Specify the orientation along each axis with the given Vector of radians.

This has the same affect as calling self.x_radians(v.x).y_radians(v.y).z_radians(v.z).

source

pub fn degrees(self, v: Vec3) -> Self

Specify the orientation along each axis with the given Vector of degrees.

This has the same affect as calling self.x_degrees(v.x).y_degrees(v.y).z_degrees(v.z).

source

pub fn turns(self, v: Vec3) -> Self

Specify the orientation along each axis with the given Vector of “turns”.

This has the same affect as calling self.x_turns(v.x).y_turns(v.y).z_turns(v.z).

source

pub fn euler(self, e: Vec3) -> Self

Specify the orientation with the given Euler.

The euler must be specified in radians.

source

pub fn quaternion(self, q: Quat) -> Self

Specify the orientation with the given Quaternion.

source

pub fn pitch(self, pitch: f32) -> Self

Specify the “pitch” of the orientation in radians.

This has the same effect as calling x_radians.

source

pub fn yaw(self, yaw: f32) -> Self

Specify the “yaw” of the orientation in radians.

This has the same effect as calling y_radians.

source

pub fn roll(self, roll: f32) -> Self

Specify the “roll” of the orientation in radians.

This has the same effect as calling z_radians.

source

pub fn rotate(self, radians: f32) -> Self

Assuming we’re looking at a 2D plane, positive values cause a clockwise rotation where the given value is specified in radians.

This is equivalent to calling the z_radians or roll methods.

source§

impl<'a, T> Drawing<'a, T>

source

pub fn fill_opts(self, opts: FillOptions) -> Self

Specify the whole set of fill tessellation options.

source

pub fn fill_tolerance(self, tolerance: f32) -> Self

Maximum allowed distance to the path when building an approximation.

source

pub fn fill_rule(self, rule: FillRule) -> Self

Specify the rule used to determine what is inside and what is outside of the shape.

Currently, only the EvenOdd rule is implemented.

source

pub fn fill_sweep_orientation(self, orientation: Orientation) -> Self

Whether to perform a vertical or horizontal traversal of the geometry.

Default value: Vertical.

source

pub fn handle_intersections(self, b: bool) -> Self

A fast path to avoid some expensive operations if the path is known to not have any self-intersections.

Do not set this to false if the path may have intersecting edges else the tessellator may panic or produce incorrect results. In doubt, do not change the default value.

Default value: true.

source§

impl<'a, T> Drawing<'a, T>

source

pub fn start_cap(self, cap: LineCap) -> Self

The start line cap as specified by the SVG spec.

source

pub fn end_cap(self, cap: LineCap) -> Self

The end line cap as specified by the SVG spec.

source

pub fn caps(self, cap: LineCap) -> Self

The start and end line cap as specified by the SVG spec.

source

pub fn start_cap_butt(self) -> Self

The stroke for each sub-path does not extend beyond its two endpoints. A zero length sub-path will therefore not have any stroke.

source

pub fn start_cap_square(self) -> Self

At the end of each sub-path, the shape representing the stroke will be extended by a rectangle with the same width as the stroke width and whose length is half of the stroke width. If a sub-path has zero length, then the resulting effect is that the stroke for that sub-path consists solely of a square with side length equal to the stroke width, centered at the sub-path’s point.

source

pub fn start_cap_round(self) -> Self

At each end of each sub-path, the shape representing the stroke will be extended by a half circle with a radius equal to the stroke width. If a sub-path has zero length, then the resulting effect is that the stroke for that sub-path consists solely of a full circle centered at the sub-path’s point.

source

pub fn end_cap_butt(self) -> Self

The stroke for each sub-path does not extend beyond its two endpoints. A zero length sub-path will therefore not have any stroke.

source

pub fn end_cap_square(self) -> Self

At the end of each sub-path, the shape representing the stroke will be extended by a rectangle with the same width as the stroke width and whose length is half of the stroke width. If a sub-path has zero length, then the resulting effect is that the stroke for that sub-path consists solely of a square with side length equal to the stroke width, centered at the sub-path’s point.

source

pub fn end_cap_round(self) -> Self

At each end of each sub-path, the shape representing the stroke will be extended by a half circle with a radius equal to the stroke width. If a sub-path has zero length, then the resulting effect is that the stroke for that sub-path consists solely of a full circle centered at the sub-path’s point.

source

pub fn caps_butt(self) -> Self

The stroke for each sub-path does not extend beyond its two endpoints. A zero length sub-path will therefore not have any stroke.

source

pub fn caps_square(self) -> Self

At the end of each sub-path, the shape representing the stroke will be extended by a rectangle with the same width as the stroke width and whose length is half of the stroke width. If a sub-path has zero length, then the resulting effect is that the stroke for that sub-path consists solely of a square with side length equal to the stroke width, centered at the sub-path’s point.

source

pub fn caps_round(self) -> Self

At each end of each sub-path, the shape representing the stroke will be extended by a half circle with a radius equal to the stroke width. If a sub-path has zero length, then the resulting effect is that the stroke for that sub-path consists solely of a full circle centered at the sub-path’s point.

source

pub fn join(self, join: LineJoin) -> Self

The way in which lines are joined at the vertices, matching the SVG spec.

Default value is MiterClip.

source

pub fn join_miter(self) -> Self

A sharp corner is to be used to join path segments.

source

pub fn join_miter_clip(self) -> Self

Same as a join_miter, but if the miter limit is exceeded, the miter is clipped at a miter length equal to the miter limit value multiplied by the stroke width.

source

pub fn join_round(self) -> Self

A round corner is to be used to join path segments.

source

pub fn join_bevel(self) -> Self

A bevelled corner is to be used to join path segments. The bevel shape is a triangle that fills the area between the two stroked segments.

source

pub fn stroke_weight(self, stroke_weight: f32) -> Self

The total stroke_weight (aka width) of the line.

source

pub fn miter_limit(self, limit: f32) -> Self

Describes the limit before miter lines will clip, as described in the SVG spec.

Must be greater than or equal to 1.0.

source

pub fn stroke_tolerance(self, tolerance: f32) -> Self

Maximum allowed distance to the path when building an approximation.

source

pub fn stroke_opts(self, opts: StrokeOptions) -> Self

Specify the full set of stroke options for the path tessellation.

source§

impl<'a> Drawing<'a, Arrow>

source

pub fn weight(self, weight: f32) -> Self

Short-hand for the stroke_weight method.

source

pub fn tolerance(self, tolerance: f32) -> Self

Short-hand for the stroke_tolerance method.

source

pub fn start(self, start: Point2) -> Self

Specify the start point of the arrow.

source

pub fn end(self, end: Point2) -> Self

Specify the end point of the arrow.

source

pub fn points(self, start: Point2, end: Point2) -> Self

Specify the start and end points of the arrow.

source

pub fn head_length(self, length: f32) -> Self

The length of the arrow head.

By default, this is equal to weight * 4.0.

This value will be clamped to the length of the line itself.

source

pub fn head_width(self, width: f32) -> Self

The width of the arrow head.

By default, this is equal to weight * 2.0.

source§

impl<'a> Drawing<'a, Ellipse>

source

pub fn stroke<C>(self, color: C) -> Self

Stroke the outline with the given color.

source

pub fn radius(self, radius: f32) -> Self

Specify the width and height of the Ellipse via a given radius.

source

pub fn resolution(self, resolution: f32) -> Self

The number of sides used to draw the ellipse.

source§

impl<'a> Drawing<'a, Line>

source

pub fn weight(self, weight: f32) -> Self

Short-hand for the stroke_weight method.

source

pub fn tolerance(self, tolerance: f32) -> Self

Short-hand for the stroke_tolerance method.

source

pub fn start(self, start: Point2) -> Self

Specify the start point of the line.

source

pub fn end(self, end: Point2) -> Self

Specify the end point of the line.

source

pub fn points(self, start: Point2, end: Point2) -> Self

Specify the start and end points of the line.

source§

impl<'a> Drawing<'a, Vertexless>

source

pub fn points<I>(self, points: I) -> DrawingMesh<'a>
where I: IntoIterator, I::Item: Into<Point>,

Describe the mesh with a sequence of points.

The given iterator may yield any type that can be converted directly into Point3s.

This method assumes that the entire mesh should be coloured with a single colour. If a colour is not specified via one of the builder methods, a default colour will be retrieved from the inner Theme.

source

pub fn points_colored<I, P, C>(self, points: I) -> DrawingMesh<'a>

Describe the mesh with a sequence of colored points.

Each of the points must be represented as a tuple containing the point and the color in that order, e.g. (point, color). point may be of any type that implements Into<Point3> and color may be of any type that implements IntoLinSrgba.

source

pub fn points_textured<I, P, T>( self, view: &dyn ToTextureView, points: I ) -> DrawingMesh<'a>
where I: IntoIterator<Item = (P, T)>, P: Into<Point>, T: Into<TexCoords>,

Describe the mesh with a sequence of textured points.

Each of the vertices must be represented as a tuple containing the point and tex coordinates in that order, e.g. (point, tex_coords). point may be of any type that implements Into<Point3> and tex_coords may be of any type that implements Into<Point2>.

source

pub fn tris<I, V>(self, tris: I) -> DrawingMesh<'a>
where I: IntoIterator<Item = Tri<V>>, V: Into<Point>,

Describe the mesh with a sequence of triangles.

Each triangle may be composed of any vertex type that may be converted directly into Point3s.

This method assumes that the entire mesh should be coloured with a single colour. If a colour is not specified via one of the builder methods, a default colour will be retrieved from the inner Theme.

source

pub fn tris_colored<I, P, C>(self, tris: I) -> DrawingMesh<'a>

Describe the mesh with a sequence of colored triangles.

Each of the vertices must be represented as a tuple containing the point and the color in that order, e.g. (point, color). point may be of any type that implements Into<Point3> and color may be of any type that implements IntoLinSrgba.

source

pub fn tris_textured<I, P, T>( self, view: &dyn ToTextureView, tris: I ) -> DrawingMesh<'a>
where I: IntoIterator<Item = Tri<(P, T)>>, P: Into<Point>, T: Into<TexCoords>,

Describe the mesh with a sequence of textured triangles.

Each of the vertices must be represented as a tuple containing the point and tex coordinates in that order, e.g. (point, tex_coords). point may be of any type that implements Into<Point3> and tex_coords may be of any type that implements Into<Point2>.

source

pub fn indexed<V, I>(self, points: V, indices: I) -> DrawingMesh<'a>
where V: IntoIterator, V::Item: Into<Point>, I: IntoIterator<Item = usize>,

Describe the mesh with the given indexed points.

Each trio of indices describes a single triangle made up of points.

Each point may be any type that may be converted directly into the Point3 type.

source

pub fn indexed_colored<V, I, P, C>( self, points: V, indices: I ) -> DrawingMesh<'a>
where V: IntoIterator<Item = (P, C)>, I: IntoIterator<Item = usize>, P: Into<Point>, C: IntoLinSrgba<ColorScalar>,

Describe the mesh with the given indexed, colored points.

Each trio of indices describes a single triangle made up of colored points.

Each of the points must be represented as a tuple containing the point and the color in that order, e.g. (point, color). point may be of any type that implements Into<Point3> and color may be of any type that implements IntoLinSrgba.

source

pub fn indexed_textured<V, I, P, T>( self, view: &dyn ToTextureView, points: V, indices: I ) -> DrawingMesh<'a>
where V: IntoIterator<Item = (P, T)>, I: IntoIterator<Item = usize>, P: Into<Point>, T: Into<TexCoords>,

Describe the mesh with the given indexed, textured points.

Each trio of indices describes a single triangle made up of colored points.

Each of the points must be represented as a tuple containing the point and the texture coordinates in that order, e.g. (point, tex_coords). point may be of any type that implements Into<Point3> and tex_coords may be of any type that implements Into<Point2>.

source§

impl<'a> Drawing<'a, PathInit>

source

pub fn fill(self) -> DrawingPathFill<'a>

Specify that we want to use fill tessellation for the path.

The returned building context allows for specifying the fill tessellation options.

source

pub fn stroke(self) -> DrawingPathStroke<'a>

Specify that we want to use stroke tessellation for the path.

The returned building context allows for specifying the stroke tessellation options.

source§

impl<'a> Drawing<'a, PathOptions<FillOptions>>

source

pub fn tolerance(self, tolerance: f32) -> Self

Maximum allowed distance to the path when building an approximation.

source

pub fn rule(self, rule: FillRule) -> Self

Specify the rule used to determine what is inside and what is outside of the shape.

Currently, only the EvenOdd rule is implemented.

source§

impl<'a> Drawing<'a, PathOptions<StrokeOptions>>

source

pub fn weight(self, weight: f32) -> Self

Short-hand for the stroke_weight method.

source

pub fn tolerance(self, tolerance: f32) -> Self

Short-hand for the stroke_tolerance method.

source§

impl<'a, T> Drawing<'a, PathOptions<T>>

source

pub fn events<I>(self, events: I) -> DrawingPath<'a>
where I: IntoIterator<Item = PathEvent>,

Submit the path events to be tessellated.

source

pub fn points<I>(self, points: I) -> DrawingPath<'a>
where I: IntoIterator, I::Item: Into<Point2>,

Submit the path events as a polyline of points.

source

pub fn points_closed<I>(self, points: I) -> DrawingPath<'a>
where I: IntoIterator, I::Item: Into<Point2>,

Submit the path events as a polyline of points.

An event will be generated that closes the start and end points.

source

pub fn points_colored<I, P, C>(self, points: I) -> DrawingPath<'a>

Submit path events as a polyline of colored points.

source

pub fn points_colored_closed<I, P, C>(self, points: I) -> DrawingPath<'a>

Submit path events as a polyline of colored points.

The path with automatically close from the end point to the start point.

source

pub fn points_textured<I, P, TC>( self, view: &dyn ToTextureView, points: I ) -> DrawingPath<'a>
where I: IntoIterator<Item = (P, TC)>, P: Into<Point2>, TC: Into<TexCoords>,

Submit path events as a polyline of textured points.

source

pub fn points_textured_closed<I, P, TC>( self, view: &dyn ToTextureView, points: I ) -> DrawingPath<'a>
where I: IntoIterator<Item = (P, TC)>, P: Into<Point2>, TC: Into<TexCoords>,

Submit path events as a polyline of textured points.

The path with automatically close from the end point to the start point.

source§

impl<'a, T> Drawing<'a, T>

source

pub fn no_fill(self) -> Self

Specify no fill color and in turn no fill tessellation for the polygon.

source

pub fn stroke_color<C>(self, color: C) -> Self

Specify a color to use for stroke tessellation.

Stroke tessellation will only be performed if this method or one of the SetStroke methods are called.

source

pub fn polygon_options(self, opts: PolygonOptions) -> Self

Specify the whole set of polygon options.

source§

impl<'a> Drawing<'a, PolygonInit>

source

pub fn stroke<C>(self, color: C) -> Self

Stroke the outline with the given color.

source

pub fn events<I>(self, events: I) -> DrawingPolygon<'a>
where I: IntoIterator<Item = PathEvent>,

Describe the polygon with a sequence of path events.

source

pub fn points<I>(self, points: I) -> DrawingPolygon<'a>
where I: IntoIterator, I::Item: Into<Point2>,

Describe the polygon with a sequence of points.

source

pub fn points_colored<I, P, C>(self, points: I) -> DrawingPolygon<'a>

Consumes an iterator of points and converts them to an iterator yielding path events.

source

pub fn points_textured<I, P, T>( self, view: &dyn ToTextureView, points: I ) -> DrawingPolygon<'a>
where I: IntoIterator<Item = (P, T)>, P: Into<Point2>, T: Into<TexCoords>,

Describe the polygon with an iterator yielding textured poings.

source§

impl<'a> Drawing<'a, Quad>

source

pub fn points<P>(self, a: P, b: P, c: P, d: P) -> Self
where P: Into<Point2>,

Use the given points as the vertices (corners) of the quad.

source§

impl<'a> Drawing<'a, Rect>

source

pub fn stroke<C>(self, color: C) -> Self

Stroke the outline with the given color.

source§

impl<'a> Drawing<'a, Text>

source

pub fn font_size(self, size: FontSize) -> Self

The font size to use for the text.

source

pub fn no_line_wrap(self) -> Self

Specify that the Text should not wrap lines around the width.

source

pub fn wrap_by_word(self) -> Self

Line wrap the Text at the beginning of the first word that exceeds the width.

source

pub fn wrap_by_character(self) -> Self

Line wrap the Text at the beginning of the first character that exceeds the width.

source

pub fn font(self, font: Font) -> Self

A method for specifying the Font used for displaying the Text.

source

pub fn with_style(self, style: Style) -> Self

Build the Text with the given Style.

source

pub fn justify(self, justify: Justify) -> Self

Describe the end along the x axis to which the text should be aligned.

source

pub fn left_justify(self) -> Self

Align the text to the left of its bounding Rect’s x axis range.

source

pub fn center_justify(self) -> Self

Align the text to the middle of its bounding Rect’s x axis range.

source

pub fn right_justify(self) -> Self

Align the text to the right of its bounding Rect’s x axis range.

source

pub fn line_spacing(self, spacing: Scalar) -> Self

Specify how much vertical space should separate each line of text.

source

pub fn y_align_text(self, align: Align) -> Self

Specify how the whole text should be aligned along the y axis of its bounding rectangle

source

pub fn align_text_top(self) -> Self

Align the top edge of the text with the top edge of its bounding rectangle.

source

pub fn align_text_middle_y(self) -> Self

Align the middle of the text with the middle of the bounding rect along the y axis.

This is the default behaviour.

source

pub fn align_text_bottom(self) -> Self

Align the bottom edge of the text with the bottom edge of its bounding rectangle.

source

pub fn layout(self, layout: &Layout) -> Self

Set all the parameters via an existing Layout

source

pub fn glyph_colors<I, C>(self, glyph_colors: I) -> Self
where I: IntoIterator<Item = C>, C: IntoLinSrgba<ColorScalar>,

Set a color for each glyph, which is typically one character. Colors unspecified glyphs using the drawing color. NOTE: Sometimes, a glyph can represent multiple characters, or be a part in other glyphs.

source§

impl<'a> Drawing<'a, Texture>

source

pub fn area(self, rect: Rect) -> Self

Specify the area of the texture to draw.

The bounds of the rectangle should represent the desired area as texture coordinates of the underlying texture.

Texture coordinates range from (0.0, 0.0) in the bottom left of the texture, to (1.0, 1.0) in the top right of the texture.

By default, the area represents the full extent of the texture.

source§

impl<'a> Drawing<'a, Tri>

source

pub fn stroke<C>(self, color: C) -> Self

Stroke the outline with the given color.

source

pub fn points<P>(self, a: P, b: P, c: P) -> Self
where P: Into<Point2>,

Use the given points as the vertices (corners) of the triangle.

Trait Implementations§

source§

impl<'a, T: Debug> Debug for Drawing<'a, T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, T> Drop for Drawing<'a, T>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'a, T> !RefUnwindSafe for Drawing<'a, T>

§

impl<'a, T> !Send for Drawing<'a, T>

§

impl<'a, T> !Sync for Drawing<'a, T>

§

impl<'a, T> Unpin for Drawing<'a, T>
where T: Unpin,

§

impl<'a, T> !UnwindSafe for Drawing<'a, T>

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: Component + Float, Swp: WhitePoint, Dwp: WhitePoint, D: AdaptFrom<S, Swp, Dwp, T>,

source§

fn adapt_into_using<M>(self, method: M) -> D
where M: TransformMatrix<Swp, Dwp, T>,

Convert the source color to the destination color using the specified method
source§

fn adapt_into(self) -> D

Convert the source color to the destination color using the bradford method by default
source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> ConvertInto<U> for T
where U: ConvertFrom<T>,

source§

fn convert_into(self) -> U

Convert into T with values clamped to the color defined bounds Read more
source§

fn convert_unclamped_into(self) -> U

Convert into T. The resulting color might be invalid in its color space Read more
source§

fn try_convert_into(self) -> Result<U, OutOfBounds<U>>

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V