A simple .qoi image file viewer on top of the sokol headers.
QOI: https://github.com/phoboslab/qoi Sokol: https://github.com/floooh/sokol
WASM version (see below for build instructions)
Native invocation examples:
qoiview images/baboon.qoiqoiview file=images/baboon.qoi
...or on Windows with backslashes (note that the form file=path needs double backslashes since
a single backslash is processed as escape sequence by sokol_args.h):
qoiview images\baboon.qoiqoiview file=images\\baboon.qoi
> git clone https://github.com/floooh/qoiview
> cd qoiview> mkdir build
> cd build
> cmake ..
> cmake --build .To build a Release version on Linux and Mac:
> cmake -DCMAKE_BUILD_TYPE=MinSizeRel ..
> cmake --build .To build a Release version on Windows with the VisualStudio toolchain:
> cmake ..
> cmake --build . --config MinSizeRelNOTE: on Linux you'll also need to install the 'usual' dev-packages needed for X11+GL development. On OpenBSD, it is assumed you have X installed.
On Linux, OpenBSD and macOS:
> ./qoiview file=../images/dice.qoiOn Windows with the Visual Studio toolchain the exe is in a subdirectory:
> Debug\qoiview.exe file=../images/dice.qoi
> MinSizeRel\qoiview.exe file=../images/dice.qoiSetup the emscripten SDK as described here:
https://emscripten.org/docs/getting_started/downloads.html#installation-instructions
Don't forget to run source ./emsdk_env.sh after activating the SDK.
And then in the qoiview directory:
mkdir build
cd build
emcmake cmake -DCMAKE_BUILD_TYPE=MinSizeRel ..
cmake --build .
To run the compilation result in the system web browser:
> emrun qoiview.html
...which should look like this.
(this procedure should also work on Windows with make in the path, but
is currently untested)
On Windows, cmake will automatically create a Visual Studio solution file in the build directory, which can be opened with:
> start qoiview.slnReplace cmake .. with cmake -GXcode .. and open the generated
Xcode project:
> cmake -GXcode ..
> open qoiview.xcodeprojUse the MS C/C++ extension together with the MS CMake Tools extension and start Visual Studio code from the project's root directory. The CMake extension will detect the CMakeLists.txt file and take over from there.