@aibee/owlly 1.0.26 → 1.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/external/lines/line-geometry.d.ts +9 -0
- package/lib/external/lines/line-geometry.js +51 -0
- package/lib/external/lines/line-material.d.ts +10 -0
- package/lib/external/lines/line-material.js +376 -0
- package/lib/external/lines/line-segments-2.d.ts +7 -0
- package/lib/external/lines/line-segments-2.js +143 -0
- package/lib/external/lines/line-segments-geometry.d.ts +15 -0
- package/lib/external/lines/line-segments-geometry.js +140 -0
- package/lib/external/loaders/gltf-loader.d.ts +77 -0
- package/lib/external/loaders/gltf-loader.js +2318 -0
- package/lib/external/orbit-controls.d.ts +44 -0
- package/lib/external/orbit-controls.js +745 -0
- package/lib/external/renderers/css-2d-renderer.d.ts +16 -0
- package/lib/external/renderers/css-2d-renderer.js +121 -0
- package/lib/external/renderers/css-3d-renderer.d.ts +18 -0
- package/lib/external/renderers/css-3d-renderer.js +138 -0
- package/lib/external/transform-controls.d.ts +106 -0
- package/lib/external/transform-controls.js +1112 -0
- package/lib/owlly/controller/aerial-element-controller.d.ts +65 -0
- package/lib/owlly/controller/aerial-element-controller.js +235 -0
- package/lib/owlly/controller/basic-controller.d.ts +324 -0
- package/lib/owlly/controller/basic-controller.js +1238 -0
- package/lib/owlly/controller/camera-controller.d.ts +37 -0
- package/lib/owlly/controller/camera-controller.js +137 -0
- package/lib/owlly/controller/controller.d.ts +61 -0
- package/lib/owlly/controller/controller.js +23 -0
- package/lib/owlly/controller/index.d.ts +2 -0
- package/lib/owlly/controller/index.js +13 -0
- package/lib/owlly/controller/mouse-indicator-controller.d.ts +34 -0
- package/lib/owlly/controller/mouse-indicator-controller.js +118 -0
- package/lib/owlly/controller/orbit-control.d.ts +147 -0
- package/lib/owlly/controller/orbit-control.js +264 -0
- package/lib/owlly/controller/panorama-adjust-controller.d.ts +45 -0
- package/lib/owlly/controller/panorama-adjust-controller.js +157 -0
- package/lib/owlly/controller/panorama-controller.d.ts +441 -0
- package/lib/owlly/controller/panorama-controller.js +1943 -0
- package/lib/owlly/controller/panorama-transform-controller.d.ts +66 -0
- package/lib/owlly/controller/panorama-transform-controller.js +136 -0
- package/lib/owlly/controller/plane-controller.d.ts +43 -0
- package/lib/owlly/controller/plane-controller.js +173 -0
- package/lib/owlly/controller/texture-controller.d.ts +181 -0
- package/lib/owlly/controller/texture-controller.js +875 -0
- package/lib/owlly/controller/tile-panorama-controller.d.ts +308 -0
- package/lib/owlly/controller/tile-panorama-controller.js +1353 -0
- package/lib/owlly/controller/transform-controller.d.ts +106 -0
- package/lib/owlly/controller/transform-controller.js +545 -0
- package/lib/owlly/element/bottom-nav-element.d.ts +65 -0
- package/lib/owlly/element/bottom-nav-element.js +257 -0
- package/lib/owlly/element/camera.d.ts +82 -0
- package/lib/owlly/element/camera.js +283 -0
- package/lib/owlly/element/dom-2d-element.d.ts +35 -0
- package/lib/owlly/element/dom-2d-element.js +48 -0
- package/lib/owlly/element/dom-3d-element.d.ts +27 -0
- package/lib/owlly/element/dom-3d-element.js +33 -0
- package/lib/owlly/element/dom-label-2d.d.ts +116 -0
- package/lib/owlly/element/dom-label-2d.js +382 -0
- package/lib/owlly/element/element.d.ts +53 -0
- package/lib/owlly/element/element.js +75 -0
- package/lib/owlly/element/floor-model.d.ts +83 -0
- package/lib/owlly/element/floor-model.js +227 -0
- package/lib/owlly/element/gif-kit/Gif.d.ts +96 -0
- package/lib/owlly/element/gif-kit/Gif.js +432 -0
- package/lib/owlly/element/gif-kit/GifColor.d.ts +21 -0
- package/lib/owlly/element/gif-kit/GifColor.js +37 -0
- package/lib/owlly/element/gif-kit/GifCompressedCodesToByteArrayConverter.d.ts +20 -0
- package/lib/owlly/element/gif-kit/GifCompressedCodesToByteArrayConverter.js +50 -0
- package/lib/owlly/element/gif-kit/GifFrame.d.ts +31 -0
- package/lib/owlly/element/gif-kit/GifFrame.js +96 -0
- package/lib/owlly/element/gif-kit/GifImage.d.ts +23 -0
- package/lib/owlly/element/gif-kit/GifImage.js +7 -0
- package/lib/owlly/element/gif-kit/GifParser.d.ts +17 -0
- package/lib/owlly/element/gif-kit/GifParser.js +196 -0
- package/lib/owlly/element/gif-kit/GifPresenter.d.ts +20 -0
- package/lib/owlly/element/gif-kit/GifPresenter.js +43 -0
- package/lib/owlly/element/gif-kit/GifVersion.d.ts +10 -0
- package/lib/owlly/element/gif-kit/GifVersion.js +12 -0
- package/lib/owlly/element/gltf-mesh-element.d.ts +31 -0
- package/lib/owlly/element/gltf-mesh-element.js +136 -0
- package/lib/owlly/element/index.d.ts +20 -0
- package/lib/owlly/element/index.js +24 -0
- package/lib/owlly/element/map-kit/shape.d.ts +131 -0
- package/lib/owlly/element/map-kit/shape.js +189 -0
- package/lib/owlly/element/mesh-element.d.ts +22 -0
- package/lib/owlly/element/mesh-element.js +63 -0
- package/lib/owlly/element/mesh-line-2d.d.ts +82 -0
- package/lib/owlly/element/mesh-line-2d.js +887 -0
- package/lib/owlly/element/meshline-o.d.ts +64 -0
- package/lib/owlly/element/meshline-o.js +678 -0
- package/lib/owlly/element/panorama-group.d.ts +241 -0
- package/lib/owlly/element/panorama-group.js +966 -0
- package/lib/owlly/element/panorama.d.ts +132 -0
- package/lib/owlly/element/panorama.js +812 -0
- package/lib/owlly/element/path-group.d.ts +69 -0
- package/lib/owlly/element/path-group.js +171 -0
- package/lib/owlly/element/path.d.ts +99 -0
- package/lib/owlly/element/path.js +531 -0
- package/lib/owlly/element/placeable-2d.d.ts +158 -0
- package/lib/owlly/element/placeable-2d.js +470 -0
- package/lib/owlly/element/polygon-mesh.d.ts +107 -0
- package/lib/owlly/element/polygon-mesh.js +307 -0
- package/lib/owlly/element/ring-element.d.ts +79 -0
- package/lib/owlly/element/ring-element.js +383 -0
- package/lib/owlly/element/sphere-mesh.d.ts +28 -0
- package/lib/owlly/element/sphere-mesh.js +69 -0
- package/lib/owlly/element/svg-floor-model.d.ts +22 -0
- package/lib/owlly/element/svg-floor-model.js +184 -0
- package/lib/owlly/element/svg-floors.d.ts +27 -0
- package/lib/owlly/element/svg-floors.js +109 -0
- package/lib/owlly/element/tile-panorama-group.d.ts +335 -0
- package/lib/owlly/element/tile-panorama-group.js +1006 -0
- package/lib/owlly/element/tile-panorama.d.ts +161 -0
- package/lib/owlly/element/tile-panorama.js +509 -0
- package/lib/owlly/element/tile-plane.d.ts +105 -0
- package/lib/owlly/element/tile-plane.js +360 -0
- package/lib/owlly/element/video-element.d.ts +33 -0
- package/lib/owlly/element/video-element.js +159 -0
- package/lib/owlly/geometries/ExtrudeGeometry2.d.ts +15 -0
- package/lib/owlly/geometries/ExtrudeGeometry2.js +210 -0
- package/lib/owlly/index.d.ts +13 -0
- package/lib/owlly/index.js +16 -0
- package/lib/owlly/overlay/canvas-overlay.d.ts +96 -0
- package/lib/owlly/overlay/canvas-overlay.js +510 -0
- package/lib/owlly/overlay/css-2d-overlay.d.ts +14 -0
- package/lib/owlly/overlay/css-2d-overlay.js +35 -0
- package/lib/owlly/overlay/css-3d-overlay.d.ts +16 -0
- package/lib/owlly/overlay/css-3d-overlay.js +36 -0
- package/lib/owlly/overlay/index.d.ts +6 -0
- package/lib/owlly/overlay/index.js +11 -0
- package/lib/owlly/overlay/label-overlay.d.ts +62 -0
- package/lib/owlly/overlay/label-overlay.js +328 -0
- package/lib/owlly/overlay/overlay.d.ts +14 -0
- package/lib/owlly/overlay/overlay.js +4 -0
- package/lib/owlly/overlay/path-overlay.d.ts +39 -0
- package/lib/owlly/overlay/path-overlay.js +124 -0
- package/lib/owlly/overlay/path-overlay2.d.ts +35 -0
- package/lib/owlly/overlay/path-overlay2.js +118 -0
- package/lib/owlly/overlay/poi-overlay-3d.d.ts +278 -0
- package/lib/owlly/overlay/poi-overlay-3d.js +1432 -0
- package/lib/owlly/overlay/poi-overlay.d.ts +277 -0
- package/lib/owlly/overlay/poi-overlay.js +1411 -0
- package/lib/owlly/owlly-2d/index.d.ts +28 -0
- package/lib/owlly/owlly-2d/index.js +92 -0
- package/lib/owlly/screen/index.d.ts +1 -0
- package/lib/owlly/screen/index.js +1 -0
- package/lib/owlly/screen/screen.d.ts +73 -0
- package/lib/owlly/screen/screen.js +236 -0
- package/lib/owlly/stage/externals.d.ts +19 -0
- package/lib/owlly/stage/externals.js +24 -0
- package/lib/owlly/stage/index.d.ts +4 -0
- package/lib/owlly/stage/index.js +6 -0
- package/lib/owlly/stage/owlly.d.ts +38 -0
- package/lib/owlly/stage/owlly.js +168 -0
- package/lib/owlly/stage/stage.d.ts +108 -0
- package/lib/owlly/stage/stage.js +234 -0
- package/lib/owlly/utils/alignment-utils.d.ts +20 -0
- package/lib/owlly/utils/alignment-utils.js +63 -0
- package/lib/owlly/utils/basic-calc.d.ts +18 -0
- package/lib/owlly/utils/basic-calc.js +129 -0
- package/lib/owlly/utils/basic-tools.d.ts +71 -0
- package/lib/owlly/utils/basic-tools.js +235 -0
- package/lib/owlly/utils/bvh-tree.d.ts +105 -0
- package/lib/owlly/utils/bvh-tree.js +539 -0
- package/lib/owlly/utils/camera.d.ts +37 -0
- package/lib/owlly/utils/camera.js +50 -0
- package/lib/owlly/utils/cube-texture-cache.d.ts +25 -0
- package/lib/owlly/utils/cube-texture-cache.js +143 -0
- package/lib/owlly/utils/device-utils.d.ts +18 -0
- package/lib/owlly/utils/device-utils.js +41 -0
- package/lib/owlly/utils/environment-utils.d.ts +37 -0
- package/lib/owlly/utils/environment-utils.js +73 -0
- package/lib/owlly/utils/event-hub.d.ts +50 -0
- package/lib/owlly/utils/event-hub.js +106 -0
- package/lib/owlly/utils/events.d.ts +219 -0
- package/lib/owlly/utils/events.js +219 -0
- package/lib/owlly/utils/geometry-utils.d.ts +119 -0
- package/lib/owlly/utils/geometry-utils.js +622 -0
- package/lib/owlly/utils/helper.d.ts +6 -0
- package/lib/owlly/utils/helper.js +24 -0
- package/lib/owlly/utils/index.d.ts +14 -0
- package/lib/owlly/utils/index.js +17 -0
- package/lib/owlly/utils/lru-cache.d.ts +26 -0
- package/lib/owlly/utils/lru-cache.js +109 -0
- package/lib/owlly/utils/map-utils.d.ts +7 -0
- package/lib/owlly/utils/map-utils.js +52 -0
- package/lib/owlly/utils/number-utils.d.ts +8 -0
- package/lib/owlly/utils/number-utils.js +72 -0
- package/lib/owlly/utils/panorama-model-util.d.ts +46 -0
- package/lib/owlly/utils/panorama-model-util.js +245 -0
- package/lib/owlly/utils/path-utils.d.ts +80 -0
- package/lib/owlly/utils/path-utils.js +728 -0
- package/lib/owlly/utils/svgutils.d.ts +138 -0
- package/lib/owlly/utils/svgutils.js +561 -0
- package/lib/owlly/utils/texture-cache.d.ts +29 -0
- package/lib/owlly/utils/texture-cache.js +115 -0
- package/lib/owlly/utils/tile-util.d.ts +187 -0
- package/lib/owlly/utils/tile-util.js +456 -0
- package/lib/owlly/utils/time-profiler.d.ts +21 -0
- package/lib/owlly/utils/time-profiler.js +48 -0
- package/lib/owlly/view/camera-view.d.ts +35 -0
- package/lib/owlly/view/camera-view.js +101 -0
- package/lib/owlly/view/index.d.ts +3 -0
- package/lib/owlly/view/index.js +5 -0
- package/lib/owlly/view/orthographic-view.d.ts +40 -0
- package/lib/owlly/view/orthographic-view.js +94 -0
- package/lib/owlly/view/perspective-view.d.ts +40 -0
- package/lib/owlly/view/perspective-view.js +95 -0
- package/lib/owlly/view/svg-map-view.d.ts +46 -0
- package/lib/owlly/view/svg-map-view.js +144 -0
- package/lib/owlly/view/view.d.ts +146 -0
- package/lib/owlly/view/view.js +317 -0
- package/lib/prod/owlly.esm.js +93462 -0
- package/lib/prod/owlly.esm.js.map +1 -0
- package/lib/prod/owlly.esm.min.js +54 -0
- package/lib/prod/owlly.iife.js +93560 -0
- package/lib/prod/owlly.iife.js.map +1 -0
- package/lib/prod/owlly.iife.min.js +69 -0
- package/lib/prod/owlly.miniapp.js +73845 -0
- package/lib/prod/owlly.miniapp.js.map +1 -0
- package/lib/prod/owlly.miniapp.min.js +63 -0
- package/lib/prod/src/external/lines/line-geometry.d.ts +9 -0
- package/lib/prod/src/external/lines/line-material.d.ts +10 -0
- package/lib/prod/src/external/lines/line-segments-2.d.ts +7 -0
- package/lib/prod/src/external/lines/line-segments-geometry.d.ts +15 -0
- package/lib/prod/src/external/loaders/gltf-loader.d.ts +77 -0
- package/lib/prod/src/external/orbit-controls.d.ts +44 -0
- package/lib/prod/src/external/renderers/css-2d-renderer.d.ts +16 -0
- package/lib/prod/src/external/renderers/css-3d-renderer.d.ts +18 -0
- package/lib/prod/src/external/transform-controls.d.ts +106 -0
- package/lib/prod/src/external/util/buffer-geometry-utils.d.ts +45 -0
- package/lib/prod/src/owlly/controller/aerial-element-controller.d.ts +65 -0
- package/lib/prod/src/owlly/controller/basic-controller.d.ts +324 -0
- package/lib/prod/src/owlly/controller/camera-controller.d.ts +37 -0
- package/lib/prod/src/owlly/controller/controller.d.ts +61 -0
- package/lib/prod/src/owlly/controller/index.d.ts +2 -0
- package/lib/prod/src/owlly/controller/mouse-indicator-controller.d.ts +34 -0
- package/lib/prod/src/owlly/controller/orbit-control.d.ts +147 -0
- package/lib/prod/src/owlly/controller/panorama-adjust-controller.d.ts +45 -0
- package/lib/prod/src/owlly/controller/panorama-controller.d.ts +441 -0
- package/lib/prod/src/owlly/controller/panorama-transform-controller.d.ts +66 -0
- package/lib/prod/src/owlly/controller/plane-controller.d.ts +43 -0
- package/lib/prod/src/owlly/controller/texture-controller.d.ts +183 -0
- package/lib/prod/src/owlly/controller/tile-panorama-controller.d.ts +308 -0
- package/lib/prod/src/owlly/controller/transform-controller.d.ts +106 -0
- package/lib/prod/src/owlly/element/bottom-nav-element.d.ts +65 -0
- package/lib/prod/src/owlly/element/camera.d.ts +82 -0
- package/lib/prod/src/owlly/element/dom-2d-element.d.ts +35 -0
- package/lib/prod/src/owlly/element/dom-3d-element.d.ts +27 -0
- package/lib/prod/src/owlly/element/dom-label-2d.d.ts +116 -0
- package/lib/prod/src/owlly/element/element.d.ts +53 -0
- package/lib/prod/src/owlly/element/floor-model.d.ts +83 -0
- package/lib/prod/src/owlly/element/gif-kit/Gif.d.ts +96 -0
- package/lib/prod/src/owlly/element/gif-kit/GifColor.d.ts +21 -0
- package/lib/prod/src/owlly/element/gif-kit/GifCompressedCodesToByteArrayConverter.d.ts +20 -0
- package/lib/prod/src/owlly/element/gif-kit/GifFrame.d.ts +31 -0
- package/lib/prod/src/owlly/element/gif-kit/GifImage.d.ts +23 -0
- package/lib/prod/src/owlly/element/gif-kit/GifParser.d.ts +17 -0
- package/lib/prod/src/owlly/element/gif-kit/GifPresenter.d.ts +20 -0
- package/lib/prod/src/owlly/element/gif-kit/GifVersion.d.ts +10 -0
- package/lib/prod/src/owlly/element/gltf-mesh-element.d.ts +31 -0
- package/lib/prod/src/owlly/element/index.d.ts +6 -0
- package/lib/prod/src/owlly/element/map-kit/area.d.ts +24 -0
- package/lib/prod/src/owlly/element/map-kit/block-set.d.ts +39 -0
- package/lib/prod/src/owlly/element/map-kit/block.d.ts +77 -0
- package/lib/prod/src/owlly/element/map-kit/index.d.ts +3 -0
- package/lib/prod/src/owlly/element/map-kit/shape.d.ts +131 -0
- package/lib/prod/src/owlly/element/mesh-element.d.ts +22 -0
- package/lib/prod/src/owlly/element/mesh-line-2d.d.ts +82 -0
- package/lib/prod/src/owlly/element/meshline-o.d.ts +64 -0
- package/lib/prod/src/owlly/element/panorama-group.d.ts +241 -0
- package/lib/prod/src/owlly/element/panorama.d.ts +132 -0
- package/lib/prod/src/owlly/element/path-group.d.ts +69 -0
- package/lib/prod/src/owlly/element/path.d.ts +99 -0
- package/lib/prod/src/owlly/element/placeable-2d.d.ts +158 -0
- package/lib/prod/src/owlly/element/polygon-mesh.d.ts +107 -0
- package/lib/prod/src/owlly/element/ring-element.d.ts +79 -0
- package/lib/prod/src/owlly/element/sphere-mesh.d.ts +28 -0
- package/lib/prod/src/owlly/element/svg-floor-model.d.ts +22 -0
- package/lib/prod/src/owlly/element/svg-floors.d.ts +27 -0
- package/lib/prod/src/owlly/element/tile-panorama-group.d.ts +335 -0
- package/lib/prod/src/owlly/element/tile-panorama.d.ts +162 -0
- package/lib/prod/src/owlly/element/tile-plane.d.ts +114 -0
- package/lib/prod/src/owlly/element/video-element.d.ts +33 -0
- package/lib/prod/src/owlly/geometries/ExtrudeGeometry2.d.ts +15 -0
- package/lib/prod/src/owlly/index.d.ts +13 -0
- package/lib/prod/src/owlly/overlay/canvas-overlay.d.ts +96 -0
- package/lib/prod/src/owlly/overlay/css-2d-overlay.d.ts +14 -0
- package/lib/prod/src/owlly/overlay/css-3d-overlay.d.ts +16 -0
- package/lib/prod/src/owlly/overlay/index.d.ts +5 -0
- package/lib/prod/src/owlly/overlay/label-overlay.d.ts +62 -0
- package/lib/prod/src/owlly/overlay/overlay.d.ts +14 -0
- package/lib/prod/src/owlly/overlay/path-overlay.d.ts +39 -0
- package/lib/prod/src/owlly/overlay/path-overlay2.d.ts +35 -0
- package/lib/prod/src/owlly/overlay/poi-overlay-3d.d.ts +278 -0
- package/lib/prod/src/owlly/overlay/poi-overlay.d.ts +277 -0
- package/lib/prod/src/owlly/owlly-2d/index.d.ts +28 -0
- package/lib/prod/src/owlly/screen/index.d.ts +1 -0
- package/lib/prod/src/owlly/screen/screen.d.ts +73 -0
- package/lib/prod/src/owlly/stage/__test__/stage.spec.d.ts +1 -0
- package/lib/prod/src/owlly/stage/externals.d.ts +19 -0
- package/lib/prod/src/owlly/stage/index.d.ts +3 -0
- package/lib/prod/src/owlly/stage/owlly.d.ts +38 -0
- package/lib/prod/src/owlly/stage/stage.d.ts +108 -0
- package/lib/prod/src/owlly/utils/alignment-utils.d.ts +20 -0
- package/lib/prod/src/owlly/utils/basic-calc.d.ts +18 -0
- package/lib/prod/src/owlly/utils/basic-tools.d.ts +71 -0
- package/lib/prod/src/owlly/utils/bvh-tree.d.ts +105 -0
- package/lib/prod/src/owlly/utils/camera.d.ts +37 -0
- package/lib/prod/src/owlly/utils/cube-texture-cache.d.ts +25 -0
- package/lib/prod/src/owlly/utils/device-utils.d.ts +18 -0
- package/lib/prod/src/owlly/utils/environment-utils.d.ts +37 -0
- package/lib/prod/src/owlly/utils/event-hub.d.ts +50 -0
- package/lib/prod/src/owlly/utils/events.d.ts +219 -0
- package/lib/prod/src/owlly/utils/geometry-utils.d.ts +119 -0
- package/lib/prod/src/owlly/utils/helper.d.ts +6 -0
- package/lib/prod/src/owlly/utils/index.d.ts +13 -0
- package/lib/prod/src/owlly/utils/lru-cache.d.ts +26 -0
- package/lib/prod/src/owlly/utils/map-utils.d.ts +7 -0
- package/lib/prod/src/owlly/utils/number-utils.d.ts +8 -0
- package/lib/prod/src/owlly/utils/panorama-model-util.d.ts +46 -0
- package/lib/prod/src/owlly/utils/path-utils.d.ts +80 -0
- package/lib/prod/src/owlly/utils/svgutils.d.ts +138 -0
- package/lib/prod/src/owlly/utils/texture-cache.d.ts +29 -0
- package/lib/prod/src/owlly/utils/tile-util.d.ts +187 -0
- package/lib/prod/src/owlly/utils/time-profiler.d.ts +21 -0
- package/lib/prod/src/owlly/view/__test__/perspective-view.spec.d.ts +0 -0
- package/lib/prod/src/owlly/view/camera-view.d.ts +35 -0
- package/lib/prod/src/owlly/view/index.d.ts +3 -0
- package/lib/prod/src/owlly/view/orthographic-view.d.ts +40 -0
- package/lib/prod/src/owlly/view/perspective-view.d.ts +40 -0
- package/lib/prod/src/owlly/view/svg-map-view.d.ts +46 -0
- package/lib/prod/src/owlly/view/view.d.ts +146 -0
- package/lib/src/owlly/controller/texture-controller.d.ts +3 -1
- package/lib/src/owlly/controller/texture-controller.js +16 -1
- package/lib/src/owlly/controller/texture-controller.js.map +1 -1
- package/lib/src/owlly/controller/tile-panorama-controller.js +4 -0
- package/lib/src/owlly/controller/tile-panorama-controller.js.map +1 -1
- package/lib/src/owlly/element/tile-panorama.d.ts +1 -0
- package/lib/src/owlly/element/tile-panorama.js +16 -3
- package/lib/src/owlly/element/tile-panorama.js.map +1 -1
- package/lib/src/owlly/element/tile-plane.d.ts +9 -0
- package/lib/src/owlly/element/tile-plane.js +27 -0
- package/lib/src/owlly/element/tile-plane.js.map +1 -1
- package/lib/src/owlly/overlay/poi-overlay-3d.js.map +1 -1
- package/lib/src/owlly/overlay/poi-overlay.js.map +1 -1
- package/lib/src/owlly/stage/owlly.js +7 -1
- package/lib/src/owlly/stage/owlly.js.map +1 -1
- package/lib/src/owlly/stage/stage.js +2 -0
- package/lib/src/owlly/stage/stage.js.map +1 -1
- package/lib/src/web/main.rpeng.mes.plane.js.map +1 -1
- package/package.json +16 -7
- package/src/owlly/controller/texture-controller.ts +18 -1
- package/src/owlly/controller/tile-panorama-controller.ts +3 -1
- package/src/owlly/element/tile-panorama.ts +14 -0
- package/src/owlly/element/tile-plane.ts +26 -0
- package/src/owlly/overlay/poi-overlay-3d.ts +0 -4
- package/src/owlly/overlay/poi-overlay.ts +0 -4
- package/src/owlly/stage/owlly.ts +6 -1
- package/src/owlly/stage/stage.ts +2 -0
- package/src/web/main.rpeng.mes.plane.ts +0 -6
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/*!
|
|
3
|
+
gifken
|
|
4
|
+
Copyright (c) 2013 aaharu
|
|
5
|
+
This software is released under the MIT License.
|
|
6
|
+
https://raw.github.com/aaharu/gifken/master/LICENSE
|
|
7
|
+
|
|
8
|
+
This product includes following software:
|
|
9
|
+
* GifWriter.js
|
|
10
|
+
- Copyright (c) 2013 NOBUOKA Yu
|
|
11
|
+
- https://github.com/nobuoka/GifWriter.js
|
|
12
|
+
- https://raw.github.com/nobuoka/GifWriter.js/master/LICENSE.txt
|
|
13
|
+
*/
|
|
14
|
+
import { GifColor } from './GifColor';
|
|
15
|
+
import { GifParser } from './GifParser';
|
|
16
|
+
import { GifVersion } from './GifVersion';
|
|
17
|
+
import { GifCompressedCodesToByteArrayConverter } from './GifCompressedCodesToByteArrayConverter';
|
|
18
|
+
export class Gif {
|
|
19
|
+
/**
|
|
20
|
+
* Gif
|
|
21
|
+
*/
|
|
22
|
+
constructor(skipDefault) {
|
|
23
|
+
this.frameIndex1 = 0;
|
|
24
|
+
this.frameIndex2 = 0;
|
|
25
|
+
this.frames = [];
|
|
26
|
+
if (skipDefault) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
// default values
|
|
30
|
+
this._version = GifVersion.GIF89a;
|
|
31
|
+
this._width = 1;
|
|
32
|
+
this._height = 1;
|
|
33
|
+
this.colorResolution = 112; // not supported
|
|
34
|
+
this.sortFlag = false; // not supported
|
|
35
|
+
this.bgColorIndex = 1; // ?
|
|
36
|
+
this.pixelAspectRatio = 0; // not supported
|
|
37
|
+
this.globalColorTable = GifColor.createColorTable([
|
|
38
|
+
new GifColor(0, 0, 0),
|
|
39
|
+
new GifColor(255, 255, 255),
|
|
40
|
+
]);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Parse Gif image from ArrayBuffer.
|
|
44
|
+
*
|
|
45
|
+
* @return {Gif} parsed gif object
|
|
46
|
+
*/
|
|
47
|
+
static parse(buffer) {
|
|
48
|
+
const gif = new Gif(true);
|
|
49
|
+
const data = new DataView(buffer);
|
|
50
|
+
let offset = GifParser.readHeader(gif, data);
|
|
51
|
+
while (true) {
|
|
52
|
+
offset = GifParser.readBlock(gif, data, offset);
|
|
53
|
+
if (offset === -1) {
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return gif;
|
|
58
|
+
}
|
|
59
|
+
versionName() {
|
|
60
|
+
return GifVersion[this._version];
|
|
61
|
+
}
|
|
62
|
+
get version() {
|
|
63
|
+
return this._version;
|
|
64
|
+
}
|
|
65
|
+
set version(v) {
|
|
66
|
+
this._version = v;
|
|
67
|
+
}
|
|
68
|
+
get width() {
|
|
69
|
+
return this._width;
|
|
70
|
+
}
|
|
71
|
+
set width(width) {
|
|
72
|
+
width = ~~width;
|
|
73
|
+
if (width > 0xffff || width < 0) {
|
|
74
|
+
throw new RangeError('width range error: ' + width);
|
|
75
|
+
}
|
|
76
|
+
this._width = width;
|
|
77
|
+
}
|
|
78
|
+
get height() {
|
|
79
|
+
return this._height;
|
|
80
|
+
}
|
|
81
|
+
set height(height) {
|
|
82
|
+
height = ~~height;
|
|
83
|
+
if (height > 0xffff || height < 0) {
|
|
84
|
+
throw new RangeError('height range error: ' + height);
|
|
85
|
+
}
|
|
86
|
+
this._height = height;
|
|
87
|
+
}
|
|
88
|
+
get globalColorTable() {
|
|
89
|
+
return this._globalColorTable;
|
|
90
|
+
}
|
|
91
|
+
set globalColorTable(bytes) {
|
|
92
|
+
this._globalColorTable = bytes;
|
|
93
|
+
this._globalTableSize = bytes.byteLength / 3;
|
|
94
|
+
if (this.bgColorIndex === undefined) {
|
|
95
|
+
this.bgColorIndex = this._globalTableSize - 1;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
get globalTableSize() {
|
|
99
|
+
return this._globalTableSize;
|
|
100
|
+
}
|
|
101
|
+
get loopCount() {
|
|
102
|
+
return this._loopCount;
|
|
103
|
+
}
|
|
104
|
+
set loopCount(loopCount) {
|
|
105
|
+
loopCount = ~~loopCount;
|
|
106
|
+
if (loopCount > 0xffff || loopCount < 0) {
|
|
107
|
+
throw new RangeError('loopCount range error: ' + loopCount);
|
|
108
|
+
}
|
|
109
|
+
this._loopCount = loopCount;
|
|
110
|
+
}
|
|
111
|
+
writeToArrayBuffer() {
|
|
112
|
+
return Gif.writeToArrayBuffer(this);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Convert Gif to Uint8Array[].
|
|
116
|
+
*
|
|
117
|
+
* @return {Uint8Array[]} array of Uint8Array
|
|
118
|
+
*/
|
|
119
|
+
static writeToArrayBuffer(gif) {
|
|
120
|
+
const output = [];
|
|
121
|
+
// write header
|
|
122
|
+
const header = new DataView(new ArrayBuffer(13));
|
|
123
|
+
header.setUint8(0, 71); // G
|
|
124
|
+
header.setUint8(1, 73); // I
|
|
125
|
+
header.setUint8(2, 70); // F
|
|
126
|
+
header.setUint8(3, 56); // 8
|
|
127
|
+
if (gif.version === GifVersion.GIF89a) {
|
|
128
|
+
header.setUint8(4, 57); // 9
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
header.setUint8(4, 55); // 7
|
|
132
|
+
}
|
|
133
|
+
header.setUint8(5, 97); // a
|
|
134
|
+
header.setUint16(6, gif.width, true);
|
|
135
|
+
header.setUint16(8, gif.height, true);
|
|
136
|
+
let packed = 0;
|
|
137
|
+
let size = gif.globalTableSize;
|
|
138
|
+
if (size > 0) {
|
|
139
|
+
packed |= 128;
|
|
140
|
+
let count = 0;
|
|
141
|
+
do {
|
|
142
|
+
size = size >> 1;
|
|
143
|
+
++count;
|
|
144
|
+
} while (size > 1);
|
|
145
|
+
packed |= count - 1;
|
|
146
|
+
}
|
|
147
|
+
packed |= gif.colorResolution; // not supported
|
|
148
|
+
if (gif.sortFlag) {
|
|
149
|
+
// not supported
|
|
150
|
+
packed |= 8;
|
|
151
|
+
}
|
|
152
|
+
header.setUint8(10, packed);
|
|
153
|
+
header.setUint8(11, gif.bgColorIndex);
|
|
154
|
+
header.setUint8(12, gif.pixelAspectRatio); // not supported
|
|
155
|
+
output.push(new Uint8Array(header.buffer));
|
|
156
|
+
if (gif.globalTableSize > 0) {
|
|
157
|
+
output.push(gif.globalColorTable);
|
|
158
|
+
}
|
|
159
|
+
// write extension
|
|
160
|
+
if (gif.isLoop) {
|
|
161
|
+
const appExt = new DataView(new ArrayBuffer(19));
|
|
162
|
+
appExt.setUint8(0, 0x21);
|
|
163
|
+
appExt.setUint8(1, 0xff);
|
|
164
|
+
appExt.setUint8(2, 0x0b);
|
|
165
|
+
appExt.setUint8(3, 0x4e); // N
|
|
166
|
+
appExt.setUint8(4, 0x45); // E
|
|
167
|
+
appExt.setUint8(5, 0x54); // T
|
|
168
|
+
appExt.setUint8(6, 0x53); // S
|
|
169
|
+
appExt.setUint8(7, 0x43); // C
|
|
170
|
+
appExt.setUint8(8, 0x41); // A
|
|
171
|
+
appExt.setUint8(9, 0x50); // P
|
|
172
|
+
appExt.setUint8(10, 0x45); // E
|
|
173
|
+
appExt.setUint8(11, 0x32); // 2
|
|
174
|
+
appExt.setUint8(12, 0x2e); // .
|
|
175
|
+
appExt.setUint8(13, 0x30); // 0
|
|
176
|
+
appExt.setUint8(14, 3);
|
|
177
|
+
appExt.setUint8(15, 1);
|
|
178
|
+
appExt.setUint16(16, gif.loopCount, true);
|
|
179
|
+
appExt.setUint8(18, 0);
|
|
180
|
+
output.push(new Uint8Array(appExt.buffer));
|
|
181
|
+
}
|
|
182
|
+
// write image data
|
|
183
|
+
gif.frames.forEach((frame) => {
|
|
184
|
+
const image = new DataView(new ArrayBuffer(18));
|
|
185
|
+
image.setUint8(0, 0x21);
|
|
186
|
+
image.setUint8(1, 0xf9);
|
|
187
|
+
image.setUint8(2, 0x04);
|
|
188
|
+
if (frame.transparentFlag) {
|
|
189
|
+
image.setUint8(3, 1);
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
image.setUint8(3, 0);
|
|
193
|
+
}
|
|
194
|
+
image.setUint16(4, frame.delayCentiSeconds, true);
|
|
195
|
+
image.setUint8(6, frame.transparentColorIndex);
|
|
196
|
+
image.setUint8(7, 0);
|
|
197
|
+
image.setUint8(8, 0x2c);
|
|
198
|
+
image.setUint16(9, frame.x, true);
|
|
199
|
+
image.setUint16(11, frame.y, true);
|
|
200
|
+
image.setUint16(13, frame.width, true);
|
|
201
|
+
image.setUint16(15, frame.height, true);
|
|
202
|
+
if (frame.localTableSize > 0) {
|
|
203
|
+
let count = 0;
|
|
204
|
+
let size = frame.localTableSize;
|
|
205
|
+
do {
|
|
206
|
+
size = size >> 1;
|
|
207
|
+
++count;
|
|
208
|
+
} while (size > 1);
|
|
209
|
+
image.setUint8(17, 128 | (count - 1));
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
image.setUint8(17, 0);
|
|
213
|
+
}
|
|
214
|
+
output.push(new Uint8Array(image.buffer));
|
|
215
|
+
if (frame.localTableSize > 0) {
|
|
216
|
+
output.push(frame.localColorTable);
|
|
217
|
+
}
|
|
218
|
+
output.push(new Uint8Array([frame.lzwCode]));
|
|
219
|
+
if (frame.compressedData === undefined && frame.pixelData === undefined) {
|
|
220
|
+
throw new Error('no image data');
|
|
221
|
+
}
|
|
222
|
+
let idx = 0, compressedBytes = frame.compressedData;
|
|
223
|
+
if (compressedBytes instanceof Array) {
|
|
224
|
+
compressedBytes = new Uint8Array(compressedBytes);
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
compressedBytes =
|
|
228
|
+
compressedBytes ||
|
|
229
|
+
new Uint8Array(Gif.compressWithLZW(frame.pixelData, frame.lzwCode));
|
|
230
|
+
}
|
|
231
|
+
const l = compressedBytes.length;
|
|
232
|
+
while (true) {
|
|
233
|
+
if (l > idx + 255) {
|
|
234
|
+
output.push(new Uint8Array([255]));
|
|
235
|
+
output.push(compressedBytes.subarray(idx, idx + 255));
|
|
236
|
+
idx += 255;
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
const bytes = compressedBytes.subarray(idx);
|
|
240
|
+
output.push(new Uint8Array([bytes.byteLength]));
|
|
241
|
+
output.push(bytes);
|
|
242
|
+
break;
|
|
243
|
+
}
|
|
244
|
+
output.push(new Uint8Array([0]));
|
|
245
|
+
});
|
|
246
|
+
output.push(new Uint8Array([0x3b])); // trailer
|
|
247
|
+
return output;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* TODO
|
|
251
|
+
**/
|
|
252
|
+
writeToArray() {
|
|
253
|
+
const output = Gif.writeToArrayBuffer(this);
|
|
254
|
+
const arr = [];
|
|
255
|
+
output.forEach((buffer) => {
|
|
256
|
+
for (let i = 0, l = buffer.byteLength; i < l; ++i) {
|
|
257
|
+
arr.push(buffer[i]);
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
return arr;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Split the animated GIF image.
|
|
264
|
+
*
|
|
265
|
+
* @return {Gif[]} array of Gif object
|
|
266
|
+
*/
|
|
267
|
+
split(overwrite) {
|
|
268
|
+
const res = [];
|
|
269
|
+
if (overwrite) {
|
|
270
|
+
this.frames.forEach((frame, index) => {
|
|
271
|
+
const gif = new Gif();
|
|
272
|
+
gif.version = this._version;
|
|
273
|
+
gif.width = this._width;
|
|
274
|
+
gif.height = this._height;
|
|
275
|
+
gif.colorResolution = this.colorResolution; // not supported
|
|
276
|
+
gif.sortFlag = this.sortFlag; // not supported
|
|
277
|
+
gif.bgColorIndex = this.bgColorIndex;
|
|
278
|
+
gif.pixelAspectRatio = this.pixelAspectRatio; // not supported
|
|
279
|
+
gif.globalColorTable = this._globalColorTable;
|
|
280
|
+
// if (index !== 0 && frame.transparentFlag) {
|
|
281
|
+
// frame.decompress();
|
|
282
|
+
// }
|
|
283
|
+
// if (index !== 0 && frame.transparentFlag) {
|
|
284
|
+
// if (frame.pixelData === undefined) {
|
|
285
|
+
// frame.decompress();
|
|
286
|
+
// }
|
|
287
|
+
// if (this.frames[index - 1].pixelData === undefined) {
|
|
288
|
+
// this.frames[index - 1].decompress();
|
|
289
|
+
// }
|
|
290
|
+
// let edited = false;
|
|
291
|
+
// for (let i = 0, l = frame.pixelData.length; i < l; ++i) {
|
|
292
|
+
// if (frame.pixelData[i] === frame.transparentColorIndex) {
|
|
293
|
+
// frame.pixelData[i] = this.frames[index - 1].pixelData[i];
|
|
294
|
+
// edited = true;
|
|
295
|
+
// }
|
|
296
|
+
// }
|
|
297
|
+
// if (edited) {
|
|
298
|
+
// const compressedBytes = Gif.compressWithLZW(
|
|
299
|
+
// frame.pixelData,
|
|
300
|
+
// frame.lzwCode
|
|
301
|
+
// );
|
|
302
|
+
// frame.compressedData = new Uint8Array(compressedBytes);
|
|
303
|
+
// }
|
|
304
|
+
// delete frame.pixelData;
|
|
305
|
+
// }
|
|
306
|
+
gif.frames = [frame];
|
|
307
|
+
res.push(gif);
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
this.frames.forEach((frame) => {
|
|
312
|
+
const gif = new Gif();
|
|
313
|
+
gif.version = this._version;
|
|
314
|
+
gif.width = this._width;
|
|
315
|
+
gif.height = this._height;
|
|
316
|
+
gif.colorResolution = this.colorResolution; // not supported
|
|
317
|
+
gif.sortFlag = this.sortFlag; // not supported
|
|
318
|
+
gif.bgColorIndex = this.bgColorIndex;
|
|
319
|
+
gif.pixelAspectRatio = this.pixelAspectRatio; // not supported
|
|
320
|
+
gif.globalColorTable = this._globalColorTable;
|
|
321
|
+
gif.frames = [frame];
|
|
322
|
+
res.push(gif);
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
return res;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Playback the animated GIF image.
|
|
329
|
+
*
|
|
330
|
+
* @return {Gif} Gif object
|
|
331
|
+
*/
|
|
332
|
+
playback(overwrite) {
|
|
333
|
+
const res = new Gif();
|
|
334
|
+
if (overwrite) {
|
|
335
|
+
this.frames.forEach((frame, index) => {
|
|
336
|
+
if (index !== 0 && frame.transparentFlag) {
|
|
337
|
+
if (frame.pixelData === undefined) {
|
|
338
|
+
frame.decompress();
|
|
339
|
+
}
|
|
340
|
+
if (this.frames[index - 1].pixelData === undefined) {
|
|
341
|
+
this.frames[index - 1].decompress();
|
|
342
|
+
}
|
|
343
|
+
let edited = false;
|
|
344
|
+
for (let i = 0, l = frame.pixelData.length; i < l; ++i) {
|
|
345
|
+
if (frame.pixelData[i] === frame.transparentColorIndex) {
|
|
346
|
+
frame.pixelData[i] = this.frames[index - 1].pixelData[i];
|
|
347
|
+
edited = true;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
if (edited) {
|
|
351
|
+
const compressedBytes = Gif.compressWithLZW(frame.pixelData, frame.lzwCode);
|
|
352
|
+
frame.compressedData = new Uint8Array(compressedBytes);
|
|
353
|
+
}
|
|
354
|
+
delete frame.pixelData;
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
res.version = this._version;
|
|
359
|
+
res.width = this._width;
|
|
360
|
+
res.height = this._height;
|
|
361
|
+
res.colorResolution = this.colorResolution; // not supported
|
|
362
|
+
res.sortFlag = this.sortFlag; // not supported
|
|
363
|
+
res.bgColorIndex = this.bgColorIndex;
|
|
364
|
+
res.pixelAspectRatio = this.pixelAspectRatio; // not supported
|
|
365
|
+
res.globalColorTable = this._globalColorTable;
|
|
366
|
+
res.frames = this.frames.reverse();
|
|
367
|
+
res.isLoop = this.isLoop;
|
|
368
|
+
res.loopCount = this._loopCount;
|
|
369
|
+
return res;
|
|
370
|
+
}
|
|
371
|
+
/*
|
|
372
|
+
===begin GifWriter.js===
|
|
373
|
+
*/
|
|
374
|
+
static compressWithLZW(actualCodes, numBits) {
|
|
375
|
+
// `numBits` is LZW-initial code size, which indicates how many bits are needed
|
|
376
|
+
// to represents actual code.
|
|
377
|
+
const bb = new GifCompressedCodesToByteArrayConverter();
|
|
378
|
+
// GIF spec says: A special Clear code is defined which resets all
|
|
379
|
+
// compression/decompression parameters and tables to a start-up state.
|
|
380
|
+
// The value of this code is 2**<code size>. For example if the code size
|
|
381
|
+
// indicated was 4 (image was 4 bits/pixel) the Clear code value would be 16
|
|
382
|
+
// (10000 binary). The Clear code can appear at any point in the image data
|
|
383
|
+
// stream and therefore requires the LZW algorithm to process succeeding
|
|
384
|
+
// codes as if a new data stream was starting. Encoders should
|
|
385
|
+
// output a Clear code as the first code of each image data stream.
|
|
386
|
+
const clearCode = 1 << numBits;
|
|
387
|
+
// GIF spec says: An End of Information code is defined that explicitly
|
|
388
|
+
// indicates the end of the image data stream. LZW processing terminates
|
|
389
|
+
// when this code is encountered. It must be the last code output by the
|
|
390
|
+
// encoder for an image. The value of this code is <Clear code>+1.
|
|
391
|
+
const endOfInfoCode = clearCode + 1;
|
|
392
|
+
let nextCode = endOfInfoCode + 1;
|
|
393
|
+
let curNumCodeBits = numBits + 1;
|
|
394
|
+
let dict = Object.create(null);
|
|
395
|
+
function resetAllParamsAndTablesToStartUpState() {
|
|
396
|
+
// GIF spec says: The first available compression code value is <Clear code>+2.
|
|
397
|
+
nextCode = endOfInfoCode + 1;
|
|
398
|
+
curNumCodeBits = numBits + 1;
|
|
399
|
+
dict = Object.create(null);
|
|
400
|
+
}
|
|
401
|
+
resetAllParamsAndTablesToStartUpState();
|
|
402
|
+
bb.push(clearCode, curNumCodeBits); // clear code at first
|
|
403
|
+
let concatedCodesKey = '';
|
|
404
|
+
for (let i = 0, len = actualCodes.length; i < len; ++i) {
|
|
405
|
+
const code = actualCodes[i];
|
|
406
|
+
const dictKey = String.fromCharCode(code);
|
|
407
|
+
if (!(dictKey in dict))
|
|
408
|
+
dict[dictKey] = code;
|
|
409
|
+
const oldKey = concatedCodesKey;
|
|
410
|
+
concatedCodesKey += dictKey;
|
|
411
|
+
if (!(concatedCodesKey in dict)) {
|
|
412
|
+
bb.push(dict[oldKey], curNumCodeBits);
|
|
413
|
+
// GIF spec defines a maximum code value of 4095 (0xFFF)
|
|
414
|
+
if (nextCode <= 0xfff) {
|
|
415
|
+
dict[concatedCodesKey] = nextCode;
|
|
416
|
+
if (nextCode === 1 << curNumCodeBits)
|
|
417
|
+
curNumCodeBits++;
|
|
418
|
+
nextCode++;
|
|
419
|
+
}
|
|
420
|
+
else {
|
|
421
|
+
bb.push(clearCode, curNumCodeBits);
|
|
422
|
+
resetAllParamsAndTablesToStartUpState();
|
|
423
|
+
dict[dictKey] = code;
|
|
424
|
+
}
|
|
425
|
+
concatedCodesKey = dictKey;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
bb.push(dict[concatedCodesKey], curNumCodeBits);
|
|
429
|
+
bb.push(endOfInfoCode, curNumCodeBits);
|
|
430
|
+
return bb.flush();
|
|
431
|
+
}
|
|
432
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
gifken
|
|
3
|
+
Copyright (c) 2013 aaharu
|
|
4
|
+
This software is released under the MIT License.
|
|
5
|
+
https://raw.github.com/aaharu/gifken/master/LICENSE
|
|
6
|
+
*/
|
|
7
|
+
export declare class GifColor {
|
|
8
|
+
r: number;
|
|
9
|
+
g: number;
|
|
10
|
+
b: number;
|
|
11
|
+
/**
|
|
12
|
+
* GifColor
|
|
13
|
+
*/
|
|
14
|
+
constructor(r: number, g: number, b: number);
|
|
15
|
+
/**
|
|
16
|
+
* TODO:
|
|
17
|
+
static valueOf(color:string) {
|
|
18
|
+
}
|
|
19
|
+
*/
|
|
20
|
+
static createColorTable(colors: GifColor[]): Uint8Array;
|
|
21
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/*!
|
|
3
|
+
gifken
|
|
4
|
+
Copyright (c) 2013 aaharu
|
|
5
|
+
This software is released under the MIT License.
|
|
6
|
+
https://raw.github.com/aaharu/gifken/master/LICENSE
|
|
7
|
+
*/
|
|
8
|
+
export class GifColor {
|
|
9
|
+
/**
|
|
10
|
+
* GifColor
|
|
11
|
+
*/
|
|
12
|
+
constructor(r, g, b) {
|
|
13
|
+
this.r = r;
|
|
14
|
+
this.g = g;
|
|
15
|
+
this.b = b;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* TODO:
|
|
19
|
+
static valueOf(color:string) {
|
|
20
|
+
}
|
|
21
|
+
*/
|
|
22
|
+
static createColorTable(colors) {
|
|
23
|
+
const numbers = [];
|
|
24
|
+
for (let i = 1; i <= 8; ++i) {
|
|
25
|
+
const d = (i << 1) - colors.length;
|
|
26
|
+
for (let j = 0; j < d; ++j) {
|
|
27
|
+
colors.push(new GifColor(255, 255, 255));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
colors.forEach((color) => {
|
|
31
|
+
numbers.push(color.r);
|
|
32
|
+
numbers.push(color.g);
|
|
33
|
+
numbers.push(color.b);
|
|
34
|
+
});
|
|
35
|
+
return new Uint8Array(numbers);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
gifken
|
|
3
|
+
Copyright (c) 2013 aaharu
|
|
4
|
+
This software is released under the MIT License.
|
|
5
|
+
https://raw.github.com/aaharu/gifken/master/LICENSE
|
|
6
|
+
|
|
7
|
+
This product includes following software:
|
|
8
|
+
* GifWriter.js
|
|
9
|
+
- Copyright (c) 2013 NOBUOKA Yu
|
|
10
|
+
- https://github.com/nobuoka/GifWriter.js
|
|
11
|
+
- https://raw.github.com/nobuoka/GifWriter.js/master/LICENSE.txt
|
|
12
|
+
*/
|
|
13
|
+
export declare class GifCompressedCodesToByteArrayConverter {
|
|
14
|
+
private __out;
|
|
15
|
+
private __remNumBits;
|
|
16
|
+
private __remVal;
|
|
17
|
+
constructor();
|
|
18
|
+
push(code: number, numBits: number): void;
|
|
19
|
+
flush(): number[];
|
|
20
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/*!
|
|
3
|
+
gifken
|
|
4
|
+
Copyright (c) 2013 aaharu
|
|
5
|
+
This software is released under the MIT License.
|
|
6
|
+
https://raw.github.com/aaharu/gifken/master/LICENSE
|
|
7
|
+
|
|
8
|
+
This product includes following software:
|
|
9
|
+
* GifWriter.js
|
|
10
|
+
- Copyright (c) 2013 NOBUOKA Yu
|
|
11
|
+
- https://github.com/nobuoka/GifWriter.js
|
|
12
|
+
- https://raw.github.com/nobuoka/GifWriter.js/master/LICENSE.txt
|
|
13
|
+
*/
|
|
14
|
+
/*
|
|
15
|
+
===begin GifWriter.js===
|
|
16
|
+
*/
|
|
17
|
+
export class GifCompressedCodesToByteArrayConverter {
|
|
18
|
+
constructor() {
|
|
19
|
+
this.__out = [];
|
|
20
|
+
this.__remNumBits = 0;
|
|
21
|
+
this.__remVal = 0;
|
|
22
|
+
}
|
|
23
|
+
push(code, numBits) {
|
|
24
|
+
while (numBits > 0) {
|
|
25
|
+
this.__remVal = ((code << this.__remNumBits) & 0xff) + this.__remVal;
|
|
26
|
+
if (numBits + this.__remNumBits >= 8) {
|
|
27
|
+
this.__out.push(this.__remVal);
|
|
28
|
+
numBits = numBits - (8 - this.__remNumBits);
|
|
29
|
+
code = code >> (8 - this.__remNumBits);
|
|
30
|
+
this.__remVal = 0;
|
|
31
|
+
this.__remNumBits = 0;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
this.__remNumBits = numBits + this.__remNumBits;
|
|
35
|
+
numBits = 0;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
flush() {
|
|
40
|
+
this.push(0, 8);
|
|
41
|
+
this.__remNumBits = 0;
|
|
42
|
+
this.__remVal = 0;
|
|
43
|
+
const out = this.__out;
|
|
44
|
+
this.__out = [];
|
|
45
|
+
return out;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/*
|
|
49
|
+
===end GifWriter.js===
|
|
50
|
+
*/
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
gifken
|
|
3
|
+
Copyright (c) 2013 aaharu
|
|
4
|
+
This software is released under the MIT License.
|
|
5
|
+
https://raw.github.com/aaharu/gifken/master/LICENSE
|
|
6
|
+
|
|
7
|
+
This product includes following software:
|
|
8
|
+
* jsgif
|
|
9
|
+
- Copyright (c) 2011 Shachaf Ben-Kiki
|
|
10
|
+
- https://github.com/shachaf/jsgif
|
|
11
|
+
- https://raw.github.com/shachaf/jsgif/master/LICENSE
|
|
12
|
+
*/
|
|
13
|
+
export declare class GifFrame {
|
|
14
|
+
transparentFlag: boolean;
|
|
15
|
+
delayCentiSeconds: number;
|
|
16
|
+
transparentColorIndex: number;
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
localTableSize: number;
|
|
22
|
+
lzwCode: number;
|
|
23
|
+
localColorTable: Uint8Array;
|
|
24
|
+
compressedData: Uint8Array;
|
|
25
|
+
pixelData: Uint8Array;
|
|
26
|
+
orgpixelData: any;
|
|
27
|
+
pixels: Array<any>;
|
|
28
|
+
static init(width: number, height: number): GifFrame;
|
|
29
|
+
decompress(): void;
|
|
30
|
+
private lzwDecode;
|
|
31
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/*!
|
|
3
|
+
gifken
|
|
4
|
+
Copyright (c) 2013 aaharu
|
|
5
|
+
This software is released under the MIT License.
|
|
6
|
+
https://raw.github.com/aaharu/gifken/master/LICENSE
|
|
7
|
+
|
|
8
|
+
This product includes following software:
|
|
9
|
+
* jsgif
|
|
10
|
+
- Copyright (c) 2011 Shachaf Ben-Kiki
|
|
11
|
+
- https://github.com/shachaf/jsgif
|
|
12
|
+
- https://raw.github.com/shachaf/jsgif/master/LICENSE
|
|
13
|
+
*/
|
|
14
|
+
export class GifFrame {
|
|
15
|
+
static init(width, height) {
|
|
16
|
+
const frame = new GifFrame();
|
|
17
|
+
frame.transparentFlag = false;
|
|
18
|
+
frame.delayCentiSeconds = 0;
|
|
19
|
+
frame.transparentColorIndex = 0;
|
|
20
|
+
frame.x = 0;
|
|
21
|
+
frame.y = 0;
|
|
22
|
+
frame.width = width || 1;
|
|
23
|
+
frame.height = height || 1;
|
|
24
|
+
frame.localTableSize = 0;
|
|
25
|
+
frame.lzwCode = 4; // ?
|
|
26
|
+
frame.pixelData = new Uint8Array(frame.width * frame.height);
|
|
27
|
+
return frame;
|
|
28
|
+
}
|
|
29
|
+
decompress() {
|
|
30
|
+
// console.log('000000000000000',this.lzwCode,
|
|
31
|
+
// this.compressedData,
|
|
32
|
+
// this.width ,this.height);
|
|
33
|
+
// this.pixels = this.lzwDecode2(this.lzwCode,this.orgpixelData);
|
|
34
|
+
// console.log('this.pixels: ',this.width,this.height,this.pixels);
|
|
35
|
+
this.pixelData = this.lzwDecode(this.lzwCode, this.compressedData, this.width * this.height);
|
|
36
|
+
}
|
|
37
|
+
/*
|
|
38
|
+
===begin jsgif===
|
|
39
|
+
*/
|
|
40
|
+
lzwDecode(minCodeSize, data, len) {
|
|
41
|
+
let pos = 0; // Maybe this streaming thing should be merged with the Stream?
|
|
42
|
+
const readCode = function (size) {
|
|
43
|
+
let code = 0;
|
|
44
|
+
for (let i = 0; i < size; ++i) {
|
|
45
|
+
if (data[pos >> 3] & (1 << (pos & 7))) {
|
|
46
|
+
code |= 1 << i;
|
|
47
|
+
}
|
|
48
|
+
++pos;
|
|
49
|
+
}
|
|
50
|
+
return code;
|
|
51
|
+
};
|
|
52
|
+
const output = new Uint8Array(len);
|
|
53
|
+
const clearCode = 1 << minCodeSize;
|
|
54
|
+
const eoiCode = clearCode + 1;
|
|
55
|
+
let codeSize = minCodeSize + 1;
|
|
56
|
+
let dict = [];
|
|
57
|
+
const clear = () => {
|
|
58
|
+
dict = [];
|
|
59
|
+
codeSize = minCodeSize + 1;
|
|
60
|
+
for (let i = 0; i < clearCode; ++i) {
|
|
61
|
+
dict[i] = [i];
|
|
62
|
+
}
|
|
63
|
+
dict[clearCode] = [];
|
|
64
|
+
};
|
|
65
|
+
let code = 0;
|
|
66
|
+
let last;
|
|
67
|
+
let offset = 0;
|
|
68
|
+
while (true) {
|
|
69
|
+
last = code;
|
|
70
|
+
code = readCode(codeSize);
|
|
71
|
+
if (code === clearCode) {
|
|
72
|
+
clear();
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (code === eoiCode)
|
|
76
|
+
break;
|
|
77
|
+
if (code < dict.length) {
|
|
78
|
+
if (last !== clearCode) {
|
|
79
|
+
dict.push(dict[last].concat(dict[code][0]));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
if (code !== dict.length)
|
|
84
|
+
throw new Error("Invalid LZW code.");
|
|
85
|
+
dict.push(dict[last].concat(dict[last][0]));
|
|
86
|
+
}
|
|
87
|
+
output.set(dict[code], offset);
|
|
88
|
+
offset += dict[code].length;
|
|
89
|
+
if (dict.length === 1 << codeSize && codeSize < 12) {
|
|
90
|
+
// If we're at the last code and codeSize is 12, the next code will be a clearCode, and it'll be 12 bits long.
|
|
91
|
+
codeSize++;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return output;
|
|
95
|
+
}
|
|
96
|
+
}
|