Struct graphics::deform::DeformGrid [] [src]

pub struct DeformGrid {
    pub cols: usize,
    pub rows: usize,
    pub rect: [Scalar; 4],
    pub vertices: Vec<Vec2d>,
    pub indices: Vec<usize>,
    pub texture_coords: Vec<[f32; 2]>,
    pub ps: Vec<[Scalar; 2]>,
    pub qs: Vec<[Scalar; 2]>,
    pub wis: Vec<Scalar>,
}

Represents a deformed grid.

Fields

The number of columns in the grid.

The number of rows in the grid.

The grid undeformed, which is a plain rectangle.

The vertices, deformed.

The triangle indices.

The texture coordinates.

Initial position of control points.

The current position of control points.

A weight computation buffer, one for each control point.

Methods

impl DeformGrid
[src]

[src]

Creates a new DeformGrid.

[src]

Sets current control position.

[src]

Sets original control position.

[src]

Removes all control points.

[src]

Sets vertices and texture coords back to default.

[src]

Finds original coordinate. If the deformed grid is overlapping itself, multiple hits might occur. Returns the first hit it finds.

[src]

Draws deformed image using default method.

[src]

Draws deformed image using triangulation.

[src]

Adds a control point, in original coordinates.

[src]

Draw vertical grid lines.

[src]

Draw horizontal grid lines.

[src]

Updates the grid, by deforming the vertices.

Trait Implementations

impl Clone for DeformGrid
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more