direct port of https://github.com/warrenseine/as3-psd-parser to haxe