import { TextureSource } from './sources/TextureSource';
import { Texture } from './Texture';
import { TextureStyle } from './TextureStyle';
import type { Size } from '../../../../maths/misc/Size';
import type { TextureSourceOptions } from './sources/TextureSource';
/**
 * A request for a texture from the pool. `width` and `height` are the minimum frame size the texture must
 * hold; the other fields are the only {@link TextureSourceOptions} the pool honours, and each falls back
 * to the pool's own options.
 * @category rendering
 * @advanced
 */
export type TexturePoolRequest = Pick<TextureSourceOptions, 'resolution' | 'antialias' | 'autoGenerateMipmaps' | 'format' | 'scaleMode'> & {
    width: number;
    height: number;
};
/**
 * Texture pool, used by FilterSystem and plugins.
 *
 * Stores collection of temporary pow2 or screen-sized renderTextures. Textures are bucketed by size,
 * flags, format and scale mode, so one pool can serve colour, float and depth targets side by side.
 * @category rendering
 * @advanced
 */
export declare class TexturePoolClass {
    /** The default options for texture pool */
    textureOptions: TextureSourceOptions;
    /** idle textures, keyed by format, scale mode, size and flags */
    private readonly _buckets;
    /** the bucket key of every texture handed out, by texture uid */
    private _poolKey;
    /** the style the pool created for every texture handed out, by texture uid */
    private _poolStyle;
    /** the screens this pool is sizing its textures for */
    private readonly _screens;
    private _textureStyle?;
    private _enableFullScreen;
    /**
     * @param textureOptions - options that will be passed to BaseRenderTexture constructor
     * @param {SCALE_MODE} [textureOptions.scaleMode] - See {@link SCALE_MODE} for possible values.
     */
    constructor(textureOptions?: TextureSourceOptions);
    /**
     * A style built from the pool options. The pool no longer applies it to anything.
     * @deprecated since 8.21.0, pooled textures carry their own style; pass `scaleMode` in the request instead.
     */
    get textureStyle(): TextureStyle;
    set textureStyle(value: TextureStyle);
    /**
     * Has no effect. The pool sizes textures to the screens registered with
     * {@link TexturePoolClass#setScreenSize|setScreenSize}.
     * @deprecated since 8.21.0
     */
    get enableFullScreen(): boolean;
    set enableFullScreen(value: boolean);
    /**
     * Creates a texture from a request, using the pool constructor options for anything unset.
     * @param options - Width and height are in physical pixels. Format and scale mode fall back to the pool's own.
     */
    createTexture(options: TexturePoolRequest): Texture;
    /** @deprecated since 8.21.0 */
    createTexture(pixelWidth: number, pixelHeight: number, antialias?: boolean, autoGenerateMipmaps?: boolean): Texture;
    /**
     * Gets a Power-of-Two render texture or screen sized texture.
     *
     * Width and height are the minimum frame size. Resolution, antialias, mipmaps, format and scale
     * mode fall back to 1 / false / the pool's own options. Each format and scale mode keeps its own buckets.
     * @param options - The request, using the same fields as {@link TextureSourceOptions}.
     * @returns The new render texture.
     */
    getOptimalTexture(options: TexturePoolRequest): Texture;
    /** @deprecated since 8.21.0 */
    getOptimalTexture(frameWidth: number, frameHeight: number, resolution?: number, antialias?: boolean, autoGenerateMipmaps?: boolean): Texture;
    /**
     * The backing size, in physical pixels, that {@link TexturePoolClass#getOptimalTexture|getOptimalTexture}
     * would allocate for a request, without taking a texture from the pool.
     *
     * Each axis is the next power of two, or the smallest registered screen the request fits inside
     * (see {@link TexturePoolClass#setScreenSize|setScreenSize}). Use it when a consumer needs to know
     * where a request's content will sit inside its pooled texture before it has one, such as a uniform
     * that maps content space onto texture space.
     * @param frameWidth - The minimum width of the texture.
     * @param frameHeight - The minimum height of the texture.
     * @param resolution - The resolution of the texture.
     * @returns The width and height the pooled texture would have, in physical pixels.
     */
    getOptimalSize(frameWidth: number, frameHeight: number, resolution?: number): Size;
    /**
     * Gets a pooled texture matching the dimensions and resolution of the given texture.
     *
     * This is a convenience wrapper around {@link TexturePoolClass#getOptimalTexture|getOptimalTexture}
     * that copies width, height, and resolution from an existing texture. Useful when a filter needs
     * a temporary texture the same size as its input (e.g., for multi-pass blur).
     * @param texture - The texture whose dimensions to match.
     * @param antialias - Whether to use antialias on the pooled texture. Defaults to `false`.
     * @returns A pooled texture with power-of-two or screen sized backing dimensions at the source resolution.
     */
    getSameSizeTexture(texture: Texture, antialias?: boolean): Texture<TextureSource<any>>;
    /**
     * Returns a texture to the pool so it can be reused by future
     * {@link TexturePoolClass#getOptimalTexture|getOptimalTexture}
     * or {@link TexturePoolClass#getSameSizeTexture|getSameSizeTexture} calls.
     *
     * If you gave the texture a style of your own after obtaining it (a different address mode, anisotropy
     * or similar), pass `resetStyle = true` so the pool puts its own style back. Otherwise your style stays
     * on the texture and the next consumer inherits it.
     * @param renderTexture - The texture to return to the pool.
     * @param resetStyle - When `true`, restores the style the pool created for this texture. Defaults to `false`.
     */
    returnTexture(renderTexture: Texture, resetStyle?: boolean): void;
    /**
     * Registers the screen size of a renderer with the pool, in physical pixels.
     *
     * While a screen is registered, a request that fits inside it on an axis is given that screen's size on
     * that axis instead of the next power of two, which stops a full screen filter from allocating a texture
     * far larger than the screen. Requests larger than every registered screen on an axis keep the power of
     * two size - the pool never rounds a request up to a screen it does not fit in.
     * @param rendererUid - The uid of the renderer, used to update or remove this screen later.
     * @param pixelWidth - The width of the screen in physical pixels.
     * @param pixelHeight - The height of the screen in physical pixels.
     */
    setScreenSize(rendererUid: number, pixelWidth: number, pixelHeight: number): void;
    /**
     * Removes a screen previously registered with
     * {@link TexturePoolClass#setScreenSize|setScreenSize}, destroying any idle textures that were
     * only being kept for it.
     * @param rendererUid - The uid the screen was registered with.
     */
    removeScreen(rendererUid: number): void;
    /**
     * Destroys the idle textures in every bucket that has a non power of two dimension matching no live
     * screen. Power of two buckets are always kept, as any request can fall back to them.
     */
    private _pruneScreenTextures;
    /**
     * Forgets idle textures were ever handed out, so a later return is ignored, and optionally destroys them.
     * @param textures - The textures of one bucket.
     * @param destroy - Whether to destroy the textures as well.
     */
    private _dropTextures;
    /**
     * Clears the pool.
     * @param destroyTextures - Destroy all stored textures.
     */
    clear(destroyTextures?: boolean): void;
}
/**
 * The default texture pool instance.
 * @category rendering
 * @advanced
 */
export declare const TexturePool: TexturePoolClass;
