xref: /aosp_15_r20/external/sandboxed-api/oss-internship-2020/openjpeg/README.md (revision ec63e07ab9515d95e79c211197c445ef84cefa6a)
1*ec63e07aSXin Li# OpenJPEG Sandboxed API
2*ec63e07aSXin Li
3*ec63e07aSXin LiThis library provides sandboxed version of the [OpenJPEG](https://github.com/uclouvain/openjpeg) library.
4*ec63e07aSXin Li
5*ec63e07aSXin Li## Examples
6*ec63e07aSXin Li
7*ec63e07aSXin LiThe examples are sandboxed and simplified version of the main tools provided by the OpenJPEG library, namely (for now) `opj_decompress` from [here](https://github.com/uclouvain/openjpeg/blob/master/src/bin/jp2/opj_decompress.c).
8*ec63e07aSXin Li
9*ec63e07aSXin LiIn `decompress_example.cc` the library's sandboxed API is used to convert the _.jp2_ to _.pnm_ image format.
10*ec63e07aSXin Li
11*ec63e07aSXin Li## Build
12*ec63e07aSXin Li
13*ec63e07aSXin LiTo build this example, after cloning the whole Sandbox API project, you also need to run
14*ec63e07aSXin Li
15*ec63e07aSXin Li```
16*ec63e07aSXin Ligit submodule update --init --recursive
17*ec63e07aSXin Li```
18*ec63e07aSXin Lianywhere in the project tree in order to clone the `openjpeg` submodule.
19*ec63e07aSXin LiThen in the `sandboxed-api/oss-internship-2020/openjpeg` run
20*ec63e07aSXin Li```
21*ec63e07aSXin Limkdir build && cd build
22*ec63e07aSXin Licmake -G Ninja
23*ec63e07aSXin Lininja
24*ec63e07aSXin Li```
25*ec63e07aSXin LiTo run `decompress_sandboxed`:
26*ec63e07aSXin Li```
27*ec63e07aSXin Licd examples
28*ec63e07aSXin Li./decompress_sandboxed absolute/path/to/the/file.jp2 absolute/path/to/the/file.pnm
29*ec63e07aSXin Li```
30