https://github.com/beinsezii/pixelbuster
Simple fast image math
https://github.com/beinsezii/pixelbuster
ffi image-processing rust-crate
Last synced: 12 months ago
JSON representation
Simple fast image math
- Host: GitHub
- URL: https://github.com/beinsezii/pixelbuster
- Owner: Beinsezii
- License: other
- Created: 2022-06-04T03:08:35.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-10-02T05:20:44.000Z (over 1 year ago)
- Last Synced: 2025-05-27T03:57:15.611Z (about 1 year ago)
- Topics: ffi, image-processing, rust-crate
- Language: Rust
- Homepage:
- Size: 973 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pixelbuster 0.2.3
A pixel math library because I can
## Features
* Tiny core in pure Rust
* FFI available
* Fast, works directly on a mutable pointer
* Simple 100% easy to understand scripting language that definitely will not give you assembly PTSD
* Kind of turing complete maybe
* a whole 18 variables you can use, currently limited by the technology of our time.
## Implementations
* [GIMP plugin here](https://github.com/Beinsezii/bsz-gimp-plugins)
* a simple GUI can be built with `--features=gui` or found in the releases
## Goals for 1.0
* SIMD
* Docs
* Non-alpha
* should probably have more than 18 vars
* the gui looks like it was written by a 14 y/o Minecraft modder
## Usage
See the HELP either in [code](./src/lib.rs#L10) or ui for language reference
### As a library
Add this git to `Cargo.toml` and go for it. Basically nothing is documented as most of this is written at around 2 am, but I believe in you nontheless.
There's currently 3 fns available via FFI:
`void pixelbuster_ffi(char* code, char* channels, float* pixels, pixels_len: unsigned int, width: unsigned int);`
* `code:` Null-terminated UTF-8 string with lines of code
* `channels:` Null-terminated UTF-8 string with pixel format as letters. Ex: "rgba"
* `pixels:` Is cast into float* when validated; can point to raw bytes as well
* Currently must *always* have a 4th channel for alpha
* `pixels_size:` Size of `pixels` in bytes
* `width:` Width of image in pixels. Set to 0 if unkown.
`void pixelbuster_ffi_ext(... float e1..float e9);`
* Same as `pixelbuster_ffi()` with 9 extra floats at the end of the signature to fill out the external variables
`char* pb_help_ffi();`
Simply returns a null-terminated UTF-8 string with HELP
### GUI/GIMP

1) Type code
2) Press "update"
3) Impress mates
## F.A.Q.
Question|Answer
---|---
Couldn't help but notice there's no way to do any complex filters such as a blur. What the hell even is the point of this|Each pixel only has knowledge of itself, as the core operates directly on a provided buffer instead of writing to a 'shadow' buffer then committing changes. Use G'MIC or something idk.
It crashed!|Yup.