Initial commit.
Signed-off-by: Andreas Widen <aw@luflow.net>
This commit is contained in:
commit
a4a5c7daa5
1389 changed files with 241399 additions and 0 deletions
|
|
@ -0,0 +1,78 @@
|
|||
author: Andreas
|
||||
published: 2026-06-10 10:41:00
|
||||
updated: 2026-06-10 10:41:00
|
||||
topics: flow-web, Static web site, generator, Rust
|
||||
title: flow-web: A program that will allow you to generate static website
|
||||
snippet: flow-web is a program written in Rust that will allow you to generate luflow.net static website.
|
||||
|
||||
---
|
||||
|
||||
This static website is generated with a program written in [Rust](https://rust-lang.org/)
|
||||
called [flow-web](https://luflow.net/git/hfsoulz/flow-web.git).
|
||||
`flow-web` is specifically written to generate this static website.
|
||||
|
||||
### Installing Rust
|
||||
|
||||
Install `Rust` from your package manager or by downloading from here:
|
||||
[https://rust-lang.org/](https://rust-lang.org/).
|
||||
|
||||
### Getting the code
|
||||
|
||||
Install `git` from your package manager or by downloading from here:
|
||||
[https://git-scm.com/install](https://git-scm.com/install). The [git repository](https://luflow.net/git/hfsoulz/flow-web.git)
|
||||
can also be browsed online.
|
||||
|
||||
Clone the `git` repository:
|
||||
|
||||
```sh
|
||||
git clone https://luflow.net/git/hfsoulz/flow-web.git
|
||||
```
|
||||
|
||||
### Compiling the code
|
||||
|
||||
cd into the cloned dir:
|
||||
|
||||
```sh
|
||||
cd flow-web
|
||||
```
|
||||
|
||||
Build using release mode:
|
||||
|
||||
```sh
|
||||
cargo build --release
|
||||
```
|
||||
|
||||
### Generating the site
|
||||
|
||||
Generate the site using release mode:
|
||||
|
||||
```sh
|
||||
cargo run --release
|
||||
```
|
||||
|
||||
The generated output can be found in '**output**' folder.
|
||||
|
||||
### Serve locally
|
||||
|
||||
Run the following command to serve locally using **[servez](https://www.npmjs.com/package/servez)** as an example:
|
||||
|
||||
```sh
|
||||
servez output
|
||||
```
|
||||
|
||||
Then, visit the following url in a web browser:
|
||||
|
||||
[http://localhost:8080/](http://localhost:8080)
|
||||
|
||||
You can stop the server pressing CTRL+c.
|
||||
|
||||
servez can be installed through [Node.js](https://nodejs.org/en) like so:
|
||||
|
||||
```sh
|
||||
npm install -g servez
|
||||
```
|
||||
|
||||
### License
|
||||
|
||||
[flow-web](https://luflow.net/git/hfsoulz/flow-web.git) is licensed under the
|
||||
[GNU AGPL](https://gnu.org/licenses/agpl-3.0.html) license.
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
author: Andreas
|
||||
published: 2026-06-10 11:31:00
|
||||
updated: 2026-06-10 11:31:00
|
||||
topics: flow-rbp, Rect bin packing, Rust
|
||||
title: flow-rbp: A library for packing rectangles into two-dimensional finite bins
|
||||
snippet: flow-rbp is a library for packing rectangles into two-dimensional finite bins using different heuristic methods for placement.
|
||||
|
||||
---
|
||||
|
||||
[flow-rbp](https://luflow.net/git/hfsoulz/flow-rbp.git) is a library for packing
|
||||
rectangles into two-dimensional finite bins using different heuristic methods
|
||||
for placement.
|
||||
|
||||
The two-dimensional rectangle bin packing is a classical problem in
|
||||
combinatorial optimization. In this problem, one is given a sequence of
|
||||
rectangles `(R1, R2, ... Rn), Ri = (wi, hi)` and the task is to find a packing
|
||||
of these items into a minimum number of bins of size `(W, H)`. No two
|
||||
rectangles may intersect or be contained inside one another. This library uses
|
||||
an algorithm sometimes referred as `The Maximal Rectangles ALgorithm`. This
|
||||
algorithm stores a list of free rectangles that represents the free area of the
|
||||
bin.
|
||||
|
||||
[flow-texpack](https://luflow.net/git/hfsoulz/flow-texpack.git) is a program that
|
||||
uses [flow-rbp](https://luflow.net/git/hfsoulz/flow-rbp.git) to generate texture
|
||||
atlas.
|
||||
|
||||
### Installing Rust
|
||||
|
||||
Install `Rust` from your package manager or by downloading from here:
|
||||
[https://rust-lang.org/](https://rust-lang.org/).
|
||||
|
||||
### Getting the code
|
||||
|
||||
Install `git` from your package manager or by downloading from here:
|
||||
[https://git-scm.com/install](https://git-scm.com/install). The [git
|
||||
repository](https://luflow.net/git/hfsoulz/flow-rbp.git) can also be browsed
|
||||
online.
|
||||
|
||||
Clone the `git` repository:
|
||||
|
||||
```sh
|
||||
git clone https://luflow.net/git/hfsoulz/flow-rbp.git
|
||||
```
|
||||
|
||||
### Usage
|
||||
|
||||
Add this to your `Cargo.toml`:
|
||||
|
||||
```
|
||||
[dependencies]
|
||||
flow-rbp = { git = "https://luflow.net/git/hfsoulz/flow-rbp.git", tag = "v0.1.0" }
|
||||
```
|
||||
|
||||
Then:
|
||||
|
||||
```rust
|
||||
use flow_rbp::FreeRectHeuristic;
|
||||
use flow_rbp::RectsBinPack;
|
||||
|
||||
// create a new bin of size 32x32 which allows rotation:
|
||||
let mut rbp = RectsBinPack::new(32, 32, true).unwrap();
|
||||
|
||||
// make sure occupancy is zero:
|
||||
assert_eq!(rbp.get_occupancy(), 0.0);
|
||||
|
||||
// add a few rects that should fit:
|
||||
assert_eq!(rbp.insert(16, 16, FreeRectHeuristic::BottomLeft).is_some(), true);
|
||||
assert_eq!(rbp.insert(16, 16, FreeRectHeuristic::BottomLeft).is_some(), true);
|
||||
assert_eq!(rbp.get_occupancy(), 0.5);
|
||||
assert_eq!(rbp.insert(16, 16, FreeRectHeuristic::BottomLeft).is_some(), true);
|
||||
assert_eq!(rbp.insert(16, 16, FreeRectHeuristic::BottomLeft).is_some(), true);
|
||||
assert_eq!(rbp.get_occupancy(), 1.0);
|
||||
|
||||
// this rect will not fit and therefore returns None:
|
||||
assert_eq!(rbp.insert(1, 1, FreeRectHeuristic::BottomLeft).is_none(), true);
|
||||
|
||||
```
|
||||
|
||||
### License
|
||||
|
||||
[flow-rbp](https://luflow.net/git/hfsoulz/flow-rbp.git) is licensed under the
|
||||
zlib license. This license allows you to use `flow-rbp` freely in any software.
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
author: Andreas
|
||||
published: 2026-06-10 14:01:00
|
||||
updated: 2026-06-10 14:01:00
|
||||
topics: flow-texpack, Texture Atlas, Image Atlas, generator, Rust
|
||||
title: flow-texpack: A program that will allow you to generate texture atlas.
|
||||
snippet: flow-texpack is a program that will allow you to generate texture atlas from input images (BMP, HDR, JPG, PNG, TGA, TIFF, WEBP).
|
||||
|
||||
---
|
||||
|
||||
[flow-texpack](https://luflow.net/git/hfsoulz/flow-texpack.git) is a program that
|
||||
will allow you to generate texture atlas from input images (BMP, HDR, JPG, PNG,
|
||||
TGA, TIFF, WEBP). The application generates both texture atlas and descriptions
|
||||
file that can be read by a game.
|
||||
|
||||
### Installing Rust
|
||||
|
||||
Install `Rust` from your package manager or by downloading from here:
|
||||
[https://rust-lang.org/](https://rust-lang.org/).
|
||||
|
||||
### Getting the code
|
||||
|
||||
Install `git` from your package manager or by downloading from here:
|
||||
[https://git-scm.com/install](https://git-scm.com/install). The [git
|
||||
repository](https://luflow.net/git/hfsoulz/flow-texpack.git) can also be browsed
|
||||
online.
|
||||
|
||||
Clone the `git` repository:
|
||||
|
||||
```sh
|
||||
git clone https://luflow.net/git/hfsoulz/flow-texpack.git
|
||||
```
|
||||
|
||||
### Compiling the code
|
||||
|
||||
Build using release mode and install locally:
|
||||
|
||||
```sh
|
||||
cargo install --locked --path .
|
||||
```
|
||||
|
||||
The binary produced should be located here: `~/.cargo/bin/flow-texpack` (on
|
||||
GNU/Linux). Make sure `~/.cargo/bin` is in your `PATH`.
|
||||
|
||||
### Usage
|
||||
|
||||
Show available options:
|
||||
|
||||
```sh
|
||||
flow-texpack -h
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```sh
|
||||
flow-texpack --help
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
Generate from input `data/characters` and `data/tiles`, write output to
|
||||
`out/atlas` and enable the options: `premultiply` pixels by their alpha
|
||||
channel, `trim` excess transparency off the textures, `remove duplicate
|
||||
textures` from the atlas, enable `rotation` of textures 90 degrees clockwise,
|
||||
`pad` each texture by 2 pixels and finally enable `verbose` output mode.
|
||||
|
||||
```sh
|
||||
flow-texpack -i data/characters data/tiles -o out/atlas -m -t -u -r -p 2 -v
|
||||
```
|
||||
|
||||
Enable `load filter` so that only `TGA` images are included in the texture atlas:
|
||||
|
||||
```sh
|
||||
flow-texpack -i data/tiles -o out/atlas --load-filter tga -v
|
||||
```
|
||||
|
||||
Enable rect heuristic `AreaFit`:
|
||||
|
||||
```sh
|
||||
flow-texpack -i data/tiles -o out/atlas --rect-heuristic area-fit -v
|
||||
```
|
||||
|
||||
Enable output `atlas size` of **2048x2048**:
|
||||
|
||||
```sh
|
||||
flow-texpack -i data/tiles -o out/atlas --atlas-size pot2048 -v
|
||||
```
|
||||
|
||||
Read input files/directories from `input.txt` but exclude all in `exclude.txt`:
|
||||
|
||||
```sh
|
||||
flow-texpack --input-file input.txt --exlude-file exclude.txt -o out/atlas -v
|
||||
```
|
||||
|
||||
`Adjust atlas size` automatically so that texture will fit:
|
||||
|
||||
```sh
|
||||
flow-texpack -i data/characters -o out/atlas --adjust-size -v
|
||||
```
|
||||
|
||||
`Adjust texture size` so that it will fit given atlas size:
|
||||
|
||||
```sh
|
||||
flow-texpack -i data/characters -o out/atlas --adjust-fit -v
|
||||
```
|
||||
|
||||
### License
|
||||
|
||||
[flow-texpack](https://luflow.net/git/hfsoulz/flow-texpack.git) is licensed under the
|
||||
zlib license. This license allows you to use `flow-texpack` freely in any software.
|
||||
Loading…
Reference in a new issue