Skip to main content

A component library to support SBC display drivers

Project description

luma.core | luma.docs | luma.emulator | luma.examples | luma.lcd | luma.led_matrix | luma.oled

Luma.Core

https://travis-ci.org/rm-hull/luma.core.svg?branch=master https://coveralls.io/repos/github/rm-hull/luma.core/badge.svg?branch=master https://requires.io/github/rm-hull/luma.core/requirements.svg?branch=master https://img.shields.io/pypi/pyversions/luma.core.svg https://img.shields.io/pypi/v/luma.core.svg https://img.shields.io/maintenance/yes/2019.svg?maxAge=2592000

luma.core is a component library providing a Pillow-compatible drawing canvas, and other functionality to support drawing primitives and text-rendering capabilities for small displays on the Raspberry Pi and other single board computers:

  • scrolling/panning capability,

  • terminal-style printing,

  • state management,

  • color/greyscale (where supported),

  • dithering to monochrome,

  • sprite animation,

  • flexible framebuffering (depending on device capabilities)

Device drivers extend luma.core to provide the correct initialization sequences for specific physical display devices/chipsets.

There are several drivers for different classes of device available:

There are emulators that run in real-time (with pygame) and others that can take screenshots, or assemble animated GIFs, as per the examples below. Source code for these are available in the examples directory of the luma.examples repository.

clock invaders crawl

License

The MIT License (MIT)

Copyright (c) 2017-18 Richard Hull and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Contributing

Pull requests (code changes / documentation / typos / feature requests / setup) are gladly accepted. If you are intending to introduce some large-scale changes, please get in touch first to make sure we’re on the same page: try to include a docstring for any new method or class, and keep method bodies small, readable and PEP8-compliant. Add tests and strive to keep the code coverage levels high.

GitHub

The source code is available to clone at: https://github.com/rm-hull/luma.core

Contributors

  • Thijs Triemstra (@thijstriemstra)

  • Christoph Handel (@fragfutter)

  • @Boeeerb

  • @xes

  • Roger Dahl (@rogerdahl)

  • Václav Šmilauer (@eudoxos)

  • Claus Bjerre (@bjerrep)

  • @bkntrx

  • @7754359337

  • @theraspydev

  • @vortigont

  • Maarten Los (@mlos)

  • Jonathan Pereira (@jonathanrjpereira)

  • Daniel Smullen (@drspangle)

  • Hans Liss (@hansliss)

  • Phil Howard (@gadgetoid)

ChangeLog

Version

Description

Date

1.10.1

  • Fix [Error 22] emitted from within I2C serial adapter when used with SSD1327 device

2019/05/25

1.10.0

  • Allow viewport pseudo-display to dither when rendering to device with lower-fidelity color mode

2019/05/23

1.9.0

  • Improve I2C render speed by not chunking into 32-byte blocks

  • Add support for bridging FTDI to I2C/SPI

2019/05/10

1.8.3

  • Improve command line help output

  • Split API docs into separate pages

2019/01/07

1.8.2

  • Fix type hint for SPI’s cs_high parameter

2018/11/05

1.8.1

  • Mutable string now works over unicode (for both py2/3)

2018/09/18

1.8.0

  • Namespace packaging fix

  • Correct implementation of pkgutil style namespace

  • Support for Python 3.7

  • Docstring updates

2018/09/04

1.7.2

  • Fix upside-down SEG7_FONT

2018/03/29

1.7.1

  • Support unicode in terminal class

2018/03/22

1.7.0

  • Add persist flag on device

2018/03/21

1.6.0

  • Add --spi-transfer-size=... flag in cmdline args

2018/02/21

1.5.0

  • Add SEG7_FONT: Compact 7x3 font for LED Matrix

2018/02/06

1.4.0

  • Add --spi-cs-high=... flag in cmdline args

2018/01/29

1.3.0

  • Add --gpio-mode=... flag in cmdline args

2018/01/02

1.2.1

  • Use extras_require in setup.py for Linux dependencies

2017/11/26

1.2.0

  • Added get_library_version & get_library_for_display_type

2017/11/23

1.1.1

  • Version number available as luma.core.__version__ now

2017/11/23

1.1.0

  • Added image composition classes

2017/10/28

1.0.3

  • Explicitly state ‘UTF-8’ encoding in setup when reading files

2017/10/18

1.0.2

  • Fix conditional install on wheel

2017/09/15

1.0.1

  • Don’t install RPi.GPIO & spidev if setup running on OSX

2017/09/04

1.0.0

  • Stable release (remove all deprecated methods & parameters)

2017/07/29

0.9.5

  • Remove assert in terminal to allow extended characters to be printed (note: this only works for Python3 presently)

2017/07/06

0.9.4

  • Add tolerant class for legacy font handling non-ASCII chars

  • Add CP437 chars to fonts.py

2017/07/01

0.9.3

  • LCD_FONT: lowercase cyrillic chars added, minor corrections in uppercase chars

2017/06/25

0.9.2

  • Add background= option to luma.core.render.canvas

  • Add TCA9548A I2C multiplex scanner (contrib)

  • Display I2C address in hex when error occurs

