Giter Club home page Giter Club logo

libertuscode's Introduction

libertuscode

Single header utility libraries with APL2, Boost, BSD, MIT, or compatible licenses. This code is based on work of various open source project constributions by some very generous people. All credits and original licensing are at the top of the files.

lc_image

JPG and PNG loader. JPG baseline only, progressive JPGs will not work.

  // Loading from file
  int w, h, c;
  unsigned char* data = lc_load_image("test_001.png", &w, &h, &c, 0);
  // do some st uff
  lc_free_image(data);
  
  // Loading from memory  
  int w, h, c;
  unsigned char* data = lc_load_image_mem(size, data, &w, &h, &c, 0);
  // do some st uff
  lc_free_image(data);

The last parameter for both lc_load_image and lc_load_image_mem can be either 0, 1, 2, 3, 4.

required_channel # channels loaded
0 JPG=3, PNG=4
1 1
2 2
3 3
4 4, A=0xFF

lc_image_resize

Image resize with various filters:

filter name/constant
LC_FILTER_BOX
LC_FILTER_TRIANGLE
LC_FILTER_QUADRATIC
LC_FILTER_CUBIC
LC_FILTER_CATMUL_ROM
LC_FILTER_MITCHELL
LC_FILTER_SINC_BLACKMAN
LC_FILTER_GAUSSIAN
LC_FILTER_BESSEL_BLACKMAN
// 8-bit
void lc_image_resize_uint8(int src_width, int src_height, int src_row_stride, const unsigned char* p_src_data,
                           int dst_wdith, int dst_height, int dst_row_stride, unsigned char* p_dst_data,
                           unsigned int channel_count, lc_filter filter, const lc_filter_args* p_filter_args);

// float
void lc_image_resize_float(int src_width, int src_height, int src_row_stride, const float* p_src_data,
                           int dst_wdith, int dst_height, int dst_row_stride, float* p_dst_data,
                           unsigned int channel_count, lc_filter filter, const lc_filter_args* p_filter_args);

The last paraemter for both lc_image_resize_uint8 and lc_image_resize_float can be NULL and defaults will be used.

libertuscode's People

Contributors

haing avatar libertuscode 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.