/** @packageDocumentation
 * @module Tiles
 */
import { Cartographic, MapLayerSettings, RenderTexture, ViewFlagOverrides } from "@itwin/core-common";
import { IModelConnection } from "../../IModelConnection";
import { RenderMemory } from "../../render/RenderMemory";
import { RenderSystem } from "../../render/RenderSystem";
import { ScreenViewport } from "../../Viewport";
import { MapCartoRectangle, MapFeatureInfoOptions, MapLayerFeatureInfo, MapLayerImageryProvider, MapLayerTileTreeReference, MapTile, MapTileTreeScaleRangeVisibility, MapTilingScheme, QuadId, RealityTile, RealityTileLoader, RealityTileTree, RealityTileTreeParams, Tile, TileContent, TileDrawArgs, TileLoadPriority, TileParams, TileRequest, TileTreeLoadStatus, TileTreeOwner } from "../internal";
import { HitDetail } from "../../HitDetail";
/** @internal */
export interface ImageryTileContent extends TileContent {
    imageryTexture?: RenderTexture;
}
/** @internal */
export declare class ImageryMapTile extends RealityTile {
    imageryTree: ImageryMapTileTree;
    quadId: QuadId;
    rectangle: MapCartoRectangle;
    private _texture?;
    private _mapTileUsageCount;
    private readonly _outOfLodRange;
    constructor(params: TileParams, imageryTree: ImageryMapTileTree, quadId: QuadId, rectangle: MapCartoRectangle);
    get texture(): RenderTexture | undefined;
    get tilingScheme(): MapTilingScheme;
    get isDisplayable(): boolean;
    get isOutOfLodRange(): boolean;
    setContent(content: ImageryTileContent): void;
    selectCartoDrapeTiles(drapeTiles: ImageryMapTile[], highResolutionReplacementTiles: ImageryMapTile[], rectangleToDrape: MapCartoRectangle, drapePixelSize: number, args: TileDrawArgs): TileTreeLoadStatus;
    markMapTileUsage(): void;
    releaseMapTileUsage(): void;
    /** @internal */
    setLeaf(): void;
    protected _loadChildren(resolve: (children: Tile[] | undefined) => void, _reject: (error: Error) => void): void;
    protected _collectStatistics(stats: RenderMemory.Statistics): void;
    freeMemory(): void;
    disposeContents(): void;
    private disposeTexture;
    dispose(): void;
}
/** Object that holds various state values for an ImageryTileTree
 * @internal */
export declare class ImageryTileTreeState {
    private _scaleRangeVis;
    constructor();
    /** Get the scale range visibility of the imagery tile tree.
     * @returns the scale range visibility of the imagery tile tree.
     */
    getScaleRangeVisibility(): MapTileTreeScaleRangeVisibility;
    /** Makes a deep copy of the current object.
     */
    clone(): ImageryTileTreeState;
    /** Reset the scale range visibility of imagery tile tree (i.e. unknown)
     */
    reset(): void;
    /** Sets the scale range visibility of the current imagery tile tree.
     * The state will be derived based on the previous visibility values:
     * Initial state: 'Unknown'
     * The first call will set the state to either: 'Visible' or 'Hidden'.
     * If subsequent visibility values are not consistent with the first visibility state, the state become 'Partial',
     * meaning the imagery tree currently contains a mixed of tiles being in range and out of range.
     */
    setScaleRangeVisibility(visible: boolean): void;
}
/** @internal */
export declare class ImageryMapTileTree extends RealityTileTree {
    private _imageryLoader;
    constructor(params: RealityTileTreeParams, _imageryLoader: ImageryTileLoader);
    get tilingScheme(): MapTilingScheme;
    addLogoCards(cards: HTMLTableElement, vp: ScreenViewport): void;
    getTileRectangle(quadId: QuadId): MapCartoRectangle;
    get imageryLoader(): ImageryTileLoader;
    get is3d(): boolean;
    get viewFlagOverrides(): ViewFlagOverrides;
    get isContentUnbounded(): boolean;
    protected _selectTiles(_args: TileDrawArgs): Tile[];
    draw(_args: TileDrawArgs): void;
    private static _scratchDrapeRectangle;
    private static _drapeIntersectionScale;
    selectCartoDrapeTiles(drapeTiles: ImageryMapTile[], highResolutionReplacementTiles: ImageryMapTile[], tileToDrape: MapTile, args: TileDrawArgs): TileTreeLoadStatus;
    cartoRectangleFromQuadId(quadId: QuadId): MapCartoRectangle;
}
declare class ImageryTileLoader extends RealityTileLoader {
    private _imageryProvider;
    private _iModel;
    constructor(_imageryProvider: MapLayerImageryProvider, _iModel: IModelConnection);
    computeTilePriority(tile: Tile): number;
    get maxDepth(): number;
    get minDepth(): number;
    get priority(): TileLoadPriority;
    addLogoCards(cards: HTMLTableElement, vp: ScreenViewport): void;
    get maximumScreenSize(): number;
    get imageryProvider(): MapLayerImageryProvider;
    getToolTip(strings: string[], quadId: QuadId, carto: Cartographic, tree: ImageryMapTileTree): Promise<void>;
    getMapFeatureInfo(featureInfos: MapLayerFeatureInfo[], quadId: QuadId, carto: Cartographic, tree: ImageryMapTileTree, hit: HitDetail, options?: MapFeatureInfoOptions): Promise<void>;
    generateChildIds(tile: ImageryMapTile, resolveChildren: (childIds: QuadId[]) => void): void;
    /** Load this tile's children, possibly asynchronously. Pass them to `resolve`, or an error to `reject`. */
    loadChildren(_tile: RealityTile): Promise<Tile[] | undefined>;
    requestTileContent(tile: Tile, _isCanceled: () => boolean): Promise<TileRequest.Response>;
    getRequestChannel(_tile: Tile): import("../TileRequestChannel").TileRequestChannel;
    loadTileContent(tile: Tile, data: TileRequest.ResponseData, system: RenderSystem): Promise<ImageryTileContent>;
    private loadTextureImage;
}
/** A reference to one of our tile trees. The specific TileTree drawn may change when the desired imagery type or target iModel changes.
 * @beta
 */
export declare class ImageryMapLayerTreeReference extends MapLayerTileTreeReference {
    /**
     * Constructor for an ImageryMapLayerTreeReference.
     * @param layerSettings Map layer settings that are applied to the ImageryMapLayerTreeReference.
     * @param layerIndex The index of the associated map layer. Usually passed in through [[createMapLayerTreeReference]] in [[MapTileTree]]'s constructor.
     * @param iModel The iModel containing the ImageryMapLayerTreeReference.
     */
    constructor(args: {
        layerSettings: MapLayerSettings;
        layerIndex: number;
        iModel: IModelConnection;
    });
    get castsShadows(): boolean;
    /** Return the owner of the TileTree to draw. */
    get treeOwner(): TileTreeOwner;
    resetTreeOwner(): void;
    get imageryProvider(): MapLayerImageryProvider | undefined;
}
export {};
//# sourceMappingURL=ImageryTileTree.d.ts.map