2017/06/19

0.9.1

  • Add cmdline block orientation of 180

2017/05/01

0.9.0

  • Add word-wrap capability to luma.core.virtual.terminal

  • Bug fix to luma.core.virtual.terminal when scrolling

2017/04/22

0.8.1

  • Propagate segment_mapper through other virtual devices

2017/04/14

0.8.0

  • Migrate seven-segment wrapper from luma.led_matrix

2017/04/14

0.7.5

  • Allow alternative RPi.GPIO implementations

2017/04/09

0.7.4

  • Reduce size of space character in legacy proportional font

2017/04/09

0.7.3

  • Cmdline args now supports backlight active high/low

2017/04/07

0.7.2

  • Add --h-offset=N and --v-offset=N params to cmdline args

2017/04/07

0.7.1

  • Improve formatting in command line options

2017/04/06

0.7.0

  • Add software-based bitbang SPI implementation

  • Cmdline args parsing

  • Use monotonic clock

2017/03/27

0.6.2

  • Move GPIO.setmode() to point when referenced

  • Use regex prefix in ANSI color parser (fixes deprecation warning)

2017/03/19

0.6.1

  • Deprecate spi params

  • Fix resource leak in spritesheet

2017/03/13

0.6.0

  • Terminal supports ANSI Color escape codes

  • Catch & rethrow IOErrors

2017/03/13

0.5.4

  • Rework decorators

2017/03/08

0.5.3

  • Catch & rethrow all RPi.GPIO RuntimeExceptions

2017/03/08

0.5.2

  • Raise error.UnsupportedPlatform if RPi.GPIO is not available

  • Bug fix to luma.core.virtual.terminal to handle multiple \n

2017/03/08

0.5.1

  • Bug fix: legacy.show_message regression

2017/03/05

0.5.0

  • BREAKING CHANGES: Rework framework_regulator class

  • Documentation updates

2017/03/05

0.4.4

  • Bug fix: legacy.show_message off-by-one bug

2017/03/02

0.4.3

  • Restrict exported Python symbols from luma.core.serial

2017/03/02

0.4.2

  • Optional alignment of framebuffer bounding_box to word-boundaries

2017/02/28

0.4.1

  • Refactor framebuffer interface

2017/02/27

0.4.0

  • Add spritesheet and framerate_regulator functionality

  • Add full-frame and diff-to-previous framebuffer implementations

  • Remove unnecessary travis/tox dependencies

2017/02/27

0.3.2

  • Bug fix: legacy.show_message wrong device height

  • Add Cyrillic chars to legacy font

  • Make pytest-runner a conditional requirement

2017/02/24

0.3.1

  • Imported legacy font handling from rm-hull/luma.led_matrix

2017/02/19

0.2.0

  • Fix bug in seven_segment transform (display correct char)

  • Moved emulator code to rm-hull/luma.emulator github repo

2017/02/17

0.1.15

  • Require at least Pillow 4.0.0

  • Configurable transfer_size on SPI writes

  • Documentation updates

2017/02/11

0.1.14

  • Use a more flexible no-op implementation

  • Use spidev’s writebytes() rather than xfer2()

  • Dont write GIF animation if nothing was displayed

  • Attempt to optimize palette when saving GIF animations

2017/02/03

0.1.13

  • Fix bug in setup script

2017/01/23

0.1.12

  • Assert valid SPI bus speed

  • Don’t report errors in shutdown

  • Don’t package as zip-safe

  • Add 7-segment LED emulation transformer

2017/01/21

0.1.11

  • Rejig packaging to include emulator assets

2017/01/20

0.1.3

  • Reset SPI device on initialization

  • Add LED matrix emulation transformer

2017/01/19

0.1.2

  • Namespace packaging

2017/01/10

0.1.0

  • Split out core functionality from rm-hull/ssd1306

2017/01/10

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

luma.core-1.10.1.tar.gz (59.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

luma.core-1.10.1-py2.py3-none-any.whl (51.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file luma.core-1.10.1.tar.gz.

File metadata

  • Download URL: luma.core-1.10.1.tar.gz
  • Upload date:
  • Size: 59.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.7

File hashes

Hashes for luma.core-1.10.1.tar.gz
Algorithm Hash digest
SHA256 904d289eb14dc8202f97f603e2ac96d2dff4a8ffc9ccfaaa72e8de5b73c3aa78
MD5 11e81a2163c0c256e1e82e08a255645b
BLAKE2b-256 84dba9ecbbd450cc3323954469a58675f988d60a9346b4784df03e6285d1f799

See more details on using hashes here.

File details

Details for the file luma.core-1.10.1-py2.py3-none-any.whl.

File metadata

  • Download URL: luma.core-1.10.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 51.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.7

File hashes

Hashes for luma.core-1.10.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 63e5753b079349b94c9ac52484b577a7188d73c55414ea2c171d304d84f55f8e
MD5 40730f70faca04d1cdd0c09bf540720c
BLAKE2b-256 59acad96363087936f713c1c41eef2b3b596415b3b4c9600969f5de016ed875d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page