import { ElementRef, EventEmitter, OnChanges, OnDestroy, SimpleChanges } from '@angular/core'; import { ReadGeomValue, ReadResource, ReadStillImageFileValue, RegionGeometry } from '@dasch-swiss/dsp-js'; /** * Represents a region resource. */ export declare class Region { readonly regionResource: ReadResource; /** * * @param regionResource a resource of type Region */ constructor(regionResource: ReadResource); /** * Get all geometry information belonging to this region. * */ getGeometries(): ReadGeomValue[]; } /** * Represents a still image file value including its regions. */ export declare class StillImageRepresentation { readonly stillImageFileValue: ReadStillImageFileValue; readonly regions: Region[]; /** * * @param stillImageFileValue a [[ReadStillImageFileValue]] representing an image. * @param regions the regions belonging to the image. */ constructor(stillImageFileValue: ReadStillImageFileValue, regions: Region[]); } /** * Represents a geometry belonging to a specific region resource. */ export declare class GeometryForRegion { readonly geometry: RegionGeometry; readonly region: ReadResource; /** * * @param geometry the geometrical information. * @param region the region the geometry belongs to. */ constructor(geometry: RegionGeometry, region: ReadResource); } export declare class StillImageComponent implements OnChanges, OnDestroy { private _elementRef; images: StillImageRepresentation[]; imageCaption?: string; activateRegion?: string; regionClicked: EventEmitter; private _viewer; private _regions; /** * Calculates the surface of a rectangular region. * * @param geom the region's geometry. * @returns the surface. */ static surfaceOfRectangularRegion(geom: RegionGeometry): number; constructor(_elementRef: ElementRef); ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; /** * Renders all ReadStillImageFileValues to be found in [[this.images]]. * (Although this.images is a Angular Input property, the built-in change detection of Angular does not detect changes in complex objects or arrays, only reassignment of objects/arrays. * Use this method if additional ReadStillImageFileValues were added to this.images after creation/assignment of the this.images array.) */ updateImages(): void; /** * Renders all regions to be found in [[this.images]]. * (Although this.images is a Angular Input property, the built-in change detection of Angular does not detect changes in complex objects or arrays, only reassignment of objects/arrays. * Use this method if additional regions were added to the resources.images) */ updateRegions(): void; /** * Highlights the polygon elements associated with the given region. * * @param regionIri the Iri of the region whose polygon elements should be highlighted.. */ private _highlightRegion; /** * Unhighlights the polygon elements of all regions. * */ private _unhighlightAllRegions; /** * Removes SVG overlays from the DOM. */ private _removeOverlays; /** * Initializes the OpenSeadragon _viewer */ private _setupViewer; /** * Adds all images in this.images to the _viewer. * Images are positioned in a horizontal row next to each other. */ private _openImages; /** * Prepare tile sources from the given sequence of [[ReadStillImageFileValue]]. * * @param imagesToDisplay the given file values to de displayed. * @returns the tile sources to be passed to OSD _viewer. */ private _prepareTileSourcesFromFileValues; /** * Adds a ROI-overlay to the viewer for every region of every image in this.images */ private _renderRegions; /** * Creates and adds a ROI-overlay to the viewer * @param regionIri the Iri of the region. * @param geometry - the geometry describing the ROI * @param aspectRatio - the aspectRatio (h/w) of the image on which the geometry should be placed * @param xOffset - the x-offset in Openseadragon viewport coordinates of the image on which the geometry should be placed * @param toolTip - the tooltip which should be displayed on mousehover of the svg element */ private _createSVGOverlay; /** * Adds the necessary attributes to create a ROI-overlay of type 'rectangle' to a SVGElement * @param svgElement - an SVGElement (should have type 'polygon' (sic)) * @param geometry - the geometry describing the rectangle * @param aspectRatio - the aspectRatio (h/w) of the image on which the circle should be placed * @param xOffset - the x-offset in Openseadragon viewport coordinates of the image on which the circle should be placed */ private _addSVGAttributesRectangle; /** * Adds the necessary attributes to create a ROI-overlay of type 'polygon' to a SVGElement * @param svgElement - an SVGElement (should have type 'polygon') * @param geometry - the geometry describing the polygon * @param aspectRatio - the aspectRatio (h/w) of the image on which the circle should be placed * @param xOffset - the x-offset in Openseadragon viewport coordinates of the image on which the circle should be placed */ private _addSVGAttributesPolygon; /** * Adds the necessary attributes to create a ROI-overlay of type 'circle' to a SVGElement * @param svgElement - an SVGElement (should have type 'circle') * @param geometry - the geometry describing the circle * @param aspectRatio - the aspectRatio (h/w) of the image on which the circle should be placed * @param xOffset - the x-offset in Openseadragon viewport coordinates of the image on which the circle should be placed */ private _addSVGAttributesCircle; /** * Maps a Point2D[] with coordinates relative to an image to a new Point2D[] with coordinates in the viewport coordinate system of Openseadragon * see also: https://openseadragon.github.io/examples/viewport-coordinates/ * @param points - an array of points in coordinate system relative to an image * @param aspectRatio - the aspectRatio (h/w) of the image * @param xOffset - the x-offset in viewport coordinates of the image * @returns - a new Point2D[] with coordinates in the viewport coordinate system of Openseadragon */ private _image2ViewPortCoords; /** * Returns a string in the format expected by the 'points' attribute of a SVGElement * @param points - an array of points to be serialized to a string * @returns - the points serialized to a string in the format expected by the 'points' attribute of a SVGElement */ private _createSVGPolygonPointsAttribute; }