Class CutoutRect

  • All Implemented Interfaces:

    
    public class CutoutRect
    
                        

    Configures the cutout and calculates crop bounds for image processing.

    Positive cropPadding values expand the captured region outward beyond the visible cutout, providing better scan accuracy at edges by capturing slightly more than what the user sees.

    • Positive padding: Expands crop area outward (e.g., {x:50, y:50} adds 100px to each dimension)
    • Zero padding: Crop area equals visible cutout (no expansion)
    Formula (in camera resolution pixels):
    cropWidth = cutoutWidth + 2 * cropPadding.x
    cropHeight = cutoutHeight + 2 * cropPadding.y
    cropX = cutoutX - cropPadding.x + cropOffset.x
    cropY = cutoutY - cropPadding.y + cropOffset.y
    

    Note: All values are in camera resolution pixels (px), not density-independent pixels (dp).

    Since:

    56.0.0 Breaking change: cropPadding now expands outward (previously contracted inward)