MCPcopy Create free account
hub / github.com/PerroEngine/Perro / resize_with

Method resize_with

perro_source/core/perro_structs/src/structs/matrix/mod.rs:853–869  ·  view source on GitHub ↗
(
        self,
        mut fill: impl FnMut(usize, usize) -> T,
    )

Source from the content-addressed store, hash-verified

851
852 #[inline]
853 pub fn resize_with<const NEW_ROWS: usize, const NEW_COLS: usize>(
854 self,
855 mut fill: impl FnMut(usize, usize) -> T,
856 ) -> Matrix<NEW_ROWS, NEW_COLS, T>
857 where
858 T: Copy,
859 {
860 Matrix(std::array::from_fn(|row| {
861 std::array::from_fn(|col| {
862 if row < ROWS && col < COLS {
863 self.0[row][col]
864 } else {
865 fill(row, col)
866 }
867 })
868 }))
869 }
870
871 #[inline]
872 pub fn as_slice(&self) -> &[T] {

Callers 11

resize_animationsMethod · 0.80
ensure_surface_mutMethod · 0.80
ensure_surface_mutMethod · 0.80
from_pairsMethod · 0.80
resizeMethod · 0.80
resize_defaultMethod · 0.80
gamepad_mutMethod · 0.80
joycon_mutMethod · 0.80
player_mutMethod · 0.80
prepareMethod · 0.80

Calls 1

MatrixClass · 0.85

Tested by

no test coverage detected