From 88844fc95819ce71156c56f55c19f09d18b3bfa3 Mon Sep 17 00:00:00 2001 From: Katarzyna Miernikiewicz Date: Wed, 26 Aug 2020 15:13:37 +0000 Subject: [PATCH] changed README.md --- oss-internship-2020/openjpeg/CMakeLists.txt | 4 ++-- oss-internship-2020/openjpeg/README.md | 23 ++++++++++++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/oss-internship-2020/openjpeg/CMakeLists.txt b/oss-internship-2020/openjpeg/CMakeLists.txt index fdc7a9a..3e7d203 100644 --- a/oss-internship-2020/openjpeg/CMakeLists.txt +++ b/oss-internship-2020/openjpeg/CMakeLists.txt @@ -20,10 +20,10 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED True) # To override lib option -- else SAPI won't work -SET(BUILD_SHARED_LIBS OFF CACHE BOOL "Build OpenJPEG shared library and link executables against it." ) +set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build OpenJPEG shared library and link executables against it." FORCE) add_subdirectory(openjpeg) -set(SAPI_ROOT "" CACHE PATH "Path to the Sandboxed API source tree") +set(SAPI_ROOT "../.." CACHE PATH "Path to the Sandboxed API source tree") set(SAPI_ENABLE_EXAMPLES OFF CACHE BOOL "") set(SAPI_ENABLE_TESTS OFF CACHE BOOL "") set(EXECUTABLE_OUTPUT_PATH "" CACHE PATH "" FORCE) diff --git a/oss-internship-2020/openjpeg/README.md b/oss-internship-2020/openjpeg/README.md index 50df415..4c17082 100644 --- a/oss-internship-2020/openjpeg/README.md +++ b/oss-internship-2020/openjpeg/README.md @@ -2,7 +2,28 @@ This library provides sandboxed version of the [OpenJPEG](https://github.com/uclouvain/openjpeg) library. - ## Examples The 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). + +In `decompress_example.cc` the library's sandboxed API is used to convert the _.jp2_ to _.pnm_ image format. + +## Build + +To build this example, after cloning the whole Sandbox API project, you also need to run + +``` +git submodule update --init --recursive +``` +anywhere in the project tree in order to clone the `openjpeg` submodule. +Then in the `sandboxed-api/oss-internship-2020/openjpeg` run +``` +mkdir build && cd build +cmake -G Ninja +ninja +``` +To run `decompress_sandboxed`: +``` +cd examples +./decompress_sandboxed absolute/path/to/the/file.jp2 absolute/path/to/the/file.pnm +```