flexablelib-speedups 3.7.4__tar.gz → 3.7.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flexablelib-speedups
3
- Version: 3.7.4
3
+ Version: 3.7.6
4
4
  Summary: Optional C acceleration of terminal frame drawing for flexablelib (cut, pad, borders, frame diffs, images).
5
5
  Home-page: https://github.com/Opus-Perpetuus/flexablelib
6
6
  Author: Benjamin Ramirez
@@ -6,7 +6,7 @@ directly: :mod:`flexablelib._frames` picks it up when it is installed and
6
6
  falls back to identical pure-Python code when it is not.
7
7
  """
8
8
 
9
- __version__ = '3.7.4'
9
+ __version__ = '3.7.6'
10
10
 
11
11
  from . import _frames # noqa: F401,E402
12
12
 
@@ -585,12 +585,13 @@ img_cells(PyObject *self, PyObject *args)
585
585
  Col fg = {0}, bg = {0};
586
586
  if (mode == M_HALF) {
587
587
  if (!solid[0] && !solid[1]) ch = 0x20;
588
- else if (!solid[1]) { ch = 0x2580; fg.set = 1; fg.r = px[0][0]; fg.g = px[0][1]; fg.b = px[0][2]; }
589
- else if (!solid[0]) { ch = 0x2584; fg.set = 1; fg.r = px[1][0]; fg.g = px[1][1]; fg.b = px[1][2]; }
590
588
  else if (mono) {
589
+ /* A transparent half is unlit, like a dark one. */
591
590
  static const unsigned int T[4] = {0x20, 0x2584, 0x2580, 0x2588};
592
- ch = T[(lums[0] >= 128) * 2 + (lums[1] >= 128)];
593
- } else if (px[0][0] == px[1][0] && px[0][1] == px[1][1] && px[0][2] == px[1][2]) {
591
+ ch = T[(solid[0] && lums[0] >= 128) * 2 + (solid[1] && lums[1] >= 128)];
592
+ } else if (!solid[1]) { ch = 0x2580; fg.set = 1; fg.r = px[0][0]; fg.g = px[0][1]; fg.b = px[0][2]; }
593
+ else if (!solid[0]) { ch = 0x2584; fg.set = 1; fg.r = px[1][0]; fg.g = px[1][1]; fg.b = px[1][2]; }
594
+ else if (px[0][0] == px[1][0] && px[0][1] == px[1][1] && px[0][2] == px[1][2]) {
594
595
  ch = 0x2588; fg.set = 1; fg.r = px[0][0]; fg.g = px[0][1]; fg.b = px[0][2];
595
596
  } else {
596
597
  ch = 0x2580;
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flexablelib-speedups
3
- Version: 3.7.4
3
+ Version: 3.7.6
4
4
  Summary: Optional C acceleration of terminal frame drawing for flexablelib (cut, pad, borders, frame diffs, images).
5
5
  Home-page: https://github.com/Opus-Perpetuus/flexablelib
6
6
  Author: Benjamin Ramirez