Skip to content

Commit

Permalink
clean up octitions
Browse files Browse the repository at this point in the history
  • Loading branch information
dankamongmen committed Dec 28, 2024
1 parent 5e2dd99 commit b397854
Showing 1 changed file with 33 additions and 61 deletions.
94 changes: 33 additions & 61 deletions src/lib/blit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1006,74 +1006,46 @@ octant_blit(ncplane* nc, int linesize, const void* data, int leny, int lenx,
static const unsigned octitions[128] = {
0,
// one set
E(0),
E(1),
E(2),
E(3),
E(4),
E(5),
E(6),
E(7),
E(0), E(1), E(2), E(3), E(4), E(5), E(6), E(7),
// two set (7 + 6 + 5 + 4 + 3 + 2 + 1 = 28)
E(0) + E(1), E(0) + E(2), E(0) + E(3),
E(0) + E(4), E(0) + E(5), E(0) + E(6),
E(0) + E(7), // 0 + 1...
E(1) + E(2), E(1) + E(3), E(1) + E(4),
E(1) + E(5), E(1) + E(6), E(1) + E(7), // 1 + 2...
E(2) + E(3), E(2) + E(4), E(2) + E(5),
E(2) + E(6), E(2) + E(7), // 2 + 3...
E(3) + E(4), E(3) + E(5), E(3) + E(6),
E(3) + E(7), // 3 + 4...
E(4) + E(5), E(4) + E(6), E(4) + E(7), // 4 + 5...
E(5) + E(6), E(5) + E(7), // 5 + 6...
E(6) + E(7), // 6 + 7
E(0) + E(1), E(0) + E(2), E(0) + E(3), E(0) + E(4), E(0) + E(5), E(0) + E(6), E(0) + E(7),
E(1) + E(2), E(1) + E(3), E(1) + E(4), E(1) + E(5), E(1) + E(6), E(1) + E(7),
E(2) + E(3), E(2) + E(4), E(2) + E(5), E(2) + E(6), E(2) + E(7),
E(3) + E(4), E(3) + E(5), E(3) + E(6), E(3) + E(7),
E(4) + E(5), E(4) + E(6), E(4) + E(7),
E(5) + E(6), E(5) + E(7),
E(6) + E(7),
// three set (21 + 15 + 10 + 6 + 3 + 1 = 56)
E(0) + E(1) + E(2), E(0) + E(1) + E(3), E(0) + E(1) + E(4),
E(0) + E(1) + E(5), E(0) + E(1) + E(6), E(0) + E(1) + E(7), // 0 + 1 + 2...
E(0) + E(2) + E(3), E(0) + E(2) + E(4), E(0) + E(2) + E(5),
E(0) + E(2) + E(6), E(0) + E(2) + E(7), // 0 + 2 + 3...
E(0) + E(3) + E(4), E(0) + E(3) + E(5), E(0) + E(3) + E(6),
E(0) + E(3) + E(7), // 3 + 4...
E(0) + E(4) + E(5), E(0) + E(4) + E(6), E(0) + E(4) + E(7), // 0 + 4 + 5...
E(0) + E(5) + E(6), E(0) + E(5) + E(7), // 0 + 5 + 6...
E(0) + E(1) + E(2), E(0) + E(1) + E(3), E(0) + E(1) + E(4), E(0) + E(1) + E(5),
E(0) + E(1) + E(6), E(0) + E(1) + E(7), E(0) + E(2) + E(3), E(0) + E(2) + E(4),
E(0) + E(2) + E(5), E(0) + E(2) + E(6), E(0) + E(2) + E(7), E(0) + E(3) + E(4),
E(0) + E(3) + E(5), E(0) + E(3) + E(6), E(0) + E(3) + E(7), E(0) + E(4) + E(5),
E(0) + E(4) + E(6), E(0) + E(4) + E(7), E(0) + E(5) + E(6), E(0) + E(5) + E(7),
E(0) + E(6) + E(7), // 0 + 6 + 7
E(1) + E(2) + E(3), E(1) + E(2) + E(4), E(1) + E(2) + E(5),
E(1) + E(2) + E(6), E(1) + E(2) + E(7),
E(1) + E(3) + E(4), E(1) + E(3) + E(5), E(1) + E(3) + E(6),
E(1) + E(3) + E(7),
E(1) + E(4) + E(5), E(1) + E(4) + E(6), E(1) + E(4) + E(7),
E(1) + E(5) + E(6), E(1) + E(5) + E(7),
E(1) + E(6) + E(7),
E(2) + E(3) + E(4), E(2) + E(3) + E(5), E(2) + E(3) + E(6),
E(2) + E(3) + E(7),
E(2) + E(4) + E(5), E(2) + E(4) + E(6), E(2) + E(4) + E(7),
E(2) + E(5) + E(6), E(2) + E(5) + E(7),
E(2) + E(6) + E(7),
E(3) + E(4) + E(5), E(3) + E(4) + E(6), E(3) + E(4) + E(7),
E(3) + E(5) + E(6), E(3) + E(5) + E(7),
E(3) + E(6) + E(7),
E(4) + E(5) + E(6), E(4) + E(5) + E(7),
E(4) + E(6) + E(7),
E(5) + E(6) + E(7), // 5 + 6 + 7
E(1) + E(2) + E(3), E(1) + E(2) + E(4), E(1) + E(2) + E(5), E(1) + E(2) + E(6),
E(1) + E(2) + E(7), E(1) + E(3) + E(4), E(1) + E(3) + E(5), E(1) + E(3) + E(6),
E(1) + E(3) + E(7), E(1) + E(4) + E(5), E(1) + E(4) + E(6), E(1) + E(4) + E(7),
E(1) + E(5) + E(6), E(1) + E(5) + E(7), E(1) + E(6) + E(7),
E(2) + E(3) + E(4), E(2) + E(3) + E(5), E(2) + E(3) + E(6), E(2) + E(3) + E(7),
E(2) + E(4) + E(5), E(2) + E(4) + E(6), E(2) + E(4) + E(7), E(2) + E(5) + E(6),
E(2) + E(5) + E(7), E(2) + E(6) + E(7),
E(3) + E(4) + E(5), E(3) + E(4) + E(6), E(3) + E(4) + E(7), E(3) + E(5) + E(6),
E(3) + E(5) + E(7), E(3) + E(6) + E(7),
E(4) + E(5) + E(6), E(4) + E(5) + E(7), E(4) + E(6) + E(7),
E(5) + E(6) + E(7),
// four set (15 + 10 + 6 + 3 + 1 = 35)
E(0) + E(1) + E(2) + E(3), E(0) + E(1) + E(2) + E(4), E(0) + E(1) + E(2) + E(5),
E(0) + E(1) + E(2) + E(6), E(0) + E(1) + E(2) + E(7),
E(0) + E(1) + E(3) + E(4), E(0) + E(1) + E(3) + E(5), E(0) + E(1) + E(3) + E(6),
E(0) + E(1) + E(3) + E(7),
E(0) + E(1) + E(2) + E(6), E(0) + E(1) + E(2) + E(7), E(0) + E(1) + E(3) + E(4),
E(0) + E(1) + E(3) + E(5), E(0) + E(1) + E(3) + E(6), E(0) + E(1) + E(3) + E(7),
E(0) + E(1) + E(4) + E(5), E(0) + E(1) + E(4) + E(6), E(0) + E(1) + E(4) + E(7),
E(0) + E(1) + E(5) + E(6), E(0) + E(1) + E(5) + E(7),
E(0) + E(1) + E(6) + E(7),
E(0) + E(1) + E(5) + E(6), E(0) + E(1) + E(5) + E(7), E(0) + E(1) + E(6) + E(7),
E(0) + E(2) + E(3) + E(4), E(0) + E(2) + E(3) + E(5), E(0) + E(2) + E(3) + E(6),
E(0) + E(2) + E(3) + E(7),
E(0) + E(2) + E(4) + E(5), E(0) + E(2) + E(4) + E(6), E(0) + E(2) + E(4) + E(7),
E(0) + E(2) + E(5) + E(6), E(0) + E(2) + E(5) + E(7),
E(0) + E(2) + E(6) + E(7),
E(0) + E(3) + E(4) + E(5), E(0) + E(3) + E(4) + E(6), E(0) + E(3) + E(4) + E(7),
E(0) + E(3) + E(5) + E(6), E(0) + E(3) + E(5) + E(7),
E(0) + E(3) + E(6) + E(7),
E(0) + E(4) + E(5) + E(6), E(0) + E(4) + E(5) + E(7),
E(0) + E(4) + E(6) + E(7),
E(0) + E(5) + E(6) + E(7), // 0 + 5 + 6 + 7
E(0) + E(2) + E(3) + E(7), E(0) + E(2) + E(4) + E(5), E(0) + E(2) + E(4) + E(6),
E(0) + E(2) + E(4) + E(7), E(0) + E(2) + E(5) + E(6), E(0) + E(2) + E(5) + E(7),
E(0) + E(2) + E(6) + E(7), E(0) + E(3) + E(4) + E(5), E(0) + E(3) + E(4) + E(6),
E(0) + E(3) + E(4) + E(7), E(0) + E(3) + E(5) + E(6), E(0) + E(3) + E(5) + E(7),
E(0) + E(3) + E(6) + E(7), E(0) + E(4) + E(5) + E(6), E(0) + E(4) + E(5) + E(7),
E(0) + E(4) + E(6) + E(7), E(0) + E(5) + E(6) + E(7),
#undef E
};
return hires_blit(nc, linesize, data, leny, lenx, bargs, 4, octtrans, octitions);
Expand Down

0 comments on commit b397854

Please sign in to comment.