(data)
| 82 | } |
| 83 | |
| 84 | function parsePng(data) { |
| 85 | return new Promise(function (resolve, reject) { |
| 86 | new PNG().parse(data, function (error, decodedResults) { |
| 87 | if (defined(error)) { |
| 88 | reject(error); |
| 89 | return; |
| 90 | } |
| 91 | resolve(decodedResults); |
| 92 | }); |
| 93 | }); |
| 94 | } |
| 95 | |
| 96 | function decodePng(texture, options) { |
| 97 | // Color type is encoded in the 25th bit of the png |