Home > GSOC2015, kivy, python > Canvas to handle strokes and stroke processing.

Canvas to handle strokes and stroke processing.

During my milestone 1 period, we came up with 4 new classes for ink processing.
StrokePoint: Class with coordinates x and y. This is the native structure for the StrokeCanvas behavior.
StrokeRect: Logical Rectangle which purpose is to bound a stroke generated in the StrokeCanvas. Provides methods to:
Know if a point is contained in a rectangle.
Know if another rectangle overlap itself.
Stroke: The stroke contains a list of points. The list of points form a line. A stroke have different drawing attributes:
color → change color of Stroke.
width → change the size of the graphic line.
is_highlighter → changes the visibility.
A stroke provides:
get_bounds method to get the enclosed rectangle in which a stroke is.
A StrokeCanvas contains a list of strokes. A StrokeCanvas provides:
Events to access to the strokes created when they are added or removed.
A StrokeCanvas is the visual representation of a Stroke using Lines.
Event to access to the mode when this is changed.

stroke_canvas_kivyThe branch for this can be found at: https://github.com/andnovar/kivy/tree/mpl_kivy and you need the colors from here: https://github.com/andnovar/kivy/tree/colors_in_utils.py although these colors are going to change eventually for more descriptive ones.

Categories: GSOC2015, kivy, python Tags:
  1. No comments yet.
  1. No trackbacks yet.