-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
draw_line function algorithm #24
Comments
Huh, I never thought anyone would try to accelerate libschrift with FPGAs, that's pretty neat. It's important to understand that in TrueType, This means that the problem we have to solve is fundamentally a different one: The traditional algorithm for rasterization of concave polygons is Scanline rendering. Instead, libschrift and others split drawing into two separate steps: When we draw the outline, we can't just directly anti-aliase it. Sean Barrett, the creator of stb_truetype, has written a good explanation of how Note however that Barrett does in fact use scanline rendering to rasterize the outline. Raycasting is a classic and well-understood algorithm as well. You can find a lot of information on the Internet about how 2D raycasting works in https://lodev.org/cgtutor/raycasting.html Hope this helps. |
Thanks for the reply. Actually I am not going to implement the whole lib in hardware. That is really too complicated. Instead the rasterization of straight line is a good start point. In the render_outline function, the points are transformed according to the matrix and curves are simplified to multiple lines. Finally the draw_line and post_process function rasterize the lines to pixel image. I am trying to understand the draw_line and post_process function and doing some hardware acceleration if possible. |
Hi,
I am working on implementing this library on my hardware platform. To get higher performance, I plan to harden some calculation function in FPGA. The function draw_line looks suitable for harden. However, I noticed that the 2d raycasting is customized algorithm. Could you help provide some reference for understanding the algorithm? what's the pros/cons for this algorithm compared to other legacy algorithm such as Xiaolin-Wu algorithm?
Thanks for the help.
The text was updated successfully, but these errors were encountered: