EncodingType
EnumSpecifies the format for encoding textures, used with Base64.
- Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, Camera Kit Mobile fully supported.
Index
Example
//@input Asset.Texture texture
//@input int compressionQuality = 0 {"widget" : "combobox", "values" : [{"label" : "MaximumCompression", "value" : "0"}, {"label" : "LowQuality", "value" : "1"}, {"label" : "IntermediateQuality", "value" : "2"}, {"label" : "HighQuality", "value" : "3"}, {"label" : "MaximumQuality", "value" : "4"}]}
//@input int encodingType = 0 {"widget" : "combobox", "values" : [{"label" : "Png", "value" : "0"}, {"label" : "Jpg", "value" : "1"}]}
Base64.encodeTextureAsync(script.texture, onSuccess, onFailure, script.compressionQuality, script.encodingType)
function onSuccess(encodedTexture) {
print("Encoded texture: " + encodedTexture)
}
function onFailure(error) {
print("Error: " + error)
}
Enumeration Members
Jpg
Jpg:
number
Lossy compression, usually smaller in size.
Png
Png:
number
Lossless compression.