/** @packageDocumentation
 * @module WebGL
 */
import { Id64, Id64String } from "@itwin/core-bentley";
import { Point3d, Range3d, Transform, XAndY, XYZ } from "@itwin/core-geometry";
import { AmbientOcclusion, AnalysisStyle, ContourDisplay, Frustum, ImageBuffer, RenderTexture, ViewFlags } from "@itwin/core-common";
import { ViewRect } from "../../../common/ViewRect";
import { HiliteSet, ModelSubCategoryHiliteMode } from "../../../SelectionSet";
import { SceneContext } from "../../../ViewContext";
import { ReadImageBufferArgs, Viewport } from "../../../Viewport";
import { IModelConnection } from "../../../IModelConnection";
import { CanvasDecoration } from "../../../render/CanvasDecoration";
import { Decorations } from "../../../render/Decorations";
import { FeatureSymbology } from "../../../render/FeatureSymbology";
import { AnimationBranchStates } from "../AnimationBranchState";
import { Pixel } from "../../../render/Pixel";
import { GraphicList } from "../../../render/RenderGraphic";
import { RenderMemory } from "../../../render/RenderMemory";
import { RenderPlan } from "../RenderPlan";
import { PlanarClassifierMap, RenderPlanarClassifier } from "../RenderPlanarClassifier";
import { RenderTextureDrape, TextureDrapeMap } from "../RenderTextureDrape";
import { RenderTarget } from "../../../render/RenderTarget";
import { PrimitiveVisibility, RenderTargetDebugControl } from "../RenderTargetDebugControl";
import { ScreenSpaceEffectContext } from "../../../render/ScreenSpaceEffectBuilder";
import { Scene } from "../../../render/Scene";
import { QueryTileFeaturesOptions, QueryVisibleFeaturesCallback } from "../../../render/VisibleFeature";
import { BranchState } from "./BranchState";
import { CachedGeometry } from "./CachedGeometry";
import { ColorInfo } from "./ColorInfo";
import { WebGLDisposable } from "./Disposable";
import { FrameBuffer } from "./FrameBuffer";
import { Batch, Branch } from "./Graphic";
import { PerformanceMetrics } from "./PerformanceMetrics";
import { PlanarClassifier } from "./PlanarClassifier";
import { RenderPass } from "./RenderFlags";
import { SceneCompositor } from "./SceneCompositor";
import { SolarShadowMap } from "./SolarShadowMap";
import { SyncTarget } from "./Sync";
import { System } from "./System";
import { TargetUniforms } from "./TargetUniforms";
import { Techniques } from "./Technique";
import { TextureDrape } from "./TextureDrape";
import { EdgeSettings } from "./EdgeSettings";
import { TargetGraphics } from "./TargetGraphics";
import { FrameStatsCollector } from "../FrameStatsCollector";
import { ActiveSpatialClassifier } from "../../../SpatialClassifiersState";
import { _implementationProhibited } from "../../../common/internal/Symbols";
/** @internal */
export interface Hilites {
    readonly elements: Id64.Uint32Set;
    readonly subcategories: Id64.Uint32Set;
    readonly models: Id64.Uint32Set;
    readonly isEmpty: boolean;
    readonly modelSubCategoryMode: ModelSubCategoryHiliteMode;
}
/** @internal */
export declare abstract class Target extends RenderTarget implements RenderTargetDebugControl, WebGLDisposable {
    protected readonly [_implementationProhibited]: undefined;
    readonly graphics: TargetGraphics;
    private _planarClassifiers?;
    private _textureDrapes?;
    private _worldDecorations?;
    private _currPickExclusions;
    private _swapPickExclusions;
    readonly pickExclusionsSyncTarget: SyncTarget;
    private _hilites;
    private readonly _hiliteSyncTarget;
    private _flashed;
    private _flashedId;
    private _flashIntensity;
    private _renderCommands;
    private _overlayRenderState;
    protected _compositor: SceneCompositor;
    protected _fbo?: FrameBuffer;
    private _dcAssigned;
    performanceMetrics?: PerformanceMetrics;
    readonly decorationsState: BranchState;
    readonly uniforms: TargetUniforms;
    readonly renderRect: ViewRect;
    analysisStyle?: AnalysisStyle;
    analysisTexture?: RenderTexture;
    ambientOcclusionSettings: AmbientOcclusion.Settings;
    private _wantAmbientOcclusion;
    private _batches;
    plan: RenderPlan;
    private _animationBranches?;
    private _isReadPixelsInProgress;
    private _readPixelsSelector;
    private _readPixelReusableResources?;
    private _drawNonLocatable;
    private _currentlyDrawingClassifier?;
    private _analysisFraction;
    private _antialiasSamples;
    private _viewport?;
    private _screenSpaceEffects;
    isFadeOutActive: boolean;
    activeVolumeClassifierTexture?: WebGLTexture;
    activeVolumeClassifierProps?: ActiveSpatialClassifier;
    activeVolumeClassifierModelId?: Id64String;
    private _currentAnimationTransformNodeId?;
    vcSupportIntersectingVolumes: boolean;
    drawForReadPixels: boolean;
    drawingBackgroundForReadPixels: boolean;
    primitiveVisibility: PrimitiveVisibility;
    displayDrapeFrustum: boolean;
    displayMaskFrustum: boolean;
    displayRealityTilePreload: boolean;
    displayRealityTileRanges: boolean;
    logRealityTiles: boolean;
    displayNormalMaps: boolean;
    freezeRealityTiles: boolean;
    get shadowFrustum(): Frustum | undefined;
    get debugControl(): RenderTargetDebugControl;
    get viewRect(): ViewRect;
    protected constructor(rect?: ViewRect);
    get compositor(): SceneCompositor;
    get isReadPixelsInProgress(): boolean;
    get readPixelsSelector(): Pixel.Selector;
    get drawNonLocatable(): boolean;
    get techniques(): Techniques;
    get hilites(): Hilites;
    get hiliteSyncTarget(): SyncTarget;
    get pickExclusions(): Id64.Uint32Set;
    get flashed(): Id64.Uint32Pair | undefined;
    get flashedId(): Id64String;
    get flashIntensity(): number;
    get analysisFraction(): number;
    set analysisFraction(fraction: number);
    get animationBranches(): AnimationBranchStates | undefined;
    set animationBranches(branches: AnimationBranchStates | undefined);
    private disposeAnimationBranches;
    get antialiasSamples(): number;
    set antialiasSamples(numSamples: number);
    get solarShadowMap(): SolarShadowMap;
    get isDrawingShadowMap(): boolean;
    getPlanarClassifier(id: Id64String): RenderPlanarClassifier | undefined;
    createPlanarClassifier(properties?: ActiveSpatialClassifier): PlanarClassifier;
    getTextureDrape(id: Id64String): RenderTextureDrape | undefined;
    getWorldDecorations(decs: GraphicList): Branch;
    get currentBranch(): BranchState;
    get currentViewFlags(): ViewFlags;
    get currentTransform(): Transform;
    get currentTransparencyThreshold(): number;
    get currentEdgeSettings(): EdgeSettings;
    get currentFeatureSymbologyOverrides(): FeatureSymbology.Overrides;
    get currentPlanarClassifier(): PlanarClassifier | undefined;
    get currentlyDrawingClassifier(): PlanarClassifier | undefined;
    get currentTextureDrape(): TextureDrape | undefined;
    get currentPlanarClassifierOrDrape(): PlanarClassifier | TextureDrape | undefined;
    get currentContours(): ContourDisplay | undefined;
    modelToView(modelPt: XYZ, result?: Point3d): Point3d;
    get is2d(): boolean;
    get is3d(): boolean;
    private _isDisposed;
    get isDisposed(): boolean;
    protected allocateFbo(): FrameBuffer | undefined;
    protected disposeFbo(): void;
    [Symbol.dispose](): void;
    pushBranch(branch: Branch): void;
    pushState(state: BranchState): void;
    popBranch(): void;
    pushViewClip(): void;
    popViewClip(): void;
    /** @internal */
    isRangeOutsideActiveVolume(range: Range3d): boolean;
    private readonly _scratchRange;
    /** @internal */
    isGeometryOutsideActiveVolume(geom: CachedGeometry): boolean;
    pushBatch(batch: Batch): void;
    popBatch(): void;
    addBatch(batch: Batch): void;
    onBatchDisposed(batch: Batch): void;
    get wantAmbientOcclusion(): boolean;
    get wantThematicDisplay(): boolean;
    get wantAtmosphere(): boolean;
    get wantThematicSensors(): boolean;
    updateSolarShadows(context: SceneContext | undefined): void;
    get renderSystem(): System;
    get planFraction(): number;
    get planFrustum(): Frustum;
    changeDecorations(decs: Decorations): void;
    changeScene(scene: Scene): void;
    onBeforeRender(viewport: Viewport, setSceneNeedRedraw: (redraw: boolean) => void): void;
    private changeDrapesOrClassifiers;
    changeTextureDrapes(textureDrapes: TextureDrapeMap | undefined): void;
    changePlanarClassifiers(planarClassifiers?: PlanarClassifierMap): void;
    changeDynamics(foreground: GraphicList | undefined, overlay: GraphicList | undefined): void;
    overrideFeatureSymbology(ovr: FeatureSymbology.Overrides): void;
    setHiliteSet(hilite: HiliteSet): void;
    setFlashed(id: Id64String, intensity: number): void;
    changeFrustum(newFrustum: Frustum, newFraction: number, is3d: boolean): void;
    changeRenderPlan(plan: RenderPlan): void;
    drawFrame(sceneMilSecElapsed?: number): void;
    protected drawOverlayDecorations(): void;
    /**
     * Invoked via Viewport.changeView() when the owning Viewport is changed to look at a different view.
     * Invoked via dispose() when the target is being destroyed.
     * The primary difference is that in the former case we retain the SceneCompositor.
     */
    reset(_realityMapLayerChanged?: boolean): void;
    get wantInvertBlackBackground(): boolean;
    computeEdgeWeight(pass: RenderPass, baseWeight: number): number;
    computeEdgeLineCode(pass: RenderPass, baseCode: number): number;
    computeEdgeColor(baseColor: ColorInfo): ColorInfo;
    beginPerfMetricFrame(sceneMilSecElapsed?: number, readPixels?: boolean): void;
    endPerfMetricFrame(readPixels?: boolean): void;
    beginPerfMetricRecord(operation: string, readPixels?: boolean): void;
    endPerfMetricRecord(readPixels?: boolean): void;
    private _frameStatsCollector;
    get frameStatsCollector(): FrameStatsCollector;
    assignFrameStatsCollector(collector: FrameStatsCollector): void;
    private paintScene;
    private drawPass;
    private getRenderState;
    private assignDC;
    readPixels(rect: ViewRect, selector: Pixel.Selector, receiver: Pixel.Receiver, excludeNonLocatable: boolean, excludedElements?: Iterable<Id64String>): void;
    private createOrReuseReadPixelResources;
    private disposeOrReuseReadPixelResources;
    private beginReadPixels;
    private endReadPixels;
    private readonly _scratchTmpFrustum;
    private readonly _scratchRectFrustum;
    private readPixelsFromFbo;
    queryVisibleTileFeatures(options: QueryTileFeaturesOptions, iModel: IModelConnection, callback: QueryVisibleFeaturesCallback): void;
    protected readImagePixels(out: Uint8Array, x: number, y: number, w: number, h: number): boolean;
    /** Returns a new size scaled up to a maximum size while maintaining proper aspect ratio.  The new size will be
     * curSize adjusted so that it fits fully within maxSize in one dimension, maintaining its original aspect ratio.
     */
    private static _applyAspectRatioCorrection;
    readImageBuffer(args?: ReadImageBufferArgs): ImageBuffer | undefined;
    copyImageToCanvas(overlayCanvas?: HTMLCanvasElement): HTMLCanvasElement;
    drawPlanarClassifiers(): void;
    drawSolarShadowMap(): void;
    drawTextureDrapes(): void;
    get screenSpaceEffects(): Iterable<string>;
    set screenSpaceEffects(effects: Iterable<string>);
    get screenSpaceEffectContext(): ScreenSpaceEffectContext;
    get currentAnimationTransformNodeId(): number | undefined;
    set currentAnimationTransformNodeId(id: number | undefined);
    /** Given GraphicBranch.animationId identifying *any* node in the scene's schedule script, return the transform node Id
     * that should be used to filter the branch's graphics for display, or undefined if no filtering should be applied.
     */
    getAnimationTransformNodeId(animationNodeId: number | undefined): number | undefined;
    protected abstract _assignDC(): boolean;
    protected abstract _beginPaint(fbo: FrameBuffer): void;
    protected abstract _endPaint(): void;
    collectStatistics(stats: RenderMemory.Statistics): void;
    protected cssViewRectToDeviceViewRect(rect: ViewRect): ViewRect;
    getRenderCommands(): Array<{
        name: string;
        count: number;
    }>;
}
/** A Target that renders to a canvas on the screen
 * @internal
 */
