gl-to-dtype
Turns a WebGL constant into a dtype string.
var asDtype = var dtype = var glType = glFLOATvar type = var array = new 16
Converts the following:
glFLOAT -> 'float32'glUNSIGNED_INT -> 'uint32'glINT -> 'int32'glUNSIGNED_SHORT -> 'uint16'glSHORT -> 'int16'glUNSIGNED_BYTE -> 'uint8'glBYTE -> 'int8'glUNSIGNED_SHORT_4_4_4_4 -> 'uint16'glUNSIGNED_SHORT_5_5_5_1 -> 'uint16'glUNSIGNED_SHORT_5_6_5 -> 'uint16'
Usage
require('gl-to-dtype')(glType)
Takes glType
constant and returns a string representation aligning with ndarray, dtype and other modules.
Returns null
if the flag isn't recognized as a supported type.
License
MIT, see LICENSE.md for details.