LibSTBImage

Crystal bindings for stb_image

LibSTBImage

Crystal bindings for stb_image.

Installation

Add this to your application's shard.yml:

dependencies:
  lib_stb_image:
    github: calebuharrison/LibSTBImage

Install your dependencies:

shards install

Usage

require "lib_stb_image"

# image_data is a pointer to the raw bytes of the image - perfect for OpenGL!
image_data = LibSTBImage.load("path/to/image/file", out width, out height, out number_of_channels, LibSTBImage::Channels::Default)
puts "image width: #{width}"
puts "image height: #{height}"
puts "number of channels in the image: #{number_of_channels}"

Contributing

  1. Fork it ( https://github.com/calebuharrison/lib_stb_image/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

Repository

LibSTBImage

Owner
Statistic
  • 0
  • 1
  • 0
  • 2
  • 0
  • about 7 years ago
  • October 7, 2017
License

MIT License

Links
Synced at

Thu, 07 Nov 2024 10:21:42 GMT

Languages