pub struct Normal {
pub factor: Vector2<f64>,
pub normal: Vector2<i16>,
}
Expand description
2D normal and factor stored separately.
The normal needs to be multiplied by surface_scale * factor / 255
and
normalized with 1 as the z component.
pub for the purpose of accessing this from benchmarks.
Fields§
§factor: Vector2<f64>
§normal: Vector2<i16>
Implementations§
source§impl Normal
impl Normal
fn new(factor_x: f64, nx: i16, factor_y: f64, ny: i16) -> Normal
sourcepub fn top_left(surface: &SharedImageSurface, bounds: IRect) -> Normal
pub fn top_left(surface: &SharedImageSurface, bounds: IRect) -> Normal
Computes and returns the normal vector for the top left pixel for light filters.
sourcepub fn top_row(surface: &SharedImageSurface, bounds: IRect, x: u32) -> Normal
pub fn top_row(surface: &SharedImageSurface, bounds: IRect, x: u32) -> Normal
Computes and returns the normal vector for the top row pixels for light filters.
sourcepub fn top_right(surface: &SharedImageSurface, bounds: IRect) -> Normal
pub fn top_right(surface: &SharedImageSurface, bounds: IRect) -> Normal
Computes and returns the normal vector for the top right pixel for light filters.
sourcepub fn left_column(
surface: &SharedImageSurface,
bounds: IRect,
y: u32,
) -> Normal
pub fn left_column( surface: &SharedImageSurface, bounds: IRect, y: u32, ) -> Normal
Computes and returns the normal vector for the left column pixels for light filters.
sourcepub fn interior(
surface: &SharedImageSurface,
bounds: IRect,
x: u32,
y: u32,
) -> Normal
pub fn interior( surface: &SharedImageSurface, bounds: IRect, x: u32, y: u32, ) -> Normal
Computes and returns the normal vector for the interior pixels for light filters.
sourcepub fn right_column(
surface: &SharedImageSurface,
bounds: IRect,
y: u32,
) -> Normal
pub fn right_column( surface: &SharedImageSurface, bounds: IRect, y: u32, ) -> Normal
Computes and returns the normal vector for the right column pixels for light filters.
sourcepub fn bottom_left(surface: &SharedImageSurface, bounds: IRect) -> Normal
pub fn bottom_left(surface: &SharedImageSurface, bounds: IRect) -> Normal
Computes and returns the normal vector for the bottom left pixel for light filters.
sourcepub fn bottom_row(surface: &SharedImageSurface, bounds: IRect, x: u32) -> Normal
pub fn bottom_row(surface: &SharedImageSurface, bounds: IRect, x: u32) -> Normal
Computes and returns the normal vector for the bottom row pixels for light filters.
sourcepub fn bottom_right(surface: &SharedImageSurface, bounds: IRect) -> Normal
pub fn bottom_right(surface: &SharedImageSurface, bounds: IRect) -> Normal
Computes and returns the normal vector for the bottom right pixel for light filters.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Normal
impl RefUnwindSafe for Normal
impl Send for Normal
impl Sync for Normal
impl Unpin for Normal
impl UnwindSafe for Normal
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.