Struct boostvoronoi::SimpleAffine
source · pub struct SimpleAffine<F>where
F: OutputType,{
pub scale: [F; 2],
pub to_offset: [F; 2],
/* private fields */
}
Expand description
This is a simple affine transformation object. Inadvertently it also serves as a type converter F<->I<->i32 It can pan and zoom but not rotate.
Fields§
§scale: [F; 2]
A zoom scale
to_offset: [F; 2]
The offsets needed to center coordinates of interest on the ‘dest’ coordinate system. i.e. the screen coordinate system.
Implementations§
source§impl<F> SimpleAffine<F>where
F: OutputType,
impl<F> SimpleAffine<F>where
F: OutputType,
pub fn new<I>(
source_aabb: &Aabb2<F>,
dest_aabb: &Aabb2<F>
) -> Result<SimpleAffine<F>, BvError>where
I: InputType,
sourcepub fn reverse_transform<I>(&self, x: F, y: F) -> Result<[I; 2], BvError>where
I: InputType,
pub fn reverse_transform<I>(&self, x: F, y: F) -> Result<[I; 2], BvError>where
I: InputType,
transform from destination coordinate system to source coordinate system
sourcepub fn reverse_transform_x<I>(&self, x: F) -> Result<I, BvError>where
I: InputType,
pub fn reverse_transform_x<I>(&self, x: F) -> Result<I, BvError>where
I: InputType,
transform from destination coordinate system to source coordinate system
sourcepub fn reverse_transform_y<I>(&self, y: F) -> Result<I, BvError>where
I: InputType,
pub fn reverse_transform_y<I>(&self, y: F) -> Result<I, BvError>where
I: InputType,
transform from dest coordinate system to source coordinate system
sourcepub fn transform(&self, x: F, y: F) -> [F; 2]
pub fn transform(&self, x: F, y: F) -> [F; 2]
transform from source coordinate system to dest coordinate system
sourcepub fn transform_x(&self, x: F) -> F
pub fn transform_x(&self, x: F) -> F
transform from source coordinate system to dest coordinate system float x coordinate
sourcepub fn transform_y(&self, y: F) -> F
pub fn transform_y(&self, y: F) -> F
transform from source coordinate system to dest coordinate system float y coordinate
sourcepub fn transform_i<I>(&self, point: [I; 2]) -> [F; 2]where
I: InputType,
pub fn transform_i<I>(&self, point: [I; 2]) -> [F; 2]where
I: InputType,
transform from source coordinate system to dest coordinate system
sourcepub fn transform_f(&self, point: [F; 2]) -> [F; 2]
pub fn transform_f(&self, point: [F; 2]) -> [F; 2]
transform from source coordinate system to dest coordinate system
sourcepub fn transform_p<I>(&self, point: &Point<I>) -> [F; 2]where
I: InputType,
pub fn transform_p<I>(&self, point: &Point<I>) -> [F; 2]where
I: InputType,
transform from source coordinate system to dest coordinate system
sourcepub fn transform_ix<I>(&self, x: I) -> Fwhere
I: InputType,
pub fn transform_ix<I>(&self, x: I) -> Fwhere
I: InputType,
transform from source coordinate system to dest coordinate system integer x coordinate
sourcepub fn transform_iy<I>(&self, y: I) -> Fwhere
I: InputType,
pub fn transform_iy<I>(&self, y: I) -> Fwhere
I: InputType,
transform from source coordinate system to dest coordinate system integer y coordinate
sourcepub fn transform_fx(&self, x: F) -> F
pub fn transform_fx(&self, x: F) -> F
transform from source coordinate system to destination coordinate system float x coordinate
sourcepub fn transform_fy(&self, y: F) -> F
pub fn transform_fy(&self, y: F) -> F
transform from source coordinate system to destination coordinate system float y coordinate
Trait Implementations§
source§impl<F> Clone for SimpleAffine<F>where
F: Clone + OutputType,
impl<F> Clone for SimpleAffine<F>where
F: Clone + OutputType,
source§fn clone(&self) -> SimpleAffine<F>
fn clone(&self) -> SimpleAffine<F>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<F> Debug for SimpleAffine<F>where
F: Debug + OutputType,
impl<F> Debug for SimpleAffine<F>where
F: Debug + OutputType,
source§impl<F> Default for SimpleAffine<F>where
F: OutputType,
impl<F> Default for SimpleAffine<F>where
F: OutputType,
source§fn default() -> SimpleAffine<F>
fn default() -> SimpleAffine<F>
source§impl<F> PartialEq for SimpleAffine<F>where
F: PartialEq + OutputType,
impl<F> PartialEq for SimpleAffine<F>where
F: PartialEq + OutputType,
source§fn eq(&self, other: &SimpleAffine<F>) -> bool
fn eq(&self, other: &SimpleAffine<F>) -> bool
self
and other
values to be equal, and is used
by ==
.