calculateFinderRectWithPadding

fun calculateFinderRectWithPadding(width: Int, height: Int, changeOrientation: Boolean, origRect: Rect, padding: Int): Rect

Calculates Rect based on given origRect:

  • Adds additional padding pixels to each side

  • ensures it is within given image bounds

  • as close to the size and position of origRect as possible