add small documentation to readme

This commit is contained in:
Alexandra Latysheva 2020-10-30 13:00:05 +00:00
parent 94abb95771
commit 36c816c693
2 changed files with 37 additions and 1 deletions

View File

@ -0,0 +1,36 @@
# 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:
```
mkdir -p build && cd build && \
cmake .. -DSAPI_ROOT=/path/to/sapi_root
make -j8
```
#### Example:
You should add `-DLIBPNG_SAPI_ENABLE_EXAMPLES=ON` to use the example.\
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`
Input and output examples can be found in images directory.
PNG to PNG: \
input: `/abs/path/to/project/images/pngtest.png`\
output:` /abs/path/to/project/images/pngtopng_pngtest.png`
RGB to BGR: \
input: `/abs/path/to/project/images/red_ball.png`\
output:` /abs/path/to/project/images/rgbtobgr_red_ball.png`
#### Tests:
You should add `-DLIBPNG_SAPI_ENABLE_TESTS=ON` to use tests.\
run: `./tests/tests`

View File

@ -13,7 +13,7 @@
// limitations under the License. // limitations under the License.
// Defines from libpng library. The problem is that the build throws the error // Defines from libpng library. The problem is that the build throws the error
// "Duplicate functions" if #include <png.h> was added. // "Duplicate functions" if #include <png.h> is added.
#define PNG_FORMAT_FLAG_ALPHA 0x01U #define PNG_FORMAT_FLAG_ALPHA 0x01U
#define PNG_FORMAT_FLAG_COLOR 0x02U #define PNG_FORMAT_FLAG_COLOR 0x02U