Git Product home page Git Product logo

cl-turbojpeg's Introduction

# About cl-turbojpeg
This is an up-to-date bindings library for "libjpeg-turbo"(https://libjpeg-turbo.org), providing a fast way to read, write, and transform JPEG images.

Unlike the existing "jpeg-turbo wrapper"(https://github.com/shamazmazum/jpeg-turbo/) this project is up-to-date with upstream, exposes the full API, and ships precompiled binaries, avoiding the requirement for a local copy and a C compiler to grovel with.

## How To
Most of the library should be self-explanatory through the functions ``load-image``, ``save-image``, and ``transform-image``. Nevertheless, a simple example:

:: common lisp
(org.shirakumo.fraf.turbojpeg:load-image "whatever.jpg" T)
::

For finer control you can create the respective ``decompressor``, ``compressor``, and ``transformer`` instances yourself and pass the desired initargs, then call the same function with them instead of ``T``. When you are done with the object, clean it up again via ``free``.

The library supports pathnames, vectors, and pointers for source and destination. When passing vectors, it uses ``cffi:with-pointer-to-vector-data`` to access the contents, so please see the respective documentation for restrictions thereof.

For faster file operations you may want to consider using the "mmap"(https://github.com/shinmera/mmap) in conjunction, to avoid having to manually copy the file into memory first like this library does by itself.

You can also directly access the underlying jpeg-turbo C API via the ``org.shirakumo.fraf.turbojpeg.cffi`` package, and the simulated libjpeg API via the ``org.shirakumo.fraf.jpeg.cffi`` package. In the latter case you'll have to first ensure you load the ``org.shirakumo.fraf.jpeg.cffi:libjpeg`` library before using it.

cl-turbojpeg's People

Contributors

shinmera avatar marcoheisig avatar paulapatience avatar surabax avatar

Stargazers

S Pearman avatar  avatar  avatar antx avatar

Watchers

James Cloos avatar  avatar  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.