export declare class OnScreenTarget extends Target {
    private readonly _2dCanvas;
    private readonly _webglCanvas;
    private _usingWebGLCanvas;
    private _blitGeom?;
    private _scratchProgParams?;
    private _scratchDrawParams?;
    private _devicePixelRatioOverride?;
    private get _curCanvas();
    constructor(canvas: HTMLCanvasElement);
    get isDisposed(): boolean;
    [Symbol.dispose](): void;
    collectStatistics(stats: RenderMemory.Statistics): void;
    get devicePixelRatioOverride(): number | undefined;
    set devicePixelRatioOverride(ovr: number | undefined);
    get devicePixelRatio(): number;
    setViewRect(_rect: ViewRect, _temporary: boolean): void;
    /** Internal-only function for testing. Returns true if the FBO dimensions match the canvas dimensions */
    checkFboDimensions(): boolean;
    protected _assignDC(): boolean;
    updateViewRect(): boolean;
    protected _beginPaint(fbo: FrameBuffer): void;
    private getDrawParams;
    protected _endPaint(): void;
    protected drawOverlayDecorations(): void;
    pickOverlayDecoration(pt: XAndY): CanvasDecoration | undefined;
    onResized(): void;
    setRenderToScreen(toScreen: boolean): HTMLCanvasElement | undefined;
    readImageToCanvas(overlayCanvas?: HTMLCanvasElement): HTMLCanvasElement;
}
/** @internal */
export declare class OffScreenTarget extends Target {
    constructor(rect: ViewRect);
    onResized(): void;
    updateViewRect(): boolean;
    setViewRect(rect: ViewRect, temporary: boolean): void;
    protected _assignDC(): boolean;
    protected _beginPaint(fbo: FrameBuffer): void;
    protected _endPaint(): void;
    readImageToCanvas(): HTMLCanvasElement;
}
//# sourceMappingURL=Target.d.ts.map