MCPcopy Index your code
hub / github.com/epilys/bitmappers-companion

github.com/epilys/bitmappers-companion @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
143 symbols 347 edges 36 files 0 documented · 0% updated 3y agov0.0.0-alpha · 2021-11-18★ 49
What it actually does AI analysis from the code graph — generated when you open this
loading…
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

Click to show planned contents

  1. Introduction
  2. Data representation
  3. Displaying pixels to your screen
  4. Bits to byte pixels
  5. Loading graphics files in Rust
  6. Including xbm files in Rust
  7. Points And Lines
  8. Distance between two points
  9. Equations of a line
    • Line through a point 𝑃 = (𝑥𝑝, 𝑦𝑝) and a slope 𝑚
    • Line through two points
  10. 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
  11. Angle between two lines
    • Intersection of two lines
    • Line equidistant from two points
    • Normal to a line through a point
  12. Points And Line Segments
  13. Drawing a line segment from its two endpoints
  14. Drawing line segments with width
  15. Intersection of two line segments
    • Fast intersection of two line segments
  16. Points, Lines and Circles
  17. Equations of a circle
  18. Bounding circle
  19. Curves other than circles
  20. Parametric elliptical arcs
  21. Bézier curves
  22. Points, Lines and Shapes
  23. Union, intersection and difference of polygons
  24. Centroid of polygon
  25. Polygon clipping
  26. Triangle filling
  27. Flood filling
  28. Vectors, matrices and transformations
  29. Rotation of a bitmap
    • Fast 2D Rotation
  30. 90° Rotation of a bitmap by parallel recursive subdivision
  31. Magnification/Scaling
    • Smoothing enlarged bitmaps
    • Stretching lines of bitmaps
  32. Mirroring
  33. Shearing
    • The relationship between shearing factor and angle
  34. Projections
  35. Addendum
  36. Faster Drawing a line segment from its two endpoints using Sym- metry
  37. Joining the ends of two wide line segments together
  38. Composing monochrome bitmaps with separate alpha channel data
  39. Orthogonal connection of two points
  40. Join segments with round corners
  41. Faster line clipping
  42. Space-filling Curves
    • Hilbert curve
    • Sierpiński curve
    • Peano curve
    • Z-order curve
    • flowsnake curve
  43. Dithering
    • Floyd-Steinberg
    • Atkinson dithering
  44. 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:

$ 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.

Core symbols most depended-on inside this repo

plot_line_width
called by 60
src/lib.rs
draw
called by 44
src/lib.rs
plot
called by 25
src/lib.rs
plot_circle
called by 23
src/lib.rs
get
called by 19
src/lib.rs
write_str
called by 14
src/lib.rs
clear
called by 12
src/lib.rs
distance_between_two_points
called by 12
src/bin/boundingcircle.rs

Shape

Function 94
Method 29
Enum 15
Class 5

Languages

Rust100%

Modules by API surface

src/lib.rs31 symbols
src/bin/roundcorner.rs9 symbols
src/bin/boundingcircle.rs8 symbols
src/bin/bezierweights.rs7 symbols
src/bin/smooth_scale.rs6 symbols
src/bin/bezierglyph.rs6 symbols
src/bin/bezier.rs6 symbols
src/bin/lineintersection.rs5 symbols
src/bin/circle3points.rs5 symbols
src/bin/anglebetweenlines.rs5 symbols
src/bin/squircle.rs4 symbols
src/bin/perpendicularbisector.rs4 symbols

For agents

$ claude mcp add bitmappers-companion \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact