https://github.com/sug0/cdhorizon
Next-next-gen go-glitch. Accomplishes the performance goals horizon couldn't.
https://github.com/sug0/cdhorizon
art c glitch go-glitch horizon image next-generation trippy
Last synced: 26 days ago
JSON representation
Next-next-gen go-glitch. Accomplishes the performance goals horizon couldn't.
- Host: GitHub
- URL: https://github.com/sug0/cdhorizon
- Owner: sug0
- Created: 2020-05-27T17:23:06.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-30T21:23:01.000Z (7 months ago)
- Last Synced: 2025-03-14T19:51:05.542Z (about 1 month ago)
- Topics: art, c, glitch, go-glitch, horizon, image, next-generation, trippy
- Language: C
- Size: 89.8 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# libcdhorizon
C library used to glitch images with the help of [libgoimg](https://github.com/sug0/libgoimg)
and [LuaJIT](https://bitop.luajit.org/).## Driver program
A driver program is included to play around with the library.
The build script compiles both the library and the driver program.
You can obtain the driver program's usage (from the library's root path) with:$ ./driver/cdhorizon
The possible output format strings are:
* farbfeld
* PNG
* JPEG## Dependencies
* libgoimg
* LuaJIT
* libjpeg (optional)
* libpng (optional)## Building
Building this project requires [tup](http://gittup.org/tup/).
Compile the library with:$ ./make build
To change the compilation flags, create a `tup.config` file with the
following content:CONFIG_CC=...
CONFIG_CFLAGS=...
CONFIG_LDFLAGS=...If you want libpng and/or libjpeg support on the driver program,
creating this file with the appropriate `CONFIG_LDFLAGS` is required.
If you're just building the library, you can ignore this step.## Lua API
| Identifier | Arguments | Return | Description |
|--------------------|-------------------|----------|-----------------------------------------------------------------------|
| `horizon.getpixel` | `x`, `y` | `pixel` | Returns a table with the RGB color components of the specified pixel. |
| `horizon.setpixel` | `x`, `y`, `pixel` | N/A | Takes an input table with the RGB components of the pixel to set. |
| `horizon.width` | N/A | `width` | Constant value of the width of the input image. |
| `horizon.height` | N/A | `height` | Constant value of the height of the input image. |
| `horizon.params` | N/A | `params` | Returns a dynamic table with user defined script param values. |Some examples can be found at `glitchers/`. The file `glitchers/id.lua` creates
an exact replica of the input image, so it is a fine template for new scripts.