cairotft module.
Small wrapping of linux/fb.h.
double buffering and is not api-compatible anymore with the original module from Kurichan.
It has also been modified for python 3.4 compat’
Bases: _ctypes.Structure
The fb_bitfield struct from fb.h.
Structure/Union member
Structure/Union member
Structure/Union member
Bases: builtins.int
The framebuffer file descriptor.
The name attribute gives the opened framebuffer file.
Bases: builtins.object
The framebuffer memory object.
Bases: _ctypes.Structure
The fb_fix_screeninfo from fb.h.
Structure/Union member
Structure/Union member
Structure/Union member
Structure/Union member
Structure/Union member
Structure/Union member
Structure/Union member
Structure/Union member
Structure/Union member
Structure/Union member
Structure/Union member
Structure/Union member
Structure/Union member
Structure/Union member
Bases: _ctypes.Structure
The fb_var_screeninfo struct from fb.h.
Structure/Union member
Structure/Union member
Structure/Union member
Structure/Union member
Structure/Union member
Structure/Union member
Structure/Union member
Structure/Union member
Structure/Union member
Structure/Union member
Structure/Union member
Structure/Union member
Create a cairo surface from FbMem object.
Parameters: |
|
---|
Return the fix screen info from the framebuffer file descriptor.
Return the var screen info from the framebuffer file descriptor.
Create a memory buffer of buffer_len size.
this memory buffer can be used to create a custom cairo surface for double buffering (or n-buffering)
Parameters: | buffer_len (int) – size of the buffer. |
---|---|
Returns: | the created buffer |
Load an display a svg image in cairo context.
This module is a modified version of the svg_image module from WeasyPrint: https://github.com/Kozea/WeasyPrint/blob/master/weasyprint/images.py#L99
Bases: builtins.ValueError
An error occured when loading an image.
The image data is probably corrupted or in an invalid format.
Bases: builtins.object
SVGImage class.
Initialisation of the class.
Parameters: |
|
---|
You can either provide a base_url, in this case, the file will be loaded, or directly use svg_data with a svg content.
Draw to a cairo surface but do not write to a file.
This is a CairoSVG surface, not a cairo surface.
scale an image always keeping aspect ratio inside the frame.
Parameters: |
|
---|---|
Returns: | a (widht, eight) tuple representing the target size of the object. |
(thanks to jon for this method)
Draw the svg image inside a box of size (width, eight).
This draw methods keeps automatically the aspect ration of the image.
Parameters: |
|
---|
Bases: cairosvg.surface.SVGSurface
Have the cairo Surface object have dimension in px instead of pt.
Create the surface from a filename or a file-like object.
The rendered content is written to output which can be a filename, a file-like object, None (render in memory but do not write anything) or the built-in bytes as a marker.
Call the .finish() method to make sure that the output is actually written.
Class for display on tft using linuxfb.
Bases: builtins.object
Display class for the tft display.
Variables: |
|
---|
Initialisation of the class.
Parameters: |
|
---|
Blank the screen with the given color.
Parameters: |
|
---|
Display the buffer in the screen.
Take the content of the memory buffer and draw it on the screen.
Parameters: | force (bool) – if force is True, force a buffer copy, even in fps mode. |
---|
Transitions classes.
The Transitions are used in animations to calculates new object positions based on some parameters like transition time, transition type, etc...
Idea and implementation is taken from mootools Fx project: https://github.com/mootools/mootools-core/blob/master/Source/Fx/Fx.Transitions.js
see: http://www.chipwreck.de/blog/2010/02/17/mootools-transitions-explained/
Bases: cairotft.transitions.BaseTransition
Back transition.
Back moves the value first in the opposite direction and then moves it in direction of the target value.
Bases: builtins.object
Base class for all transitions.
This class will be subclassed by every transition type.
Method to calculate transition for easeIn display.
Ease in is the default behaviour: Here the function is applied normally.
Method to calculate transition for easeInOut display.
Method to calculate transition for easeOut display.
Ease out inverts the behaviour - so the effect works backwards.
calculate pos based on progress value, progress is between 0 and 1.
Parameters: | progress (float) – the wanted progression of the transition. 0 is the ‘beginning’ of the transition, i.e. 0% of the transition 1 is the ‘end’ of the transition, i.e. 100% of the transition. |
---|
This method is defined in subclasses based on the transition type.
Bases: cairotft.transitions.BaseTransition
Bounce transition.
Bounce is the most complex function - it can’t be described as a simple formula. It first approaches the target value linear and then it oscillates between descreasing intervals, creating a bouncing effect.
Bases: cairotft.transitions.BaseTransition
Circular transition.
The circular transition function describes a perfect circle (in this case a quadrant)
Bases: cairotft.transitions.BaseTransition
Cubic (x^3) transition.
Polynomial (x^n) Transition. For these transition the value will first increase slowly and near the end of the effect it will grow rapidly - like the well-known parabola.
Bases: cairotft.transitions.BaseTransition
Elastic transition.
Elastic oscillates in increasing intervals between the opposite direction and the desired one. It’s best used with ease:out or ease:in:out, otherwise it may happen that effect doesn’t reach its target value.
Bases: cairotft.transitions.BaseTransition
Exponancial transition.
So the function grows even more rapidly towards the end - compared to the x^n-transitions.
Bases: cairotft.transitions.BaseTransition
Simple linear transition.
A linear transition has no additional ease-parameter, since it simply divides the range equally along the timeline.
Bases: cairotft.transitions.BaseTransition
x^6 transition.
Polynomial (x^n) Transition. For these transition the value will first increase slowly and near the end of the effect it will grow rapidly - like the well-known parabola.
Bases: cairotft.transitions.BaseTransition
Quad (x^2) transition.
Polynomial (x^n) Transition. For these transition the value will first increase slowly and near the end of the effect it will grow rapidly - like the well-known parabola.
Bases: cairotft.transitions.BaseTransition
x^4 transition.
Polynomial (x^n) Transition. For these transition the value will first increase slowly and near the end of the effect it will grow rapidly - like the well-known parabola.
Bases: cairotft.transitions.BaseTransition
x^5 transition.
Polynomial (x^n) Transition. For these transition the value will first increase slowly and near the end of the effect it will grow rapidly - like the well-known parabola.
Bases: cairotft.transitions.BaseTransition
Sinus transition.
The sinusiodal transition delivers a graph which behaves like a part of a sine-curve, the result in this case is a smooth, nearly linear transition (see the graph below).