GithubHelp home page GithubHelp logo

avsa242 / libgfxbitmap-spin Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 180 KB

Generic bitmap-oriented graphics library for spin

License: MIT License

propeller mcu bitmap graphics library propeller2 p8x32a p2x8c4m64p spin spin2

libgfxbitmap-spin's Introduction

libgfxbitmap-spin


This is a P8X32A/Propeller, P2X8C4M64P/Propeller 2 library for generic bitmap-oriented drawing routines.

Salient Features

  • Line, Circle (not ellipse), Box, Plot primitives
  • Text rendering (uses terminal.common.spin[2]h to provide str(), hex(), bin(), printf(), etc)
  • Text: 0 or 90 degree-rotated font bitmaps
  • Text: Character cell-level or pixel-level positioning (build-time)
  • Text: Internal or custom user-provided putchar function pointer
  • Copy bitmap to display buffer, with optional offset
  • Copy, cut, scale region
  • Single-pixel scroll up region
  • Integration with most any dot-matrix type display

Requirements

P1/SPIN1:

  • 69 bytes global var RAM for settings, configuration
  • terminal.common.spinh (provided by spin-standard-library)

P2/SPIN2:

  • 69 bytes global var RAM for settings, configuration
  • terminal.common.spin2h (provided by p2-spin-standard-library)

Compiler Compatibility

Processor Language Compiler Backend Status
P1 SPIN1 FlexSpin (6.5.0) Bytecode OK
P1 SPIN1 FlexSpin (6.5.0) Native/PASM OK
P2 SPIN2 FlexSpin (6.5.0) NuCode FTBFS
P2 SPIN2 FlexSpin (6.5.0) Native/PASM2 OK

(other versions or toolchains not listed are not supported, and may or may not work)

Limitations

  • Text rendering is s l o w; needs optimization
  • Region scrolling not implemented fully on 1bpp displays

libgfxbitmap-spin's People

Contributors

avsa242 avatar

Watchers

 avatar  avatar  avatar

libgfxbitmap-spin's Issues

address() should be split into two discrete methods

This really doesn't need to be crammed into one method and should be split into two for simplicity.
Rename address() to set_address() (with alias to the name address so existing code doesn't break) and move the read code to a new method get_address().

EDIT:
The current address() actually lives re-implemented in each display driver. Since it should always operate the same way, move it into the graphics library, too.

set_dims() doesn't account for displays with color depths less than 8bpp

_buff_sz and _bytesperln are calculated based on the assumption that BYTESPERPX is >= 1
Since this can't really be fractional, it isn't calculated quite correctly for displays with bpp < 8 (e.g., monochrome displays like SSD1306).
There probably should be a new divider symbol incorporated into these calculations for these cases.

Finer steps in Scale()

Currently, Scale() only allows scaling a region of the display up, not down, and only by integer amounts.

Scrolling is broken on 1bpp displays

Scrolling a region of the display doesn't currently work for 1bpp drivers, e.g., SSD1306/9, IL3820, Charlieplexed LED matrix
These displays present a somewhat unique problem in that every byte of the display memory actually affects 8 pixels, so it isn't as simple as a bytemove

Rewrite Bitmap() to use x, y coords

Operation would be much more straightforward if parameters were coordinates, rather than (currently) a memory offset within the display buffer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.