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]

Creates a new DeformGrid.

Sets current control position.

Sets original control position.

Removes all control points.

Sets vertices and texture coords back to default.

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

Draws deformed image using default method.

Draws deformed image using triangulation.

Adds a control point, in original coordinates.

Draw vertical grid lines.

Draw horizontal grid lines.

Updates the grid, by deforming the vertices.

Trait Implementations

impl Clone for DeformGrid
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more