Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/epilys/bitmappers-companion
zine/book about bitmap drawing algorithms and math with code examples in Rust
https://github.com/epilys/bitmappers-companion
bitmap book latex raster raster-graphics rust zine
Last synced: about 2 months ago
JSON representation
zine/book about bitmap drawing algorithms and math with code examples in Rust
- Host: GitHub
- URL: https://github.com/epilys/bitmappers-companion
- Owner: epilys
- License: gpl-3.0
- Created: 2021-11-18T09:22:46.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-28T16:28:14.000Z (about 2 years ago)
- Last Synced: 2024-10-25T11:37:34.815Z (about 2 months ago)
- Topics: bitmap, book, latex, raster, raster-graphics, rust, zine
- Language: Rust
- Homepage:
- Size: 27.2 MB
- Stars: 46
- Watchers: 7
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# A Bitmapper's Companion - zine/book about bitmap drawing algorithms and math with code examples in Rust
A small zine/book written in LaTeX. In progress. See Building section below for how to build.
[View current PDF build here](./build/bitgeom.pdf?raw=true)
Click to show planned contents
1. **Introduction**
- Data representation
- Displaying pixels to your screen
- Bits to byte pixels
- Loading graphics files in Rust
- Including xbm files in Rust
2. **Points And Lines**
- Distance between two points
- Equations of a line
- *Line through a point π = (π₯π, π¦π) and a slope π*
- *Line through two points*
- Distance from a point to a line
- *Using the implicit equation form*
- *Using an πΏ defined by two points π1, π2*
- *Using an πΏ defined by a point ππ and angle Μπ*
- *Find perpendicular to line that passes through given point*
- Angle between two lines
- *Intersection of two lines*
- *Line equidistant from two points*
- *Normal to a line through a point*
3. **Points And Line Segments**
- Drawing a line segment from its two endpoints
- Drawing line segments with width
- Intersection of two line segments
- *Fast intersection of two line segments*
- Points, Lines and Circles
- Equations of a circle
- Bounding circle
4. **Curves other than circles**
- Parametric elliptical arcs
- BΓ©zier curves
5. **Points, Lines and Shapes**
- Union, intersection and difference of polygons
- Centroid of polygon
- Polygon clipping
- Triangle filling
- Flood filling
6. **Vectors, matrices and transformations**
- Rotation of a bitmap
- *Fast 2D Rotation*
- 90Β° Rotation of a bitmap by parallel recursive subdivision
- Magnification/Scaling
- *Smoothing enlarged bitmaps*
- *Stretching lines of bitmaps*
- Mirroring
- Shearing
- *The relationship between shearing factor and angle*
- Projections
7. **Addendum**
- Faster Drawing a line segment from its two endpoints using Sym-
metry
- Joining the ends of two wide line segments together
- Composing monochrome bitmaps with separate alpha channel data
- Orthogonal connection of two points
- Join segments with round corners
- Faster line clipping
- Space-filling Curves
- *Hilbert curve*
- *SierpiΕski curve*
- *Peano curve*
- *Z-order curve*
- *flowsnake curve*
- Dithering
- *Floyd-Steinberg*
- *Atkinson dithering*
- Marching squares## Samples
![cover_sample](./samples/cover_sample.png?raw=true)
![thumb_sample](./samples/thumb_sample.png?raw=true)
Cover
[Thumb index](https://en.wikipedia.org/wiki/Thumb_index) overview
![frontmatter_sample](./samples/frontmatter_sample.png?raw=true)
![frontmatter_sample2](./samples/frontmatter_sample2.png?raw=true)
Frontmattercontents
![page_sample](./samples/page_sample.png?raw=true)
![bezier interactive demo](./samples/bezier_interactive.gif?raw=true)
Page spreadBezier interactive demo
## Building
Run `make` (might need to run it twice), output will be in the `./build` directory.
To run the rust example binaries, first you can inspect them with `ls ./src/bin/`, for example:
```shell
$ ls ./src/bin
atkinsondither.rs
beams.rs
bezierglyph.rs
bezier.rs
boundingcircle.rs
bresenham.rs
distance_between_two_points.rs
floyddither.rs
fonts.rs
hilbert.rs
introduction.rs
rotation.rs
scale.rs
shearing.rs
smooth_scale.rs
xbmtors.rs
zcurve.rs
```Then execute one with `cargo run --bin` for example `cargo run --bin atkinsondither`.