Skip to content

Commit

Permalink
Committing the wasm package temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
weegeekps committed Jan 10, 2025
1 parent ce0976f commit 635659e
Show file tree
Hide file tree
Showing 7 changed files with 1,186 additions and 0 deletions.
84 changes: 84 additions & 0 deletions temp_wasm/pkg/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<div align="center">

<h1><code>wasm-pack-template</code></h1>

<strong>A template for kick starting a Rust and WebAssembly project using <a href="https://github.com/rustwasm/wasm-pack">wasm-pack</a>.</strong>

<p>
<a href="https://travis-ci.org/rustwasm/wasm-pack-template"><img src="https://img.shields.io/travis/rustwasm/wasm-pack-template.svg?style=flat-square" alt="Build Status" /></a>
</p>

<h3>
<a href="https://rustwasm.github.io/docs/wasm-pack/tutorials/npm-browser-packages/index.html">Tutorial</a>
<span> | </span>
<a href="https://discordapp.com/channels/442252698964721669/443151097398296587">Chat</a>
</h3>

<sub>Built with 🦀🕸 by <a href="https://rustwasm.github.io/">The Rust and WebAssembly Working Group</a></sub>
</div>

## About

[**📚 Read this template tutorial! 📚**][template-docs]

This template is designed for compiling Rust libraries into WebAssembly and
publishing the resulting package to NPM.

Be sure to check out [other `wasm-pack` tutorials online][tutorials] for other
templates and usages of `wasm-pack`.

[tutorials]: https://rustwasm.github.io/docs/wasm-pack/tutorials/index.html
[template-docs]: https://rustwasm.github.io/docs/wasm-pack/tutorials/npm-browser-packages/index.html

## 🚴 Usage

### 🐑 Use `cargo generate` to Clone this Template

[Learn more about `cargo generate` here.](https://github.com/ashleygwilliams/cargo-generate)

```
cargo generate --git https://github.com/rustwasm/wasm-pack-template.git --name my-project
cd my-project
```

### 🛠️ Build with `wasm-pack build`

```
wasm-pack build
```

### 🔬 Test in Headless Browsers with `wasm-pack test`

```
wasm-pack test --headless --firefox
```

### 🎁 Publish to NPM with `wasm-pack publish`

```
wasm-pack publish
```

## 🔋 Batteries Included

* [`wasm-bindgen`](https://github.com/rustwasm/wasm-bindgen) for communicating
between WebAssembly and JavaScript.
* [`console_error_panic_hook`](https://github.com/rustwasm/console_error_panic_hook)
for logging panic messages to the developer console.
* `LICENSE-APACHE` and `LICENSE-MIT`: most Rust projects are licensed this way, so these are included for you

## License

Licensed under either of

* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)

at your option.

### Contribution

Unless you explicitly state otherwise, any contribution intentionally
submitted for inclusion in the work by you, as defined in the Apache-2.0
license, shall be dual licensed as above, without any additional terms or
conditions.
19 changes: 19 additions & 0 deletions temp_wasm/pkg/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "@cesium/wasm-splats",
"type": "module",
"collaborators": [
"Jason Sobotka <[email protected]>",
"Adam Morris <[email protected]>"
],
"version": "0.1.0",
"files": [
"wasm_splats_bg.wasm",
"wasm_splats.js",
"wasm_splats.d.ts"
],
"main": "wasm_splats.js",
"types": "wasm_splats.d.ts",
"sideEffects": [
"./snippets/*"
]
}
75 changes: 75 additions & 0 deletions temp_wasm/pkg/wasm_splats.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/* tslint:disable */
/* eslint-disable */
export function generate_texture_from_attrs(positions: Float32Array, scales: Float32Array, rots: Float32Array, colors: Uint8Array, count: number): TextureData;
export function radix_sort_simd(data: GSplatData): void;
export function radix_sort_gaussians_attrs(positions: Float32Array, scales: Float32Array, rotations: Float32Array, colors: Uint8Array, model_view: Float32Array, count: number): Array<any>;
export function radix_sort_gaussians_indexes(positions: Float32Array, model_view: Float32Array, texture_width: number, count: number): Uint32Array;
export function generate_splat_texture_from_attrs(positions: Float32Array, scales: Float32Array, rotations: Float32Array, colors: Uint8Array, count: number): object;
export class GSplatData {
free(): void;
constructor(positions: Float32Array, scales: Float32Array, rotations: Float32Array, colors: Uint8Array, model_view: Float32Array, count: number);
static fromFloat32Arrays(positions: Float32Array, scales: Float32Array, rotations: Float32Array, colors: Uint8Array, model_view: Float32Array, count: number): GSplatData;
getPositions(): Float32Array;
getScales(): Float32Array;
getRotations(): Float32Array;
getColors(): Uint8Array;
}
export class TextureData {
private constructor();
free(): void;
static new(data: Uint32Array, width: number, height: number): TextureData;
readonly data: Uint32Array;
readonly width: number;
readonly height: number;
}

export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;

export interface InitOutput {
readonly memory: WebAssembly.Memory;
readonly __wbg_texturedata_free: (a: number, b: number) => void;
readonly texturedata_data: (a: number) => [number, number];
readonly texturedata_width: (a: number) => number;
readonly texturedata_height: (a: number) => number;
readonly texturedata_new: (a: number, b: number, c: number, d: number) => number;
readonly generate_texture_from_attrs: (a: any, b: any, c: any, d: any, e: number) => [number, number, number];
readonly __wbg_gsplatdata_free: (a: number, b: number) => void;
readonly gsplatdata_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => number;
readonly gsplatdata_fromFloat32Arrays: (a: any, b: any, c: any, d: any, e: any, f: number) => [number, number, number];
readonly gsplatdata_getPositions: (a: number) => any;
readonly gsplatdata_getScales: (a: number) => any;
readonly gsplatdata_getRotations: (a: number) => any;
readonly gsplatdata_getColors: (a: number) => any;
readonly radix_sort_simd: (a: number) => [number, number];
readonly radix_sort_gaussians_attrs: (a: any, b: any, c: any, d: any, e: any, f: number) => [number, number, number];
readonly radix_sort_gaussians_indexes: (a: any, b: any, c: number, d: number) => [number, number, number];
readonly generate_splat_texture_from_attrs: (a: any, b: any, c: any, d: any, e: number) => [number, number, number];
readonly __wbindgen_exn_store: (a: number) => void;
readonly __externref_table_alloc: () => number;
readonly __wbindgen_export_2: WebAssembly.Table;
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
readonly __wbindgen_malloc: (a: number, b: number) => number;
readonly __externref_table_dealloc: (a: number) => void;
readonly __wbindgen_start: () => void;
}

export type SyncInitInput = BufferSource | WebAssembly.Module;
/**
* Instantiates the given `module`, which can either be bytes or
* a precompiled `WebAssembly.Module`.
*
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
*
* @returns {InitOutput}
*/
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;

/**
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
* for everything else, calls `WebAssembly.instantiate` directly.
*
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
*
* @returns {Promise<InitOutput>}
*/
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
Loading

0 comments on commit 635659e

Please sign in to comment.