public static void roundInside ( RectangleLength2D_F64 bound ) { double x0 = Math . ceil ( bound . x0 ) ; double y0 = Math . ceil ( bound . y0 ) ; double x1 = Math . floor ( bound . x0 + bound . width ) ; double y1 = Math . floor ( bound . y0 + bound . height ) ; bound . x0 = x0 ; bound . y0 = y0 ; bound . width = x1 - x0 ; bound . height = y1 - y0 ; }
Adjust bound to ensure the entire image is contained inside otherwise there might be single pixel wide black regions