Is there a pressure-sensitive, alternative Path
implementation for drawing on a Canvas
?
I want to be able to declare the stroke width or opacity of each point based on a MotionEvent
.
For now, I just want to append straight line segments. However, the pressure-based parameter should be interpolated between the end points of each line segment.
If there is no ready-to-use solution, of course I appreciate any advices leading to a (performance optimized) self-implementation.
The approach I have chosen, can be described as followed:
Disadvantages / potential optimizations:
The alpha value is not been interpolated along the line segment; therefor the steps of the threshold values are visible.
Non-transparent lines resulting from high pressure values now produce the most overlying lines, however, could also be represented by a single one
I wonder whether it is faster
What do you think of my approach? Any suggestions or comments?