xref: /aosp_15_r20/external/sandboxed-api/oss-internship-2020/libpng/README.md (revision ec63e07ab9515d95e79c211197c445ef84cefa6a)
1# sandboxed LibPNG
2Copyright 2020 Google LLC.
3
4## Start use
5You should make sure the libtiff submodule is cloned.
6
7`git clone --recursive https://github.com/google/sandboxed-api`
8
9## Usage
10
11#### Build:
12```
13mkdir -p build && cd build
14cmake .. -DSAPI_ROOT=/path/to/sapi_root
15make -j8
16```
17
18#### Example:
19You should add `-DLIBPNG_SAPI_BUILD_EXAMPLES=ON` to use the example.\
20run PNG to PNG:
21```
22./examples/pngtopng /absolute/path/to/input/image.png /absolute/path/to/output/image.png
23```
24run RGB to BGR:
25```
26./examples/rgbtobgr /absolute/path/to/input/image.png /absolute/path/to/output/image.png
27```
28
29Examples of input and output can be found in `images`.
30
31PNG to PNG: \
32input: `images/pngtest.png`\
33output:` images/pngtopng_pngtest.png`
34
35RGB to BGR: \
36input: `images/red_ball.png`\
37output: `images/rgbtobgr_red_ball.png`
38
39
40#### Tests:
41You should add `-DLIBPNG_SAPI_BUILD_TESTING=ON` to use tests and do:
42```
43cd tests
44ctest .
45```
46