import WebGLConstants from "../Core/WebGLConstants.js"; /** * Enumerates all possible filters used when magnifying WebGL textures. * * @enum {Number} * * @see TextureMinificationFilter */ var TextureMagnificationFilter = { /** * Samples the texture by returning the closest pixel. * * @type {Number} * @constant */ NEAREST: WebGLConstants.NEAREST, /** * Samples the texture through bi-linear interpolation of the four nearest pixels. This produces smoother results than NEAREST filtering. * * @type {Number} * @constant */ LINEAR: WebGLConstants.LINEAR, }; /** * Validates the given textureMinificationFilter with respect to the possible enum values. * @param textureMagnificationFilter * @returns {Boolean} true if textureMagnificationFilter is valid. * * @private */ TextureMagnificationFilter.validate = function (textureMagnificationFilter) { return ( textureMagnificationFilter === TextureMagnificationFilter.NEAREST || textureMagnificationFilter === TextureMagnificationFilter.LINEAR ); }; export default Object.freeze(TextureMagnificationFilter);