Step 3 of doc cleanup.

This commit is contained in:
Dimitri Sabadie
2019-04-23 14:12:08 +02:00
parent 6ae3918eb1
commit e88da58a87
2 changed files with 33 additions and 10 deletions

View File

@@ -1,3 +1,11 @@
//! Spline control points.
//!
//! A control point associates to a “sampling value” (a.k.a. time) a carriede value that can be
//! interpolated along the curve made by the control points.
//!
//! Splines constructed with this crate have the property that its possible to change the
//! interpolation mode on a key-based way, allowing you to implement and encode complex curves.
#[cfg(feature = "serialization")] use serde_derive::{Deserialize, Serialize};
use crate::interpolation::Interpolation;
@@ -5,15 +13,17 @@ use crate::interpolation::Interpolation;
/// A spline control point.
///
/// This type associates a value at a given interpolation parameter value. It also contains an
/// interpolation hint used to determine how to interpolate values on the segment defined by this
/// key and the next one if existing.
/// interpolation mode used to determine how to interpolate values on the segment defined by this
/// key and the next one if existing. Have a look at [`Interpolation`] for further details.
///
/// [`Interpolation`]: crate::interpolation::Interpolation
#[derive(Copy, Clone, Debug)]
#[cfg_attr(feature = "serialization", derive(Deserialize, Serialize))]
#[cfg_attr(feature = "serialization", serde(rename_all = "snake_case"))]
pub struct Key<T, V> {
/// Interpolation parameter at which the [`Key`] should be reached.
pub t: T,
/// Held value.
/// Carried value.
pub value: V,
/// Interpolation mode.
pub interpolation: Interpolation<T>
@@ -25,4 +35,3 @@ impl<T, V> Key<T, V> {
Key { t, value, interpolation }
}
}