sandboxed-api/oss-internship-2020/libpng
Christian Blichmann dbaf95c724 Move utility code into sandboxed_api/util
This change should make it less confusing where utility code comes from.
Having it in two places made sense when we were debating whether to publish
Sandbox2 separately, but not any longer.

Follow-up changes will move `sandbox2/util.h` and rename the remaining
`sandbox2/util` folder.

PiperOrigin-RevId: 351601640
Change-Id: I6256845261f610e590c25e2c59851cc51da2d778
2021-01-13 09:25:52 -08:00
..
examples Move utility code into sandboxed_api/util 2021-01-13 09:25:52 -08:00
images init libpng 2020-10-28 15:40:57 +00:00
tests Move utility code into sandboxed_api/util 2021-01-13 09:25:52 -08:00
wrapper Move utility code into sandboxed_api/util 2021-01-13 09:25:52 -08:00
CMakeLists.txt Merge pull request #69 from alexelex:libpng-master 2020-12-07 05:34:46 -08:00
README.md Merge pull request #69 from alexelex:libpng-master 2020-12-07 05:34:46 -08:00
sandboxed.h Merge pull request #69 from alexelex:libpng-master 2020-12-07 05:34:46 -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:

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

Examples of input and output can be found in images.

PNG to PNG:
input: images/pngtest.png
output: images/pngtopng_pngtest.png

RGB to BGR:
input: images/red_ball.png
output: images/rgbtobgr_red_ball.png

Tests:

You should add -DLIBPNG_SAPI_ENABLE_TESTS=ON to use tests and do:

cd tests
ctest .