/** * Vertex/corner of a `polygon` region. */ export interface Vertex { /** * Coordinates of the vertex. */ x: number; /** * Coordinates of the vertex. */ y: number; } /** * Filter for image regions. If `any`, all regions will be returned. Otherwise * only regions of the given shape will be returned. */ export declare type ShapeFilter = 'any' | 'rectangle' | 'circle' | 'polygon'; /** * Filter for image regions. If `any`, all regions will be returned. Otherwise * if `crop`, only regions with one of the cropping-related roles described * at https://cv.iptc.org/newscodes/imageregionrole/ will be returned. */ export declare type RoleFilter = 'any' | 'crop'; export declare class ImageRegion { /** * @return `true` if the region matches the given shape and role filters. */ matches(shapeFilter: ShapeFilter, roleFilter: RoleFilter): boolean; /** * Identifier for the region. Unique within the image. */ id: string; /** * Names for the region, possibly in multiple languages. */ names: string[]; /** * Region shape, can be `rectangle`, `circle` or `polygon`. */ shape: string; /** * Region types, see https://cv.iptc.org/newscodes/imageregiontype/ */ types?: string[]; /** * Region roles, see https://cv.iptc.org/newscodes/imageregionrole/ */ roles?: string[]; /** * Unit used for `x`, `y`, `width`, `height`, `radius` and `vertices`. Can be * `relative` or `pixel`, see * https://iptc.org/std/photometadata/specification/IPTC-PhotoMetadata#boundary-measuring-unit */ unit: string; /** * Original/full image width. Reference width to be used as a base for `x`, * `width`, `radius` and `vertices/x` when `unit` is `pixel`. See * https://docs.frameright.io/web-component/attribute-ref */ imageWidth?: number; /** * Original/full image width. Reference width to be used as a base for `y`, * `height` and `vertices/y` when `unit` is `pixel`. See * https://docs.frameright.io/web-component/attribute-ref */ imageHeight?: number; /** * Coordinates of a `rectangle` or `circle` region. */ x?: number; /** * Coordinates of a `rectangle` or `circle` region. */ y?: number; /** * Width of a `rectangle` region. */ width?: number; /** * Height of a `rectangle` region. */ height?: number; /** * Radius of a `circle` region. */ radius?: number; /** * Vertices/corners of a `polygon` region. */ vertices?: Vertex[]; /** * Identifier for the region definition. */ idcRegionDefinitionId?: string; /** * Name for the region definition. */ idcRegionDefinitionName?: string; /** * See https://cv.iptc.org/newscodes/imageregionrole/ */ private static readonly _CROP_XML_ROLES; private _matchesShapeFilter; private _matchesRoleFilter; }