--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi,
Just a note about your first screenshot. What you see is the anti aliasing from your graphics card. And yes it sucks.
There is a lot of alternative for antialiasing vector graphics that give multiple result. None of them is straightforward, and is either harder to integrate into the pipeline, or more heavy at rendering time.
For example, the choice made in the SmoothLinePlot is tedious: if you have 100x line, 100x shader need to be binded, line need to be drawed, and shader unbinded. If you know what you are doing, the best solution is bind the shader once, draw all the line you want, unbind.
Also, SmoothLinePlot works great for this single use case. It would not work if the line width is bigger without a more complex shader. Everything as a limitation.
antialiasing=True doesn't make sense at all. It's like saying beautiful=True. The _method_ matters, and the usage of it have a cost.
My point is, i want to provide a SmoothLine that will encapsulate the line shader and Line instruction. Please take note that the shader require to draw a rectangle with a black/white gradient. The smooth is adjusted depending the gradient width.
It's a complex problem, on which there is no easy solution except if you think per-app.
Mathieu
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Paint.setFlags(Paint.ANTI_ALIAS_FLAG)
from kivy.app import App
from kivy.graphics import Line
from kivy.graphics.texture import Texture
from kivy.uix.widget import Widget
GRADIENT_DATA = (
"\x00\x00\x00\x07\x07\x07\x0f\x0f\x0f\x17\x17\x17\x1f\x1f\x1f"
"'''///777???GGGOOOWWW___gggooowww\x7f\x7f\x7f\x87\x87\x87"
"\x8f\x8f\x8f\x97\x97\x97\x9f\x9f\x9f\xa7\xa7\xa7\xaf\xaf\xaf"
"\xb7\xb7\xb7\xbf\xbf\xbf\xc7\xc7\xc7\xcf\xcf\xcf\xd7\xd7\xd7"
"\xdf\xdf\xdf\xe7\xe7\xe7\xef\xef\xef\xf7\xf7\xf7\xff\xff\xff"
"\xf6\xf6\xf6\xee\xee\xee\xe6\xe6\xe6\xde\xde\xde\xd5\xd5\xd5"
"\xcd\xcd\xcd\xc5\xc5\xc5\xbd\xbd\xbd\xb4\xb4\xb4\xac\xac\xac"
"\xa4\xa4\xa4\x9c\x9c\x9c\x94\x94\x94\x8b\x8b\x8b\x83\x83\x83"
"{{{sssjjjbbbZZZRRRJJJAAA999111))) \x18\x18\x18\x10\x10\x10"
"\x08\x08\x08\x00\x00\x00")
class TestApp(App):
def build(self):
widget = Widget()
# Create texture
tex = Texture.create(size=(1, 64), colorfmt='rgb')
tex.blit_buffer(GRADIENT_DATA, colorfmt='rgb')
# Draw lines with the texture
with widget.canvas:
Line(circle=(200,200,150), close=True, width=1.01, texture=tex)
Line(circle=(300,300,150), close=True, width=1.00, texture=None)
return widget
if __name__ == "__main__":
TestApp().run()