@cpp.js/package-webp-multithread 2.0.0-beta.1
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/LICENSE +24 -0
- package/README.md +50 -0
- package/cppjs.build.js +4 -0
- package/cppjs.config.js +14 -0
- package/package.json +23 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Copyright (c) 2010, Google Inc. All rights reserved.
|
|
2
|
+
Redistribution and use in source and binary forms, with or without
|
|
3
|
+
modification, are permitted provided that the following conditions are
|
|
4
|
+
met:
|
|
5
|
+
* Redistributions of source code must retain the above copyright
|
|
6
|
+
notice, this list of conditions and the following disclaimer.
|
|
7
|
+
* Redistributions in binary form must reproduce the above copyright
|
|
8
|
+
notice, this list of conditions and the following disclaimer in
|
|
9
|
+
the documentation and/or other materials provided with the
|
|
10
|
+
distribution.
|
|
11
|
+
* Neither the name of Google nor the names of its contributors may
|
|
12
|
+
be used to endorse or promote products derived from this software
|
|
13
|
+
without specific prior written permission.
|
|
14
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
15
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
16
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
17
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
18
|
+
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
19
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
20
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
21
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
22
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
23
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
24
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# @cpp.js/package-webp
|
|
2
|
+
**Precompiled webp library built with cpp.js for seamless integration in JavaScript, WebAssembly and React Native projects.**
|
|
3
|
+
|
|
4
|
+
<a href="https://www.npmjs.com/package/@cpp.js/package-webp">
|
|
5
|
+
<img alt="NPM version" src="https://img.shields.io/npm/v/@cpp.js/package-webp?style=for-the-badge" />
|
|
6
|
+
</a>
|
|
7
|
+
<a href="https://chromium.googlesource.com/webm/libwebp">
|
|
8
|
+
<img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Funpkg.com%2F%40cpp.js%2Fpackage-webp%2Fpackage.json&query=%24.nativeVersion&style=for-the-badge&label=WebP" />
|
|
9
|
+
</a>
|
|
10
|
+
<a href="https://chromium.googlesource.com/webm/libwebp/+/refs/heads/main/COPYING">
|
|
11
|
+
<img alt="License" src="https://img.shields.io/npm/l/%40cpp.js%2Fpackage-webp?style=for-the-badge" />
|
|
12
|
+
</a>
|
|
13
|
+
|
|
14
|
+
## Integration
|
|
15
|
+
Start by installing these package with the following command:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
npm install @cpp.js/package-webp
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
To enable the library, modify the cppjs.config.js file as shown below.
|
|
22
|
+
```diff
|
|
23
|
+
+import webp from '@cpp.js/package-webp/cppjs.config.js';
|
|
24
|
+
|
|
25
|
+
export default {
|
|
26
|
+
dependencies: [
|
|
27
|
+
+ webp
|
|
28
|
+
]
|
|
29
|
+
paths: {
|
|
30
|
+
config: import.meta.url,
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Usage
|
|
36
|
+
Below are the steps to use the webp in your C++ or JavaScript code.
|
|
37
|
+
|
|
38
|
+
### Usage in C++ Code
|
|
39
|
+
```diff
|
|
40
|
+
+#include <webp/decode.h>
|
|
41
|
+
|
|
42
|
+
std::string Native::sample() {
|
|
43
|
+
+ return std::to_string(WebPGetDecoderVersion());
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## License
|
|
48
|
+
This project includes the precompiled webp library, which is distributed under the [BSD 3-Clause License](https://chromium.googlesource.com/webm/libwebp/+/refs/heads/main/COPYING).
|
|
49
|
+
|
|
50
|
+
WebP Homepage: [https://developers.google.com/speed/webp](https://developers.google.com/speed/webp)
|
package/cppjs.build.js
ADDED
package/cppjs.config.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import webpWasmMultithread from '@cpp.js/package-webp-wasm-multithread/cppjs.config.js';
|
|
2
|
+
import webpAndroidMultithread from '@cpp.js/package-webp-android-multithread/cppjs.config.js';
|
|
3
|
+
import webpIosMultithread from '@cpp.js/package-webp-ios-multithread/cppjs.config.js';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
dependencies: [
|
|
7
|
+
webpWasmMultithread,
|
|
8
|
+
webpAndroidMultithread,
|
|
9
|
+
webpIosMultithread,
|
|
10
|
+
],
|
|
11
|
+
paths: {
|
|
12
|
+
config: import.meta.url
|
|
13
|
+
}
|
|
14
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cpp.js/package-webp-multithread",
|
|
3
|
+
"version": "2.0.0-beta.1",
|
|
4
|
+
"nativeVersion": "1.6.0",
|
|
5
|
+
"description": "This package provides a WebP library compiled with Cpp.js, enabling seamless usage of WebP functionalities in JavaScript, WebAssembly and React Native projects. It supports efficient image processing for web and mobile applications.",
|
|
6
|
+
"homepage": "https://github.com/bugra9/cpp.js/tree/main/packages/cppjs-package-webp#readme",
|
|
7
|
+
"repository": "https://github.com/bugra9/cpp.js.git",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"license": "BSD-3-Clause",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"webp",
|
|
12
|
+
"libwebp",
|
|
13
|
+
"cpp.js-package",
|
|
14
|
+
"webassembly",
|
|
15
|
+
"react-native"
|
|
16
|
+
],
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"cpp.js": "^2.0.0-beta.1",
|
|
19
|
+
"@cpp.js/package-webp-wasm-multithread": "^2.0.0-beta.1",
|
|
20
|
+
"@cpp.js/package-webp-ios-multithread": "^2.0.0-beta.1",
|
|
21
|
+
"@cpp.js/package-webp-android-multithread": "^2.0.0-beta.1"
|
|
22
|
+
}
|
|
23
|
+
}
|