Class ImageRedactionArea
A rectangular region of one image page whose pixels must be covered with an opaque fill. The geometry is carried by an IBounds in image pixels with the origin at the top-left corner of the page, matching the geometry produced by OCR layouts and layout text elements. The area implements IBounds itself, so it can be passed anywhere a bounds is expected.
public sealed class ImageRedactionArea : IBounds
- Inheritance
-
ImageRedactionArea
- Implements
- Inherited Members
Examples
using LMKit.Media.Image;
using LMKit.Graphics.Geometry;
// Cover a 200 x 40 px region near the top of the first page.
var area = new ImageRedactionArea(pageIndex: 0, Rectangle.FromSize(left: 72, top: 96, width: 200, height: 40));
Constructors
- ImageRedactionArea(int, IBounds)
Initializes a redaction area from a page index and a bounding box.
Properties
- Bottom
Gets the vertical position of the bottom edge of the bounds.
- Bounds
Gets the normalized bounding box of the area in top-left origin image pixels.
- Height
Gets the total vertical extent of the bounds (Bottom minus Top).
- Left
Gets the horizontal position of the left edge of the bounds.
- MidX
Gets the horizontal midpoint of the bounds.
- MidY
Gets the vertical midpoint of the bounds.
- PageIndex
Gets the zero-based page index the area belongs to.
- Right
Gets the horizontal position of the right edge of the bounds.
- Top
Gets the vertical position of the top edge of the bounds.
- Width
Gets the total horizontal extent of the bounds (Right minus Left).
Methods
- FromRegion(TextRegion)
Builds redaction areas from a matched text region, one area per contributing text element so the redaction hugs the matched glyphs. Falls back to the region's bounding box when the region carries no elements.