pub struct Rect {
pub x: f64,
pub y: f64,
pub w: f64,
pub h: f64,
}Expand description
An axis-aligned rectangle in continuous pixel coordinates (ffcine_core::geom).
Fields§
§x: f64§y: f64§w: f64§h: f64Implementations§
Source§impl Rect
impl Rect
pub fn aspect(&self) -> f64
Sourcepub fn fit_aspect(&self, ar: f64, pos: [f64; 2]) -> Self
pub fn fit_aspect(&self, ar: f64, pos: [f64; 2]) -> Self
The largest window of aspect ar (width / height) inside this one, placed by pos: 0 at
the left/top edge, 0.5 centred, 1 at the right/bottom edge (fractions of the slack, as the
prototype’s crop_x / crop_y).
Sourcepub fn zoom(&self, zoom: f64, pos: [f64; 2]) -> Self
pub fn zoom(&self, zoom: f64, pos: [f64; 2]) -> Self
A window 1 / zoom of this one’s size, placed by pos in the slack: the prototype’s
crop=iw/z:ih/z:(iw-iw/z)*cx:(ih-ih/z)*cy. Zooms below 1 count as 1, so the window never
leaves the picture.
Sourcepub fn to_mat3(&self, out_w: f64, out_h: f64) -> Mat3
pub fn to_mat3(&self, out_w: f64, out_h: f64) -> Mat3
The map from a pixel of a out_w x out_h image showing this window to the source pixel
it samples (a Mat3 in the stabilizer’s convention: output -> source).
pub fn to_crop(&self) -> Crop
Trait Implementations§
impl Copy for Rect
impl StructuralPartialEq for Rect
Auto Trait Implementations§
impl Freeze for Rect
impl RefUnwindSafe for Rect
impl Send for Rect
impl Sync for Rect
impl Unpin for Rect
impl UnsafeUnpin for Rect
impl UnwindSafe for Rect
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more