Skip to content
This repository has been archived by the owner on Aug 6, 2023. It is now read-only.

The predefined braille patterns for canvas is not enough #144

Closed
meteor-lsw opened this issue Mar 14, 2019 · 2 comments
Closed

The predefined braille patterns for canvas is not enough #144

meteor-lsw opened this issue Mar 14, 2019 · 2 comments

Comments

@meteor-lsw
Copy link
Contributor

meteor-lsw commented Mar 14, 2019

Braille Patterns

@fdehau As noted above, we now use one of them to represent blank, and the other eight are used to render on canvas. To sum up, a cell can represent eight points, but a cell can have at most one renderable point at the same time.

This will cause some problems:

  1. The brightness of the rendering results will be different than expected, it will become much darker Add an example of image rendering #141
  2. This will greatly reduce the ability of the canvas to express. In our expectation, every point in the terminal is renderable. We can at most achieve this resolution [(terminal width * 2) x (terminal height * 4)]
  3. When the actual style of the points in the specified cell is not among the eight, we will calculate and convert its coordinates, and approximate the use of one of these eight, which will increase the complexity of the rendering part of the logic. Degree, which also causes distortion of the rendering result
  4. Because the same cell can only be rendered with one point at a time, when multiple adjacent cells are put together, there is a high probability that a large number of consecutive non-renderable areas appear in the canvas, which seems to be a lot of appearance black (default background color) line separates the canvas, which results in poor rendering quality Add an example of image rendering #141

In summary, I hope that we can add more braille patterns for rendering, which should actually be all braille patterns between 0x2800--0x28FF.

@meteor-lsw
Copy link
Contributor Author

@fdehau I don't know if there are some errors or deviations in my understanding and expression.

@fdehau
Copy link
Owner

fdehau commented Mar 17, 2019

The crate is actually using all the available braille patterns. As shown there, bit masks are used to compute the offset from the blank braille pattern and thus find the correct unicode character to represent all the points within the cells. You wouldn't have the rendering result you get if it was not the case. Some of the artifacts seems to be caused by rounding errors on the floats. The discrete nature of braille patterns (there is always space between them) explains the relatively low overall brightness of the picture. I don't think you can achieve a better result using braille patterns.

@fdehau fdehau closed this as completed Mar 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants