This repository has been archived by the owner on Aug 29, 2023. It is now read-only.
forked from CesiumGS/cesium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TextureMinificationFilter.js
61 lines (58 loc) · 2.53 KB
/
TextureMinificationFilter.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
define([
'../Core/freezeObject',
'../Core/WebGLConstants'
], function(
freezeObject,
WebGLConstants) {
'use strict';
/**
* Enumerates all possible filters used when minifying WebGL textures, which takes places when zooming
* out of imagery. Provides the possible values for the {@link ImageryLayer#minificationFilter} property.
*
* @alias TextureMinificationFilter
*
* @see TextureMagnificationFilter
* @see ImageryLayer#minificationFilter
*/
var TextureMinificationFilter = {
/**
* Nearest neighbor sampling of image pixels to texture.
*/
NEAREST : WebGLConstants.NEAREST,
/**
* Bi-linear interpolation of image pixels to texture.
*/
LINEAR : WebGLConstants.LINEAR,
/**
* WebGL <code>NEAREST_MIPMAP_NEAREST</code> interpolation of image pixels to texture.
*/
NEAREST_MIPMAP_NEAREST : WebGLConstants.NEAREST_MIPMAP_NEAREST,
/**
* WebGL <code>LINEAR_MIPMAP_NEAREST</code> interpolation of image pixels to texture.
*/
LINEAR_MIPMAP_NEAREST : WebGLConstants.LINEAR_MIPMAP_NEAREST,
/**
* WebGL <code>NEAREST_MIPMAP_LINEAR</code> interpolation of image pixels to texture.
*/
NEAREST_MIPMAP_LINEAR : WebGLConstants.NEAREST_MIPMAP_LINEAR,
/**
* WebGL <code>LINEAR_MIPMAP_LINEAR</code> interpolation of image pixels to texture.
*/
LINEAR_MIPMAP_LINEAR : WebGLConstants.LINEAR_MIPMAP_LINEAR,
/**
* Validates the given <code>textureMinificationFilter</code> with respect to the possible enum values.
*
* @param textureMinificationFilter
* @returns {boolean} <code>true</code> if <code>textureMinificationFilter</code> is valid.
*/
validate : function(textureMinificationFilter) {
return ((textureMinificationFilter === TextureMinificationFilter.NEAREST) ||
(textureMinificationFilter === TextureMinificationFilter.LINEAR) ||
(textureMinificationFilter === TextureMinificationFilter.NEAREST_MIPMAP_NEAREST) ||
(textureMinificationFilter === TextureMinificationFilter.LINEAR_MIPMAP_NEAREST) ||
(textureMinificationFilter === TextureMinificationFilter.NEAREST_MIPMAP_LINEAR) ||
(textureMinificationFilter === TextureMinificationFilter.LINEAR_MIPMAP_LINEAR));
}
};
return freezeObject(TextureMinificationFilter);
});