GithubHelp home page GithubHelp logo

kongduino / xojo_qoi_decoder Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 6.9 MB

Xojo wrapper around the reference C implementation of the Quite OK Image Format.

License: MIT License

Xojo 100.00%
converter image qoi xojo

xojo_qoi_decoder's Introduction

Xojo_QOI_Decoder

This is a Xojo wrapper around the reference C implementation of the Quite OK Image Format. Using the qoiconv.c I built a dylib that also gives it PNG conversion capabilities. It is included here, but you can also compile your own. It requires the stb image library. On Mac OS X you can compile it with:

gcc -g -c qoiconv.c -std=c99 -O3 -o qoiconv.o -I../stb/
gcc -dynamiclib -flat_namespace qoiconv.o -o qoi.dylib     

INSTALLATION

You need to copy qoi.dylib to /usr/local/lib โ€“ that's where the app expects it to reside:

cp qoi.dylib /usr/local/lib/

When first opening the source code and compiling it, Xojo might complain it can't find the .qoi files. Delete the links in the sidebar, and drag'n'drop the .qoi files from the Finder to the sidebar again.

This sample app implements decode(mb As MemoryBlock) and decodeFile(fp As String). The app itself cycles between 5 .qoi images, displaying the time it took to decode them, and convert them to a Xojo Picture object.

demo

The newest version adds a higher-definition image, and saves the .qoi files as PNG in the /tmp/ directory.

> ls -al /tmp/*.png
-rw-r--r--  1 dda  wheel  2330306 Jan  1 14:45 /tmp/PakOu.png
-rw-r--r--  1 dda  wheel   349827 Jan  1 14:45 /tmp/dice.png
-rw-r--r--  1 dda  wheel   824064 Jan  1 14:45 /tmp/kodim23.png
-rw-r--r--  1 dda  wheel    20210 Jan  1 14:44 /tmp/qoi_logo.png
-rw-r--r--  1 dda  wheel   195553 Jan  1 14:45 /tmp/screen1.png
-rw-r--r--  1 dda  wheel    18371 Jan  1 14:45 /tmp/testcard_rgba.png

xojo_qoi_decoder's People

Contributors

kongduino avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.