Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/SmilyOrg/hxlode
PNG image decoder haxelib for neko/cpp using LodePNG / PicoPNG
https://github.com/SmilyOrg/hxlode
Last synced: 16 days ago
JSON representation
PNG image decoder haxelib for neko/cpp using LodePNG / PicoPNG
- Host: GitHub
- URL: https://github.com/SmilyOrg/hxlode
- Owner: SmilyOrg
- Created: 2013-05-14T22:19:34.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-12-26T04:20:29.000Z (almost 11 years ago)
- Last Synced: 2024-07-31T22:58:00.116Z (3 months ago)
- Language: C
- Homepage:
- Size: 390 KB
- Stars: 5
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
hxlode
======PNG image decoder haxelib for neko/cpp using LodePNG / PicoPNG.
Official binaries provided for Windows. Binaries for Mac / Mac64 by [Alex Koz](https://github.com/fzzrr). Binaries for Linux / Linux64 by [zaynyatyi](https://github.com/zaynyatyi).
Usage
-----Decode PNG directly from a file
```haxe
var img:Image = PicoPNG.loadFile("hello.png");
```Decode PNG from BytesData
```haxe
var file = File.read("hello.png");
var fileBytes = file.readAll();
var img:Image = PicoPNG.decodePNG(fileBytes.getData(), fileBytes.length);
```Using the returned image data
```haxe
var bytes = Bytes.ofData(img.data);
var width = img.width;
var height = img.height;log('Processing $path | $width x $height | '+bytes.length+" bytes");
log("First RGBA pixel: "+bytes.get(0)+" "+bytes.get(1)+" "+bytes.get(2)+" "+bytes.get(3));
```