@scribelabsai/amazon-trp
Version:
Amazon Textract Response Parser library for Node.
13 lines • 467 B
JavaScript
import { BoundingBox } from './BoundingBox';
import { Polygon } from './Polygon';
export class Geometry {
constructor(geometry) {
const { Width, Height, Left, Top } = geometry.BoundingBox;
this.boundingBox = new BoundingBox(Width, Height, Left, Top);
this.polygon = geometry.Polygon.map(({ X, Y }) => new Polygon(X, Y));
}
toString() {
return `BoundingBox: ${this.boundingBox}`;
}
}
//# sourceMappingURL=Geometry.js.map