/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module Rendering
 */
import { compareStrings, Guid } from "@itwin/core-bentley";
/** Represents a texture image applied to a surface during rendering.
 * A RenderTexture is typically - but not always - associated with a [[RenderMaterial]].
 * @see [RenderSystem.createTextureFromImage]($frontend) to obtain a texture from an HTML image.
 * @see [RenderSystem.createTextureFromElement]($frontend) to obtain a texture from a [Texture]($backend) element.
 * @public
 */
export class RenderTexture {
    get isTileSection() { return RenderTexture.Type.TileSection === this.type; }
    get isGlyph() { return RenderTexture.Type.Glyph === this.type; }
    get isSkyBox() { return RenderTexture.Type.SkyBox === this.type; }
    constructor(type) {
        this.type = type;
        this._guid = Guid.createValue();
    }
    /** An [OrderedComparator]($bentley) that compares this texture against `other`. */
    compare(other) {
        return compareStrings(this._guid, other._guid);
    }
}
/** @public */
(function (RenderTexture) {
    /** The types of [[RenderTexture]]s that can be created by a [RenderSystem]($frontend). */
    let Type;
    (function (Type) {
        /** An image applied to a surface, with support for mip-mapping and repetition. */
        Type[Type["Normal"] = 0] = "Normal";
        /** An image containing any number of text glyphs, used for efficiently rendering readable small text. */
        Type[Type["Glyph"] = 1] = "Glyph";
        /** A non-repeating image with no mip-maps, used for example for reality models. */
        Type[Type["TileSection"] = 2] = "TileSection";
        /** A three-dimensional texture used for rendering a skybox. */
        Type[Type["SkyBox"] = 3] = "SkyBox";
        /** A non-repeating image with mip-maps and and anisotropic filtering, used for map tiles when draped on terrain. */
        Type[Type["FilteredTileSection"] = 4] = "FilteredTileSection";
        /** A gradient image used for thematic display. */
        Type[Type["ThematicGradient"] = 5] = "ThematicGradient";
    })(Type = RenderTexture.Type || (RenderTexture.Type = {}));
    /** Parameters used to construct a [[RenderTexture]].
     * @deprecated in 3.x. use RenderSystem.createTexture and CreateTextureArgs.
     * @public
     */
    class Params {
        constructor(key, type = RenderTexture.Type.Normal, isOwned = false) {
            this.key = key;
            this.type = type;
            this.isOwned = isOwned;
        }
        get isTileSection() { return RenderTexture.Type.TileSection === this.type; }
        get isGlyph() { return RenderTexture.Type.Glyph === this.type; }
        get isSkyBox() { return RenderTexture.Type.SkyBox === this.type; }
    }
    RenderTexture.Params = Params;
})(RenderTexture || (RenderTexture = {}));
//# sourceMappingURL=RenderTexture.js.map