2020-10-30 21:00:05 +08:00
|
|
|
# sandboxed LibPNG
|
|
|
|
Copyright 2020 Google LLC.
|
|
|
|
|
|
|
|
## Start use
|
|
|
|
You should make sure the libtiff submodule is cloned.
|
|
|
|
|
|
|
|
`git clone --recursive https://github.com/google/sandboxed-api`
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
#### Build:
|
|
|
|
```
|
2020-12-07 21:34:46 +08:00
|
|
|
mkdir -p build && cd build
|
|
|
|
cmake .. -DSAPI_ROOT=/path/to/sapi_root
|
2020-10-30 21:00:05 +08:00
|
|
|
make -j8
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Example:
|
|
|
|
You should add `-DLIBPNG_SAPI_ENABLE_EXAMPLES=ON` to use the example.\
|
2020-10-30 21:05:37 +08:00
|
|
|
run PNG to PNG:
|
|
|
|
```
|
|
|
|
./examples/pngtopng /absolute/path/to/input/image.png /absolute/path/to/output/image.png
|
|
|
|
```
|
|
|
|
run RGB to BGR:
|
|
|
|
```
|
|
|
|
./examples/rgbtobgr /absolute/path/to/input/image.png /absolute/path/to/output/image.png
|
|
|
|
```
|
2020-10-30 21:00:05 +08:00
|
|
|
|
2020-10-30 21:05:37 +08:00
|
|
|
Examples of input and output can be found in `images`.
|
2020-10-30 21:00:05 +08:00
|
|
|
|
|
|
|
PNG to PNG: \
|
2020-10-30 21:05:37 +08:00
|
|
|
input: `images/pngtest.png`\
|
|
|
|
output:` images/pngtopng_pngtest.png`
|
2020-10-30 21:00:05 +08:00
|
|
|
|
|
|
|
RGB to BGR: \
|
2020-10-30 21:05:37 +08:00
|
|
|
input: `images/red_ball.png`\
|
|
|
|
output: `images/rgbtobgr_red_ball.png`
|
2020-10-30 21:00:05 +08:00
|
|
|
|
|
|
|
|
|
|
|
#### Tests:
|
2020-10-30 22:52:53 +08:00
|
|
|
You should add `-DLIBPNG_SAPI_ENABLE_TESTS=ON` to use tests and do:
|
2020-10-30 21:05:37 +08:00
|
|
|
```
|
2020-10-30 22:52:53 +08:00
|
|
|
cd tests
|
|
|
|
ctest .
|
2020-10-30 21:05:37 +08:00
|
|
|
```
|