/** * Reduces the sharpness of corners by only considering a cell on if the previous version has 5 of the 9 cells in * the containing 3x3 area as "on." Typically, this method is run repeatedly. It does not return itself for * chaining, because it returns a direct reference to the {@link #current} GreasedRegion that this will use for * any future calls to this, and changes to current will be used here. * @return a direct reference to the changed GreasedRegion this considers its main state, {@link #current} */ public GreasedRegion runBasicSmoothing() { neighbors[0].remake(current).neighborUp(); neighbors[1].remake(current).neighborDown(); neighbors[2].remake(current).neighborLeft(); neighbors[3].remake(current).neighborRight(); neighbors[4].remake(current).neighborUpLeft(); neighbors[5].remake(current).neighborUpRight(); neighbors[6].remake(current).neighborDownLeft(); neighbors[7].remake(current).neighborDownRight(); neighbors[8].remake(current); ArrayTools.fill(sums, 0); GreasedRegion.sumInto(sums, neighbors); return current.refill(sums, 5, 10); }
neighbors[3].remake(current).neighborRight(); neighbors[4].remake(current).neighborUpLeft(); neighbors[5].remake(current).neighborUpRight(); neighbors[6].remake(current).neighborDownLeft(); neighbors[7].remake(current).neighborDownRight();