TextureMagnificationFilter.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import freezeObject from '../Core/freezeObject.js';
  2. import WebGLConstants from '../Core/WebGLConstants.js';
  3. /**
  4. * Enumerates all possible filters used when magnifying WebGL textures.
  5. *
  6. * @exports TextureMagnificationFilter
  7. *
  8. * @see TextureMinificationFilter
  9. */
  10. var TextureMagnificationFilter = {
  11. /**
  12. * Samples the texture by returning the closest pixel.
  13. *
  14. * @type {Number}
  15. * @constant
  16. */
  17. NEAREST : WebGLConstants.NEAREST,
  18. /**
  19. * Samples the texture through bi-linear interpolation of the four nearest pixels. This produces smoother results than <code>NEAREST</code> filtering.
  20. *
  21. * @type {Number}
  22. * @constant
  23. */
  24. LINEAR : WebGLConstants.LINEAR,
  25. /**
  26. * Validates the given <code>textureMinificationFilter</code> with respect to the possible enum values.
  27. *
  28. * @private
  29. *
  30. * @param textureMagnificationFilter
  31. * @returns {Boolean} <code>true</code> if <code>textureMagnificationFilter</code> is valid.
  32. */
  33. validate : function(textureMagnificationFilter) {
  34. return ((textureMagnificationFilter === TextureMagnificationFilter.NEAREST) ||
  35. (textureMagnificationFilter === TextureMagnificationFilter.LINEAR));
  36. }
  37. };
  38. export default freezeObject(TextureMagnificationFilter);