Namespace: utils

me. utils

a collection of utility functions
there is no constructor function for me.utils
Source:
utils.js, line 105

Methods

<static> decodeBase64(input) → {String}

Decode a base64 encoded string into a binary string
Parameters:
Name Type Description
input String Base64 encoded data
Source:
utils.js, line 131
Returns:
Binary string
Type
String

<static> decodeBase64AsArray(input, bytes) → {Array.<Number>}

Decode a base64 encoded string into a byte array
Parameters:
Name Type Argument Description
input String Base64 encoded data
bytes Number <optional>
number of bytes per array entry
Source:
utils.js, line 157
Returns:
Decoded data
Type
Array.<Number>

<static> decodeCSV(input) → {Array.<Number>}

Decode a CSV encoded array into a binary array
Parameters:
Name Type Description
input String CSV formatted data
Source:
utils.js, line 196
Returns:
Decoded data
Type
Array.<Number>

<static> decompress(data, format) → {Array.<Number>}

decompress zlib/gzip data (NOT IMPLEMENTED)
Parameters:
Name Type Description
data Array.<Number> Array of bytes
format String compressed data format ("gzip","zlib")
Source:
utils.js, line 182
Returns:
Decompressed data
Type
Array.<Number>

<static> encodeBase64(input) → {String}

Encode binary string into a base64 string
Parameters:
Name Type Description
input String Binary string
Source:
utils.js, line 144
Returns:
Base64 encoded data
Type
String

<static> getBasename(path) → {String}

return the base name of the file without path info.
Parameters:
Name Type Description
path String path containing the filename
Source:
utils.js, line 215
Returns:
the base name without path information.
Type
String

<static> getFileExtension(path) → {String}

return the extension of the file in the given path
Parameters:
Name Type Description
path String path containing the filename
Source:
utils.js, line 228
Returns:
filename extension.
Type
String

<static> getImage(image) → {Image}

Normalize a String or Image to an Image reference
Parameters:
Name Type Description
image Image | String Image name or Image reference
Source:
utils.js, line 264
Returns:
Image reference
Type
Image

<static> getPixels(image) → {ImageData}

Get image pixels
Parameters:
Name Type Description
image Image | Canvas Image to read
Source:
utils.js, line 241
Returns:
Canvas ImageData object
Type
ImageData

<static> isPowerOfTwo(val) → {boolean}

returns true if the given value is a power of two
Parameters:
Name Type Description
val Number
Source:
utils.js, line 304
Returns:
Type
boolean

<static> nextPowerOfTwo(val) → {boolean}

returns the next power of two for the given value
Parameters:
Name Type Description
val Number
Source:
utils.js, line 317
Returns:
Type
boolean
Copyright © 2011 - 2017, Olivier Biot, Jason Oster, Aaron McLeod
Documentation generated by JSDoc 3.4.0 on 2017-02-28T11:37:41+08:00 using the DocStrap template modified by codename-.