src/modules/numerical/genImageData.js
// fullfills one step of the resizing of the array
fullfills one step of the resizing of the array
fullfills one step of the resizing of the array
function oneStepProcGen(grid, settings, scaling, boundaries) {
    const map = getOptmizationMap(grid, boundaries);
    const lMap = map.length;
    const scaledGrid = scaleGrid(scaling, grid.length);
    const {
        w,
        h,
        ...rest
    } = settings;
    const scaledSettings = {
        w: settings.w * scaling,
        h: settings.h * scaling,
        ...rest
    }
    for (let j = 0; j < lMap; j++) {
        const scaledJ = scaling * j;
        for (let i = 0; i < lMap; i++) {
            const scaledI = scaling * i;
            if (map[j][i]) {
                for (let y = 0; y < scaling; y++) {
                    for (let x = 0; x < scaling; x++) {
                        scaledGrid[y + scaledJ][x + scaledI] = getPixelInfo(y + scaledJ, x + scaledI, scaledSettings);
                    }
                }
            } else {
                for (let y = 0; y < scaling; y++) {
                    for (let x = 0; x < scaling; x++) {
                        scaledGrid[y + scaledJ][x + scaledI] = grid[j][i];
                    }
                }
            }
        }
    }
    return {
        settings: scaledSettings,
        grid: scaledGrid,
    }
}
function oneStepProcGen ( grid , settings , scaling , boundaries ) { const map = getOptmizationMap ( grid , boundaries ) ; const lMap = map . length ; const scaledGrid = scaleGrid ( scaling , grid . length ) ; const { w , h , ... rest } = settings ; const scaledSettings = { w : settings . w * scaling , h : settings . h * scaling , ... rest } for ( let j = 0 ; j < lMap ; j ++ ) { const scaledJ = scaling * j ; for ( let i = 0 ; i < lMap ; i ++ ) { const scaledI = scaling * i ; if ( map [ j ] [ i ] ) { for ( let y = 0 ; y < scaling ; y ++ ) { for ( let x = 0 ; x < scaling ; x ++ ) { scaledGrid [ y + scaledJ ] [ x + scaledI ] = getPixelInfo ( y + scaledJ , x + scaledI , scaledSettings ) ; } } } else { for ( let y = 0 ; y < scaling ; y ++ ) { for ( let x = 0 ; x < scaling ; x ++ ) { scaledGrid [ y + scaledJ ] [ x + scaledI ] = grid [ j ] [ i ] ; } } } } } return { settings : scaledSettings , grid : scaledGrid , } }
fullfills one step of the resizing of the array
fullfills one step of the resizing of the array