azrafe7 / hxPixels

An hxperimental (cross-target/cross-lib) Pixels abstract, in Haxe 3.1+
MIT License
20 stars 1 forks source link

hxPixels

An hxperimental (cross-target/cross-lib) Pixels abstract, in Haxe 3.1+

Simple interface to access/manipulate pixel values among different targets and libs, having a way to get/set individual pixels (or bytes), and be able to apply them back to the original source (taking care of framework-specific details under the hood).

API

For the supported libs the following methods are implemented (note that all color values are in ARGB format):

Supported classes/libs

Implementation

Pixels is an abstract over haxe.io.Bytes. It stores the raw bytes in the underlying bytes var (in source-specific color format), providing an ARGB API over them.

Usage

See the src folder for examples on how to use it, and please file an issue if you have problems or spot a bug.

Warning

The code abstracting bitmaps from the above-mentioned libs is strictly coupled with their internal implementations, so it can easily break when they update. It may still be useful to work with pixels on a generic bitmap structure.

License (MIT)

See LICENSE file.