Giter Site home page Giter Site logo

kanryu / luminor Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 1.0 13.64 MB

A simple and fast library that changes the brightness, contrast, and gamma value of on-memory images in real time generated with Halide

License: MIT License

Makefile 6.21% C++ 91.08% Python 2.71%
halide image-processing gamma brightness contrast

luminor's Introduction

Luminor

A simple and fast library that changes the brightness, contrast, and gamma value of on-memory images in real time generated with Halide language.

Summary

  • Simple C/C++ language API
  • Optimized processing automatically generated with Halide language
  • It consists of C/C++ header file and static library

This is a part of QuickViewer.

Binary Releases

https://github.com/kanryu/luminor/releases

API

int luminor(struct halide_buffer_t *_input_buffer, float _brightness, float _contrast, float _gamma, struct halide_buffer_t *_output_buffer)

  • _input_buffer
    • input bitmap of rgb24 or gray8
    • gray8 should be initialized as 3D Buffer(width, height, 1)
  • _brightness
    • Add the value to each pixel
    • default: 0.0, min: -128.0, max: 127.0
  • _contrast
    • Multiply each pixel by the value(the base value is 0.5(128))
    • default: 1.0, min: 0.01, max: 10.0
  • _gamma
    • Change the gamma value of each pixel
    • It gets brighter when it gets bigger, it gets darker when it gets smaller
    • default: 1.0, min: 0.01, max: 10.0
  • _output_buffer
    • output bitmap, the same pixel format as _input_buffer

int luminor_rgba(struct halide_buffer_t *_input_buffer, float _brightness, float _contrast, float _gamma, struct halide_buffer_t *_output_buffer)

  • _input_buffer
    • input bitmap of rgba32
    • alpha byte must be at 4th byte of each pixel
    • need to call Buffer::make_interleaved() to prepare buffers

How to use

Only to include luminor.h, HalideBuffer.h and link luminor.a, the API will work.

Details to see https://github.com/kanryu/quickviewer/blob/master/luminor/qluminor.cpp

How to build

You have to get Halide. If you just build the library binary version of Halide is enough. However, if you want to check the operation of the sample program, also download Halide source code.

And,

$ make

Files

  • images/
    • test images
  • msvc/
    • Makefile for nmake
  • msvc_sln/
    • solution/project for Visual Studio 2015
  • py/
    • for Python3 and python_bindings for Halide language
  • luminor_gen.cpp
    • library generator for luminor(), luminor_rgba()
  • samplemain.cpp
    • sample program for luminor/luninor_rgba
    • currently luminor_rgba is not supported

License

MIT

Author

Copyright (c) 2017, KATO Kanryu([email protected])

luminor's People

Contributors

kanryu avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

absbin

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.