From f9c507787f11f5d0e1c350295608f27483fa9736 Mon Sep 17 00:00:00 2001 From: Thomas Sommer Date: Thu, 29 Jul 2021 18:27:57 +0200 Subject: [PATCH] rewrite-graphics-API --- src/modm/driver/display/ili9341.hpp | 376 +- src/modm/driver/display/ili9341.lb | 9 +- src/modm/driver/display/ili9341_impl.hpp | 650 ++- ...lel.hpp => ili9341_interface_parallel.hpp} | 42 +- .../driver/display/ili9341_interface_spi.hpp | 178 + src/modm/driver/display/ili9341_register.hpp | 133 + src/modm/driver/display/ili9341_spi.hpp | 110 - src/modm/driver/display/sh1106.hpp | 63 +- src/modm/driver/display/sh1106.lb | 1 + src/modm/driver/display/sh1106_impl.hpp | 77 + src/modm/driver/display/ssd1306.hpp | 70 +- src/modm/driver/display/ssd1306.lb | 2 +- src/modm/driver/display/ssd1306_impl.hpp | 234 +- src/modm/driver/display/ssd1306_register.hpp | 44 +- .../ui/{display => }/character_display.cpp | 0 .../ui/{display => }/character_display.hpp | 0 src/modm/ui/color.cpp | 53 - src/modm/ui/color.hpp | 2 +- .../color/{brightness.hpp => grayscale.hpp} | 32 +- src/modm/ui/color/hsv.hpp | 16 +- src/modm/ui/color/rgb.hpp | 25 +- src/modm/ui/color/rgb565.hpp | 21 +- src/modm/ui/color/rgbhtml.hpp | 1 + src/modm/ui/color_impl.hpp | 85 - src/modm/ui/display/color_graphic_display.hpp | 60 - src/modm/ui/display/font/all_caps_3x5.font | 677 ---- src/modm/ui/display/font/arcade_classic.font | 965 ----- src/modm/ui/display/font/assertion.font | 1637 -------- src/modm/ui/display/font/fixed_width_5x8.font | 965 ----- src/modm/ui/display/font/matrix_8x8.font | 105 - src/modm/ui/display/font/numbers_14x32.font | 345 -- src/modm/ui/display/font/numbers_40x56.font | 591 --- src/modm/ui/display/font/numbers_46x64.font | 666 --- src/modm/ui/display/font/scripto_narrow.font | 860 ---- src/modm/ui/display/font/ubuntu_36.font | 3557 ----------------- src/modm/ui/display/graphic_display.cpp | 292 -- src/modm/ui/display/graphic_display.hpp | 459 --- src/modm/ui/display/graphic_display_fill.cpp | 55 - src/modm/ui/display/graphic_display_text.cpp | 134 - src/modm/ui/display/image/home_16x16.pbm | 7 - .../ui/display/image/logo_eurobot_90x64.pbm | 86 - src/modm/ui/display/image/logo_rca_90x64.pbm | 86 - src/modm/ui/display/image/skull_64x64.pbm | 62 - src/modm/ui/display/module.lb | 54 - .../ui/display/monochrome_graphic_display.hpp | 85 - .../monochrome_graphic_display_horizontal.hpp | 58 - ...chrome_graphic_display_horizontal_impl.hpp | 40 - .../monochrome_graphic_display_impl.hpp | 27 - .../monochrome_graphic_display_vertical.hpp | 73 - ...nochrome_graphic_display_vertical_impl.hpp | 124 - .../ui/display/virtual_graphic_display.cpp | 62 - .../ui/display/virtual_graphic_display.hpp | 71 - src/modm/ui/{display => }/font.hpp | 0 .../ui/{display => }/font/SConscript.generate | 0 .../ui/{display => }/font/all_caps_3x5.cpp | 0 .../ui/{display => }/font/all_caps_3x5.hpp | 0 .../ui/{display => }/font/arcade_classic.cpp | 0 .../ui/{display => }/font/arcade_classic.hpp | 0 src/modm/ui/{display => }/font/assertion.cpp | 0 src/modm/ui/{display => }/font/assertion.hpp | 0 .../ui/{display => }/font/fixed_width_5x8.cpp | 0 .../ui/{display => }/font/fixed_width_5x8.hpp | 0 src/modm/ui/font/font.lb | 27 + src/modm/ui/{display => }/font/matrix_8x8.cpp | 0 src/modm/ui/{display => }/font/matrix_8x8.hpp | 0 .../ui/{display => }/font/numbers_14x32.cpp | 0 .../ui/{display => }/font/numbers_14x32.hpp | 0 .../ui/{display => }/font/numbers_40x56.cpp | 0 .../ui/{display => }/font/numbers_40x56.hpp | 0 .../ui/{display => }/font/numbers_46x64.cpp | 0 .../ui/{display => }/font/numbers_46x64.hpp | 0 .../ui/{display => }/font/scripto_narrow.cpp | 0 .../ui/{display => }/font/scripto_narrow.hpp | 0 src/modm/ui/{display => }/font/ubuntu_36.cpp | 0 src/modm/ui/{display => }/font/ubuntu_36.hpp | 0 src/modm/ui/{display.hpp => graphic.hpp} | 10 +- src/modm/ui/graphic/buffer.hpp | 148 + src/modm/ui/graphic/buffer_bool.hpp | 124 + src/modm/ui/graphic/buffer_bool_impl.hpp | 371 ++ src/modm/ui/graphic/buffer_impl.hpp | 193 + src/modm/ui/graphic/canvas.hpp | 100 + src/modm/ui/graphic/composition_canvas.hpp | 0 src/modm/ui/graphic/display.hpp | 79 + src/modm/ui/graphic/graphic.lb | 31 + src/modm/ui/graphic/graphic.md | 33 + src/modm/ui/graphic/painter_flash.hpp | 48 + src/modm/ui/graphic/painter_local.hpp | 65 + src/modm/ui/graphic/painter_local_impl.hpp | 351 ++ src/modm/ui/graphic/painter_remote.hpp | 69 + src/modm/ui/graphic/painter_remote_impl.hpp | 387 ++ src/modm/ui/graphic/painter_text.hpp | 138 + src/modm/ui/graphic/painter_text_impl.hpp | 105 + src/modm/ui/{gui.hpp => graphic/style.hpp} | 21 +- src/modm/ui/{display => }/image.hpp | 0 .../{display => }/image/SConscript.generate | 0 .../ui/{display => }/image/home_16x16.cpp | 0 .../ui/{display => }/image/home_16x16.hpp | 0 src/modm/ui/image/image.lb | 27 + .../image/logo_eurobot_90x64.cpp | 0 .../image/logo_eurobot_90x64.hpp | 0 .../ui/{display => }/image/logo_rca_90x64.cpp | 0 .../ui/{display => }/image/logo_rca_90x64.hpp | 0 .../ui/{display => }/image/skull_64x64.cpp | 0 .../ui/{display => }/image/skull_64x64.hpp | 0 src/modm/ui/shape.hpp | 27 + src/modm/ui/shape/area.cpp | 14 + src/modm/ui/shape/area.hpp | 66 + src/modm/ui/shape/circle.cpp | 10 + src/modm/ui/shape/circle.hpp | 45 + src/modm/ui/shape/ellipse..cpp | 9 + src/modm/ui/shape/ellipse.hpp | 38 + src/modm/ui/shape/line.hpp | 104 + src/modm/ui/shape/point.hpp | 36 + src/modm/ui/shape/rectangle.cpp | 14 + src/modm/ui/shape/rectangle.hpp | 55 + src/modm/ui/shape/shape.hpp | 25 + src/modm/ui/shape/shape.lb | 28 + src/modm/ui/shape/triangle.hpp | 25 + 118 files changed, 3947 insertions(+), 13303 deletions(-) rename src/modm/driver/display/{ili9341_parallel.hpp => ili9341_interface_parallel.hpp} (63%) create mode 100644 src/modm/driver/display/ili9341_interface_spi.hpp create mode 100644 src/modm/driver/display/ili9341_register.hpp delete mode 100644 src/modm/driver/display/ili9341_spi.hpp create mode 100644 src/modm/driver/display/sh1106_impl.hpp rename src/modm/ui/{display => }/character_display.cpp (100%) rename src/modm/ui/{display => }/character_display.hpp (100%) delete mode 100644 src/modm/ui/color.cpp rename src/modm/ui/color/{brightness.hpp => grayscale.hpp} (66%) delete mode 100644 src/modm/ui/color_impl.hpp delete mode 100644 src/modm/ui/display/color_graphic_display.hpp delete mode 100644 src/modm/ui/display/font/all_caps_3x5.font delete mode 100644 src/modm/ui/display/font/arcade_classic.font delete mode 100644 src/modm/ui/display/font/assertion.font delete mode 100644 src/modm/ui/display/font/fixed_width_5x8.font delete mode 100644 src/modm/ui/display/font/matrix_8x8.font delete mode 100644 src/modm/ui/display/font/numbers_14x32.font delete mode 100644 src/modm/ui/display/font/numbers_40x56.font delete mode 100644 src/modm/ui/display/font/numbers_46x64.font delete mode 100644 src/modm/ui/display/font/scripto_narrow.font delete mode 100644 src/modm/ui/display/font/ubuntu_36.font delete mode 100644 src/modm/ui/display/graphic_display.cpp delete mode 100644 src/modm/ui/display/graphic_display.hpp delete mode 100644 src/modm/ui/display/graphic_display_fill.cpp delete mode 100644 src/modm/ui/display/graphic_display_text.cpp delete mode 100644 src/modm/ui/display/image/home_16x16.pbm delete mode 100644 src/modm/ui/display/image/logo_eurobot_90x64.pbm delete mode 100644 src/modm/ui/display/image/logo_rca_90x64.pbm delete mode 100644 src/modm/ui/display/image/skull_64x64.pbm delete mode 100644 src/modm/ui/display/module.lb delete mode 100644 src/modm/ui/display/monochrome_graphic_display.hpp delete mode 100644 src/modm/ui/display/monochrome_graphic_display_horizontal.hpp delete mode 100644 src/modm/ui/display/monochrome_graphic_display_horizontal_impl.hpp delete mode 100644 src/modm/ui/display/monochrome_graphic_display_impl.hpp delete mode 100644 src/modm/ui/display/monochrome_graphic_display_vertical.hpp delete mode 100644 src/modm/ui/display/monochrome_graphic_display_vertical_impl.hpp delete mode 100644 src/modm/ui/display/virtual_graphic_display.cpp delete mode 100644 src/modm/ui/display/virtual_graphic_display.hpp rename src/modm/ui/{display => }/font.hpp (100%) rename src/modm/ui/{display => }/font/SConscript.generate (100%) rename src/modm/ui/{display => }/font/all_caps_3x5.cpp (100%) rename src/modm/ui/{display => }/font/all_caps_3x5.hpp (100%) rename src/modm/ui/{display => }/font/arcade_classic.cpp (100%) rename src/modm/ui/{display => }/font/arcade_classic.hpp (100%) rename src/modm/ui/{display => }/font/assertion.cpp (100%) rename src/modm/ui/{display => }/font/assertion.hpp (100%) rename src/modm/ui/{display => }/font/fixed_width_5x8.cpp (100%) rename src/modm/ui/{display => }/font/fixed_width_5x8.hpp (100%) create mode 100644 src/modm/ui/font/font.lb rename src/modm/ui/{display => }/font/matrix_8x8.cpp (100%) rename src/modm/ui/{display => }/font/matrix_8x8.hpp (100%) rename src/modm/ui/{display => }/font/numbers_14x32.cpp (100%) rename src/modm/ui/{display => }/font/numbers_14x32.hpp (100%) rename src/modm/ui/{display => }/font/numbers_40x56.cpp (100%) rename src/modm/ui/{display => }/font/numbers_40x56.hpp (100%) rename src/modm/ui/{display => }/font/numbers_46x64.cpp (100%) rename src/modm/ui/{display => }/font/numbers_46x64.hpp (100%) rename src/modm/ui/{display => }/font/scripto_narrow.cpp (100%) rename src/modm/ui/{display => }/font/scripto_narrow.hpp (100%) rename src/modm/ui/{display => }/font/ubuntu_36.cpp (100%) rename src/modm/ui/{display => }/font/ubuntu_36.hpp (100%) rename src/modm/ui/{display.hpp => graphic.hpp} (70%) create mode 100644 src/modm/ui/graphic/buffer.hpp create mode 100644 src/modm/ui/graphic/buffer_bool.hpp create mode 100644 src/modm/ui/graphic/buffer_bool_impl.hpp create mode 100644 src/modm/ui/graphic/buffer_impl.hpp create mode 100644 src/modm/ui/graphic/canvas.hpp create mode 100644 src/modm/ui/graphic/composition_canvas.hpp create mode 100644 src/modm/ui/graphic/display.hpp create mode 100644 src/modm/ui/graphic/graphic.lb create mode 100644 src/modm/ui/graphic/graphic.md create mode 100644 src/modm/ui/graphic/painter_flash.hpp create mode 100644 src/modm/ui/graphic/painter_local.hpp create mode 100644 src/modm/ui/graphic/painter_local_impl.hpp create mode 100644 src/modm/ui/graphic/painter_remote.hpp create mode 100644 src/modm/ui/graphic/painter_remote_impl.hpp create mode 100644 src/modm/ui/graphic/painter_text.hpp create mode 100644 src/modm/ui/graphic/painter_text_impl.hpp rename src/modm/ui/{gui.hpp => graphic/style.hpp} (57%) rename src/modm/ui/{display => }/image.hpp (100%) rename src/modm/ui/{display => }/image/SConscript.generate (100%) rename src/modm/ui/{display => }/image/home_16x16.cpp (100%) rename src/modm/ui/{display => }/image/home_16x16.hpp (100%) create mode 100644 src/modm/ui/image/image.lb rename src/modm/ui/{display => }/image/logo_eurobot_90x64.cpp (100%) rename src/modm/ui/{display => }/image/logo_eurobot_90x64.hpp (100%) rename src/modm/ui/{display => }/image/logo_rca_90x64.cpp (100%) rename src/modm/ui/{display => }/image/logo_rca_90x64.hpp (100%) rename src/modm/ui/{display => }/image/skull_64x64.cpp (100%) rename src/modm/ui/{display => }/image/skull_64x64.hpp (100%) create mode 100644 src/modm/ui/shape.hpp create mode 100644 src/modm/ui/shape/area.cpp create mode 100644 src/modm/ui/shape/area.hpp create mode 100644 src/modm/ui/shape/circle.cpp create mode 100644 src/modm/ui/shape/circle.hpp create mode 100644 src/modm/ui/shape/ellipse..cpp create mode 100644 src/modm/ui/shape/ellipse.hpp create mode 100644 src/modm/ui/shape/line.hpp create mode 100644 src/modm/ui/shape/point.hpp create mode 100644 src/modm/ui/shape/rectangle.cpp create mode 100644 src/modm/ui/shape/rectangle.hpp create mode 100644 src/modm/ui/shape/shape.hpp create mode 100644 src/modm/ui/shape/shape.lb create mode 100644 src/modm/ui/shape/triangle.hpp diff --git a/src/modm/driver/display/ili9341.hpp b/src/modm/driver/display/ili9341.hpp index b5cbc2e4de..ce3449b6d1 100644 --- a/src/modm/driver/display/ili9341.hpp +++ b/src/modm/driver/display/ili9341.hpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2019, Mike Wolfram + * Copyright (c) 2021, Thomas Sommer * * This file is part of the modm project. * @@ -13,295 +14,152 @@ #include #include -#include #include -#include +#include + +#include +#include +#include +// #include + +#include "ili9341_interface_parallel.hpp" +#include "ili9341_interface_spi.hpp" + +using namespace modm::shape; namespace modm { /// @ingroup modm_driver_ili9341 -struct ili9341 +template> +class Ili9341 + : public Interface, + // : public RemotePainter, Interface>, + public Display, Resolution<320, 240>>, + public FlashPainter +// TODO LocalPainter must be available so we can Paint directly on ili9341 +// class Ili9341 : public Interface, public Display, 320, 240>, public LocalPainter<320, 240> { -protected: - /// @cond - enum class - Command : uint8_t - { - // common commands - Nop = 0x00, - SwReset = 0x01, - ReadID = 0x04, - ReadStatus = 0x09, - ReadPowerMode = 0x0a, - ReadMemoryAccessCtrl = 0x0b, - ReadPixelFormat = 0x0c, - ReadImageFormat = 0x0d, - ReadSignalMode = 0x0e, - ReadSelfDiagnostic = 0x0f, - EnterSleep = 0x10, - LeaveSleep = 0x11, - PartialMode = 0x12, - NormalMode = 0x13, - InversionOff = 0x20, - InversionOn = 0x21, - GammaSet = 0x26, - DisplayOff = 0x28, - DisplayOn = 0x29, - ColumnAddressSet = 0x2a, - PageAddressSet = 0x2b, - MemoryWrite = 0x2c, - ColorSet = 0x2d, - MemoryRead = 0x2e, - PartialArea = 0x30, - VerticalScrollDefinition = 0x33, - TearingEffectOff = 0x34, - TearingEffectOn = 0x35, - MemoryAccessCtrl = 0x36, - VerticalScrollStartAddr = 0x37, - IdleModeOff = 0x38, - IdleModeOn = 0x39, - PixelFormatSet = 0x3a, - WriteMemoryContinue = 0x3c, - ReadMemoryContinue = 0x3e, - SetTearScanLine = 0x44, - GetScanLine = 0x45, - WriteBrightness = 0x51, - ReadBrightness = 0x52, - WriteCtrlDisplay = 0x53, - ReadCtrlDisplay = 0x54, - WriteContentAdaptiveBrightnessCtrl = 0x55, - ReadContentAdaptiveBrightnessCtrl = 0x56, - WriteCabcMinimumBrightness = 0x5e, - ReadCabcMinimumBrightness = 0x5f, - ReadId1 = 0xda, - ReadId2 = 0xdb, - ReadId3 = 0xdc, - // extended commands - RgbInterfaceSignalCtrl = 0xb0, - FrameCtrlNormalMode = 0xb1, - FrameCtrlIdleMode = 0xb2, - FrameCtrlPartialMode = 0xb3, - InversionCtrl = 0xb4, - BlankingPorchCtrl = 0xb5, - DisplayFunctionCtrl = 0xb6, - EntryModeSet = 0xb7, - BacklightCtrl1 = 0xb8, - BacklightCtrl2 = 0xb9, - BacklightCtrl3 = 0xba, - BacklightCtrl4 = 0xbb, - BacklightCtrl5 = 0xbc, - BacklightCtrl7 = 0xbe, - BacklightCtrl8 = 0xbf, - PowerCtrl1 = 0xc0, - PowerCtrl2 = 0xc1, - VComCtrl1 = 0xc5, - VComCtrl2 = 0xc7, - PowerCtrlA = 0xcb, - PowerCtrlB = 0xcf, - NvMemoryWrite = 0xd0, - NvMemoryProtectionKey = 0xd1, - NvMemoryStatus = 0xd2, - ReadId4 = 0xd3, - PositiveGammaCorrection = 0xe0, - NegativeGammaCorrection = 0xe1, - DigitalGammaCtrl = 0xe2, - TimingCtrlA = 0xe8, - TimingCtrlB = 0xea, - PowerOnSequenceCtrl = 0xed, - Enable3Gamma = 0xf2, - InterfaceCtrl = 0xf6, - PumpRatioCtrl = 0xf7, - }; - static constexpr uint8_t i(Command command) { return uint8_t(command); } - - enum class - MemoryAccessCtrl : uint8_t - { - MY = modm::Bit7, - MX = modm::Bit6, - MV = modm::Bit5, - ML = modm::Bit4, - BGR = modm::Bit3, - MH = modm::Bit2 - }; - MODM_FLAGS8(MemoryAccessCtrl); - /// @endcond + static_assert(RB::H % 8 == 0, "Height of BufferResolution must be multiple of 8"); -public: - enum class - DisplayMode : uint8_t - { - Normal = uint8_t(Command::InversionOff), - Inverted = uint8_t(Command::InversionOn) - }; -}; - -/// @ingroup modm_driver_ili9341 -template -class Ili9341 : public Interface, public modm::ColorGraphicDisplay -{ - static_assert(BufferSize >= 16, "at least a small buffer is required"); + using Toggle = ili9341_register::Toggle; + using ReadWrite = ili9341_register::ReadWrite; + using Command = ili9341_register::Command; + using ReadCommand = ili9341_register::ReadCommand; - static constexpr uint16_t Width = 240; - static constexpr uint16_t Height = 320; - using BatchHandle = typename Interface::BatchHandle; - using Command = ili9341::Command; public: - using Orientation = glcd::Orientation; - using DisplayMode = ili9341::DisplayMode; - template - Ili9341(Args&&... args): Interface(std::forward(args)...) - { - Reset::setOutput(modm::Gpio::High); - Backlight::setOutput(modm::Gpio::Low); - } + Ili9341(Args &&...args) : + Interface(std::forward(args)...), + Display, Resolution<320, 240>>(color::html::White) + { Reset::setOutput(modm::Gpio::High); } - void + ~Ili9341(){}; + + modm::ResumableResult initialize(); - void + modm::ResumableResult reset(bool hardReset = false); - uint16_t + modm::ResumableResult getIcModel(); - void - turnOn(); - - void - turnOff(); - - void - enableBacklight(bool enable) - { Backlight::set(enable); } - - void - setBrightness(uint8_t level); - - void - setInvert(bool invert); - - void - setIdle(bool enable); - - void - enableSleep(bool enable); - - uint16_t - getWidth() const final - { - switch (orientation) - { - case Orientation::Portrait90: - case Orientation::Portrait270: - return Height; - default: - return Width; - } - } - - uint16_t - getHeight() const final - { - switch (orientation) - { - case Orientation::Portrait90: - case Orientation::Portrait270: - return Width; - default: - return Height; - } - } - - inline std::size_t - getBufferWidth() const final - { - return Width; - } - - inline std::size_t - getBufferHeight() const final - { - return Height; - } - - void - setPixel(int16_t x, int16_t y) final - { setColoredPixel(x, y, foregroundColor); } - - void - clearPixel(int16_t x, int16_t y) final - { setColoredPixel(x, y, backgroundColor); } - - // TODO implement getPixel for ili9341 - color::Rgb565 - getPixel(int16_t x, int16_t y) const final - { - (void) x; - (void) y; - return modm::color::html::White; - } - - void - clear() final; - - inline void - update() final - { /* nothing to do, data is directly written to TFT RAM */ } - - inline void - setOrientation(glcd::Orientation orientation); - - void - fillRectangle(glcd::Point upperLeft, uint16_t width, uint16_t height); - - inline void - fillRectangle(int16_t x, int16_t y, uint16_t width, uint16_t height) - { fillRectangle(glcd::Point(x, y), width, height); } - - void - fillCircle(glcd::Point center, uint16_t radius); - - void - drawImageRaw(glcd::Point upperLeft, - uint16_t width, uint16_t height, - modm::accessor::Flash data) final; - - void - drawRaw(glcd::Point upperLeft, uint16_t width, uint16_t height, color::Rgb565* data); - - void + /* modm::ResumableResult + getStatus(); // 5 bytes, Datasheet P92 + + modm::ResumableResult + getPowerMode(); // 2 bytes, Datasheet P94 + + modm::ResumableResult + getMadCtl(); // 2 bytes, Datasheet P95 + + modm::ResumableResult + getPixelFormat(); // 2 bytes, Datasheet P96 */ + + modm::ResumableResult + set(Toggle toggle, bool state); + + modm::ResumableResult + set(ReadWrite reg, uint8_t value); + + modm::ResumableResult + get(ReadWrite reg); + + modm::ResumableResult + setOrientation(display::Orientation orientation); + + modm::ResumableResult setScrollArea(uint16_t topFixedRows, uint16_t bottomFixedRows, uint16_t firstRow); - void + modm::ResumableResult scrollTo(uint16_t row); - void - drawBitmap(glcd::Point upperLeft, uint16_t width, uint16_t height, modm::accessor::Flash data); + // Write buffer of same colorspace like Display - (uses {0, 0} as position) + template + modm::ResumableResult + writeBuffer(const Buffer, R, Painter> &buffer); -protected: - void - drawHorizontalLine(glcd::Point start, uint16_t length) final; + // Write buffer of same colorspace like Display to specific position + template + modm::ResumableResult + writeBuffer(const Buffer, R, Painter> &buffer, + Point topLeft); - void - drawVerticalLine(glcd::Point start, uint16_t length) final; + // Write buffer of different colorspace - (uses {0, 0} as position) -private: - void - setColoredPixel(int16_t x, int16_t y, color::Rgb565 const &color); + // There's no real advantage for short version due to the heavy conversions. + // Therefore writeBuffer(&buffer, pos = {0, 0}) kicks in instead - void - setClipping(uint16_t x, uint16_t y, uint16_t width, uint16_t height); + // Write buffer of different colorspace to specific position + template + modm::ResumableResult + writeBuffer(const Buffer &buffer, Point origin = {0, 0}); - Orientation orientation{Orientation::Landscape0}; + modm::ResumableResult + drawFlash(modm::accessor::Flash data, + uint16_t width, uint16_t height, shape::Point origin) final; - uint8_t buffer[BufferSize * 2]{0}; + modm::ResumableResult clear(color::Rgb565 color = html::Black); + +protected: + modm::ResumableResult setClipping(Point point); + modm::ResumableResult setClipping(Area area); + + // TODO Add final as soon as RemotePainter is connected + // Hardware accelerated drawing directly on the screen + modm::ResumableResult drawFast(Point point); + modm::ResumableResult drawFast(HLine hline); + modm::ResumableResult drawFast(VLine vline); + modm::ResumableResult drawFast(Area area); + + // "Local" variables, required for resumable functions + union { + // Buffers for commands & configuration + uint8_t buff_cmd8[15]; + uint16_t buff_cmd16[3]; + ili9341_register::MemoryAccessCtrl_t madCtrl; + + // Parallel use in resumable function: don't overlap! + struct { + // Buffer for color conversion + modm::Buffer, RB> bufferRgb565; + Point bufferRgb565_pos; + Area intersection; + // Buffer for clipping command + uint16_t buff_clipping[2]; + + modm::color::Rgb565 color_temp; + union { + uint16_t write_height; + uint32_t write_pixels; + }; + } p; // p for parallel + }; }; -} // namespace modm +} // namespace modm #include "ili9341_impl.hpp" -#endif // MODM_ILI9341_HPP +#endif // MODM_ILI9341_HPP diff --git a/src/modm/driver/display/ili9341.lb b/src/modm/driver/display/ili9341.lb index 63333894e3..3a17db0867 100644 --- a/src/modm/driver/display/ili9341.lb +++ b/src/modm/driver/display/ili9341.lb @@ -15,16 +15,19 @@ def init(module): module.name = ":driver:ili9341" module.description = "ILI9341 Display with parallel and SPI bus transports" + def prepare(module, options): module.depends( ":architecture:delay", ":architecture:spi.device", - ":ui:display") + ":ui:graphic") return True + def build(env): env.outbasepath = "modm/src/modm/driver/display" env.copy("ili9341.hpp") + env.copy("ili9341_register.hpp") env.copy("ili9341_impl.hpp") - env.copy("ili9341_spi.hpp") - env.copy("ili9341_parallel.hpp") + env.copy("ili9341_interface_spi.hpp") + env.copy("ili9341_interface_parallel.hpp") diff --git a/src/modm/driver/display/ili9341_impl.hpp b/src/modm/driver/display/ili9341_impl.hpp index d44ce85c69..8a3d8266d4 100644 --- a/src/modm/driver/display/ili9341_impl.hpp +++ b/src/modm/driver/display/ili9341_impl.hpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2019, Mike Wolfram + * Copyright (c) 2021, Thomas Sommer * * This file is part of the modm project. * @@ -9,432 +10,405 @@ */ #ifndef MODM_ILI9341_HPP -# error "Don't include this file directly, use 'ili9341.hpp' instead!" +#error "Don't include this file directly, use 'ili9341.hpp' instead!" #endif -namespace modm -{ +using namespace modm::shape; + +#define MODM_INIT_BUFFER(...) {\ + constexpr uint8_t data[]__VA_ARGS__;\ + std::copy(std::begin(data), std::end(data), std::begin(buff_cmd8));\ + } -template -void -Ili9341::initialize() +template +modm::ResumableResult +modm::Ili9341::initialize() { - constexpr uint8_t pwrCtrlA[] { 0x39, 0x2c, 0x00, 0x34, 0x02 }; - constexpr uint8_t pwrCtrlB[] { 0x00, 0xc1, 0x30 }; - constexpr uint8_t timCtrlA[] { 0x85, 0x10, 0x7a }; - constexpr uint8_t timCtrlB[] { 0x00, 0x00 }; - constexpr uint8_t pwrOnSeqCtrl[] { 0x64, 0x03, 0x12, 0x81 }; - constexpr uint8_t pwrCtrl1[] { 0x1b }; - constexpr uint8_t pwrCtrl2[] { 0x12 }; - constexpr uint8_t vcomCtrl1[] { 0x08, 0x26 };//0x3e, 0x28 }; - constexpr uint8_t vcomCtrl2[] { 0xb7 }; + RF_BEGIN(); + RF_CALL(reset()); + RF_CALL(set(Toggle::Enable, false)); + + MODM_INIT_BUFFER({0x39, 0x2c, 0x00, 0x34, 0x02}) + RF_CALL(this->writeCommand(Command::PowerCtrlA, buff_cmd8, 5)); + + MODM_INIT_BUFFER({0x00, 0xc1, 0x30}) + RF_CALL(this->writeCommand(Command::PowerCtrlB, buff_cmd8, 3)); + + MODM_INIT_BUFFER({0x85, 0x10, 0x7a}) + RF_CALL(this->writeCommand(Command::TimingCtrlA, buff_cmd8, 3)); + + MODM_INIT_BUFFER({0x00, 0x00}) + RF_CALL(this->writeCommand(Command::TimingCtrlB, buff_cmd8, 2)); + + MODM_INIT_BUFFER({0x64, 0x03, 0x12, 0x81}) + RF_CALL(this->writeCommand(Command::PowerOnSequenceCtrl, buff_cmd8, 4)); + + RF_CALL(this->writeCommand(Command::PowerCtrl1, 0x1b)); + RF_CALL(this->writeCommand(Command::PowerCtrl2, 0x12)); + + MODM_INIT_BUFFER({0x08, 0x26}) // 0x3e, 0x28 }; + RF_CALL(this->writeCommand(Command::VComCtrl1, buff_cmd8, 2)); + + RF_CALL(this->writeCommand(Command::VComCtrl2, 0xb7)); // constexpr uint8_t pumpRatioCtrl[] { 0x20 }; - constexpr uint8_t pixelFormat[] { 0x55 }; - constexpr uint8_t frameCtrl[] { 0x00, 0x1a }; - constexpr uint8_t dispFuncCtrl[] { 0x0a, 0xa2, 0x27, 00 };//{ 0x08, 0x82, 0x27, 0x00 }; - constexpr uint8_t enable3G[] { 0x00 }; - constexpr uint8_t gammaSet[] { 0x01 }; -// constexpr uint8_t positiveGammaCorr[] { 0x0f, 0x31, 0x2b, 0x0c, 0x0e, 0x08, -// 0xe4, 0xf1, 0x37, 0x07, 0x10, 0x03, 0x0e, 0x09, 0x00 }; -// constexpr uint8_t negativeGammaCorr[] { 0x00, 0x0e, 0x14, 0x03, 0x11, 0x07, -// 0x31, 0xc1, 0x48, 0x08, 0x0f, 0x0c, 0x31, 0x36, 0x0f }; - constexpr uint8_t positiveGammaCorr[] { 0x0f, 0x1d, 0x1a, 0x0a, 0x0d, 0x07, - 0x49, 0x66, 0x3b, 0x07, 0x11, 0x01, 0x09, 0x05, 0x04 }; - constexpr uint8_t negativeGammaCorr[] { 0x00, 0x18, 0x1d, 0x02, 0x0f, 0x04, - 0x36, 0x13, 0x4c, 0x07, 0x13, 0x0f, 0x2e, 0x2f, 0x05 }; - - reset(); + RF_CALL(this->writeCommand(Command::PixelFormatSet, 0x55)); - { - BatchHandle h(*this); - - this->writeCommand(Command::DisplayOff); - - this->writeCommand(Command::PowerCtrlA, pwrCtrlA, sizeof(pwrCtrlA)); - this->writeCommand(Command::PowerCtrlB, pwrCtrlB, sizeof(pwrCtrlB)); - this->writeCommand(Command::TimingCtrlA, timCtrlA, sizeof(timCtrlA)); - this->writeCommand(Command::TimingCtrlB, timCtrlB, sizeof(timCtrlB)); - this->writeCommand(Command::PowerOnSequenceCtrl, pwrOnSeqCtrl, sizeof(pwrOnSeqCtrl)); - this->writeCommand(Command::PowerCtrl1, pwrCtrl1, sizeof(pwrCtrl1)); - this->writeCommand(Command::PowerCtrl2, pwrCtrl2, sizeof(pwrCtrl2)); - this->writeCommand(Command::VComCtrl1, vcomCtrl1, sizeof(vcomCtrl1)); - this->writeCommand(Command::VComCtrl2, vcomCtrl2, sizeof(vcomCtrl2)); - this->writeCommand(Command::PixelFormatSet, pixelFormat, sizeof(pixelFormat)); - this->writeCommand(Command::FrameCtrlNormalMode, frameCtrl, sizeof(frameCtrl)); - this->writeCommand(Command::DisplayFunctionCtrl, dispFuncCtrl, sizeof(dispFuncCtrl)); - this->writeCommand(Command::Enable3Gamma, enable3G, sizeof(enable3G)); - this->writeCommand(Command::GammaSet, gammaSet, sizeof(gammaSet)); - this->writeCommand(Command::PositiveGammaCorrection, positiveGammaCorr, - sizeof(positiveGammaCorr)); - this->writeCommand(Command::NegativeGammaCorrection, negativeGammaCorr, - sizeof(negativeGammaCorr)); - - this->writeCommand(Command::LeaveSleep); - modm::delay_ms(120); - this->writeCommand(Command::InversionOff); - this->writeCommand(Command::DisplayOn); - - setOrientation(orientation); - } + MODM_INIT_BUFFER({0x00, 0x1a}) + RF_CALL(this->writeCommand(Command::FrameCtrlNormalMode, buff_cmd8, 2)); + + MODM_INIT_BUFFER({0x0a, 0xa2, 0x27, 0x00}) //{ 0x08, 0x82, 0x27, 0x00 }; + RF_CALL(this->writeCommand(Command::DisplayFunctionCtrl, buff_cmd8, 4)); + + RF_CALL(this->writeCommand(Command::Enable3Gamma, 0x00)); + RF_CALL(this->writeCommand(Command::GammaSet, 0x01)); + + // MODM_INIT_BUFFER({ 0x0f, 0x31, 0x2b, 0x0c, 0x0e, 0x08, 0xe4, 0xf1, 0x37, 0x07, 0x10, 0x03, 0x0e, 0x09, 0x00}); + MODM_INIT_BUFFER({0x0f, 0x1d, 0x1a, 0x0a, 0x0d, 0x07, 0x49, 0x66, 0x3b, 0x07, 0x11, 0x01, 0x09, 0x05, 0x04}) + RF_CALL(this->writeCommand(Command::PositiveGammaCorrection, buff_cmd8, 15)); + + // MODM_INIT_BUFFER({ 0x00, 0x0e, 0x14, 0x03, 0x11, 0x07, 0x31, 0xc1, 0x48, 0x08, 0x0f, 0x0c, 0x31, 0x36, 0x0f}); + MODM_INIT_BUFFER({0x00, 0x18, 0x1d, 0x02, 0x0f, 0x04, 0x36, 0x13, 0x4c, 0x07, 0x13, 0x0f, 0x2e, 0x2f, 0x05}) + RF_CALL(this->writeCommand(Command::NegativeGammaCorrection, buff_cmd8, 15)); + + RF_CALL(set(Toggle::SleepDisable, true)); + modm::delay(120ms); + RF_CALL(set(Toggle::Inversion, false)); + RF_CALL(setOrientation(orientation)); + RF_CALL(set(Toggle::Enable, true)); + + RF_END(); } -template -void -Ili9341::reset(bool hardReset /* = false */) +#undef MODM_INIT_BUFFER + +template +modm::ResumableResult +modm::Ili9341::reset(bool hardReset /* = false */) { + RF_BEGIN(); + + // TODO use modm::ShortTimeout; if (hardReset) { Reset::set(); - modm::delay_ms(5); + modm::delay(5ms); Reset::reset(); - modm::delay_ms(5); + modm::delay(5ms); Reset::set(); - modm::delay_ms(5); - } - else { - BatchHandle h(*this); - this->writeCommand(Command::SwReset); - modm::delay_ms(5); + modm::delay(5ms); + } else + { + RF_CALL(this->writeCommand(Command::SwReset)); + modm::delay(5ms); } + RF_END(); } -template -uint16_t -Ili9341::getIcModel() +template +modm::ResumableResult +modm::Ili9341::getIcModel() { - BatchHandle h(*this); - - uint8_t buffer[4] { 0 }; - this->readData(Command::ReadId4, buffer, 4); - return (buffer[2] << 8) | buffer[3]; + RF_BEGIN(); + RF_CALL(this->readData(ReadCommand::Id, buff_cmd8, 4)); + RF_END_RETURN(buff_cmd8[2] << 8 | buff_cmd8[3]); } -template -inline void -Ili9341::setOrientation(glcd::Orientation orientation) +template +modm::ResumableResult +modm::Ili9341::set(Toggle toggle, bool state) { - using MemoryAccessCtrl_t = ili9341::MemoryAccessCtrl_t; - using MemoryAccessCtrl = ili9341::MemoryAccessCtrl; - MemoryAccessCtrl_t madCtrl { MemoryAccessCtrl::BGR }; - - switch (orientation) - { - case glcd::Orientation::Portrait90: - madCtrl |= MemoryAccessCtrl::MV | MemoryAccessCtrl::MX; - break; - case glcd::Orientation::Landscape180: - madCtrl |= MemoryAccessCtrl::MX | MemoryAccessCtrl::MY; - break; - case glcd::Orientation::Portrait270: - madCtrl |= MemoryAccessCtrl::MV | MemoryAccessCtrl::MY; - break; - default: -// madCtrl |= MemoryAccessCtrl::ML; - break; - } - - this->orientation = orientation; - - BatchHandle h(*this); - this->writeCommandValue8(Command::MemoryAccessCtrl, madCtrl.value); + RF_BEGIN(); + RF_CALL(this->writeCommand(Command(uint8_t(toggle) | uint8_t(state)))); + RF_END(); } -template -void -Ili9341::turnOn() +template +modm::ResumableResult +modm::Ili9341::set(ReadWrite reg, uint8_t value) { - BatchHandle h(*this); - this->writeCommand(Command::DisplayOn); + RF_BEGIN(); + RF_CALL(this->writeCommand(Command(reg), value)); + RF_END(); } -template -void -Ili9341::turnOff() +template +modm::ResumableResult +modm::Ili9341::get(ReadWrite reg) { - BatchHandle h(*this); - this->writeCommand(Command::DisplayOff); + RF_BEGIN(); + RF_END_RETURN_CALL(this->readData(Command(uint8_t(reg) | uint8_t(Bit0)))); } -template -void -Ili9341::setIdle(bool enable) +template +modm::ResumableResult +modm::Ili9341::setOrientation( + display::Orientation orientation) { - BatchHandle h(*this); - this->writeCommand(enable ? Command::IdleModeOn : Command::IdleModeOff); -} + RF_BEGIN(); + this->orientation = orientation; -template -void -Ili9341::enableSleep(bool enable) -{ - BatchHandle h(*this); - this->writeCommand(enable ? Command::EnterSleep : Command::LeaveSleep); -} + using MemoryAccessCtrl = ili9341_register::MemoryAccessCtrl; + using OrientationFlags = modm::display::OrientationFlags; -template -void -Ili9341::setBrightness(uint8_t level) -{ - BatchHandle h(*this); - this->writeCommand(Command::WriteBrightness, &level, 1); -} + madCtrl = MemoryAccessCtrl::PIXEL_DIR; -template -void -Ili9341::setInvert(bool invert) -{ - BatchHandle h(*this); - this->writeCommand(invert ? Command::InversionOn : Command::InversionOff); -} + if (orientation & OrientationFlags::Portrait) + madCtrl |= MemoryAccessCtrl::MEMORY_MODE; -template -void -Ili9341::clear() -{ - auto const saveForegroundColor { foregroundColor }; - foregroundColor = backgroundColor; - fillRectangle(glcd::Point(0, 0), Width, Height); - foregroundColor = saveForegroundColor; + if (orientation & OrientationFlags::Rotate180) + madCtrl |= MemoryAccessCtrl::MEMORY_DIR_Y; + + if (bool(orientation & OrientationFlags::Portrait) == bool(orientation & OrientationFlags::Rotate180)) + madCtrl |= MemoryAccessCtrl::MEMORY_DIR_X; + + RF_CALL(this->writeCommand(Command::MemoryAccessCtrl, madCtrl.value)); + + RF_END(); } -template -void -Ili9341::drawHorizontalLine( - glcd::Point start, uint16_t length) +template +modm::ResumableResult +modm::Ili9341::setScrollArea(uint16_t topFixedRows, + uint16_t bottomFixedRows, + uint16_t firstRow) { - uint16_t const pixelValue { modm::toBigEndian(foregroundColor.color) }; - auto minLength { std::min(std::size_t(length), BufferSize) }; - uint16_t *buffer16 { reinterpret_cast(buffer) }; - std::fill(buffer16, buffer16+minLength, pixelValue); + RF_BEGIN(); - BatchHandle h(*this); + buff_cmd16[0] = modm::fromBigEndian(topFixedRows); + buff_cmd16[1] = modm::fromBigEndian(firstRow); + buff_cmd16[2] = modm::fromBigEndian(bottomFixedRows); - setClipping(start.getX(), start.getY(), length, 1); - while (length > BufferSize) - { - this->writeData(buffer, BufferSize * 2); - length -= BufferSize; - } - this->writeData(buffer, length * 2); + RF_CALL(this->writeCommand(Command::VerticalScrollDefinition, buff_cmd8, 6)); + RF_END(); } -template -void -Ili9341::drawVerticalLine( - glcd::Point start, uint16_t length) +template +modm::ResumableResult +modm::Ili9341::scrollTo(uint16_t row) { - uint16_t const pixelValue { modm::toBigEndian(foregroundColor.color) }; - auto minLength { std::min(std::size_t(length), BufferSize) }; - uint16_t *buffer16 { reinterpret_cast(buffer) }; - std::fill(buffer16, buffer16+minLength, pixelValue); + RF_BEGIN(); - BatchHandle h(*this); + buff_cmd16[0] = modm::fromBigEndian(row); - setClipping(start.getX(), start.getY(), 1, length); - while (length > BufferSize) - { - this->writeData(buffer, BufferSize * 2); - length -= BufferSize; - } - this->writeData(buffer, length * 2); + RF_CALL(this->writeCommand(Command::VerticalScrollStartAddr, buff_cmd8, 2)); + RF_END(); } -template -void -Ili9341::fillRectangle( - glcd::Point upperLeft, uint16_t width, uint16_t height) +// --------------------------------------------------------------------------- + +template +modm::ResumableResult +modm::Ili9341::setClipping(Point point) { - auto const x { upperLeft.getX() }; - auto const y { upperLeft.getY() }; - std::size_t pixelCount { std::size_t(width) * std::size_t(height) }; + RF_BEGIN(); - uint16_t const pixelValue { modm::toBigEndian(foregroundColor.color) }; - auto minLength { std::min(std::size_t(pixelCount), BufferSize) }; - uint16_t *buffer16 { reinterpret_cast(buffer) }; - std::fill(buffer16, buffer16+minLength, pixelValue); + p.buff_clipping[0] = modm::fromBigEndian(point.x); + p.buff_clipping[1] = p.buff_clipping[0]; + RF_CALL(this->writeCommand(Command::PageAddressSet, (uint8_t *)(p.buff_clipping), 4)); - BatchHandle h(*this); + p.buff_clipping[0] = modm::fromBigEndian(point.y); + p.buff_clipping[1] = p.buff_clipping[0]; + RF_CALL(this->writeCommand(Command::ColumnAddressSet, (uint8_t *)(p.buff_clipping), 4)); - setClipping(x, y, width, height); - while (pixelCount > BufferSize) - { - this->writeData(buffer, BufferSize * 2); - pixelCount -= BufferSize; - } - if (pixelCount) - this->writeData(buffer, pixelCount * 2); + RF_CALL(this->writeCommand(Command::MemoryWrite)); + + RF_END(); } -template -void -Ili9341::fillCircle( - glcd::Point center, uint16_t radius) +template +modm::ResumableResult +modm::Ili9341::setClipping(Area area) { - uint8_t const setColor[] { uint8_t((foregroundColor.color >> 8) & 0xff), - uint8_t(foregroundColor.color & 0xff) }; + RF_BEGIN(); - int16_t f = 1 - radius; - int16_t ddF_x = 0; - int16_t ddF_y = -2 * radius; - uint16_t x = 0; - uint16_t y = radius; + p.buff_clipping[0] = modm::fromBigEndian(area.topLeft.x); + p.buff_clipping[1] = modm::fromBigEndian(int16_t(area.bottomRight.x - 1)); + RF_CALL(this->writeCommand(Command::PageAddressSet, (uint8_t *)(p.buff_clipping), 4)); - BatchHandle h(*this); + p.buff_clipping[0] = modm::fromBigEndian(area.topLeft.y); + p.buff_clipping[1] = modm::fromBigEndian(int16_t(area.bottomRight.y - 1)); + RF_CALL(this->writeCommand(Command::ColumnAddressSet, (uint8_t *)(p.buff_clipping), 4)); - setClipping(center.getX() - radius, center.getY(), 2 * radius, 1); - for (std::size_t i = 0; i < 2 * radius; ++i) - this->writeData(setColor, 2); + RF_CALL(this->writeCommand(Command::MemoryWrite)); - while(x < y) - { - if (f >= 0) - { - y--; - ddF_y += 2; - f += ddF_y; + RF_END(); +} + +// --------------------------------------------------------------------------- + +// -- Write Rgb565 Buffer ---------------------------------------------- +template +template +modm::ResumableResult +modm::Ili9341::writeBuffer( + const Buffer, R, Painter> &buffer) +{ + RF_BEGIN(); + + if constexpr(std::max(RB::W, RB::H) > 240) { + if(R::W > this->getWidth() ) { + // writeBuffer(buffer, origin) can handle off-canvas drawing + RF_CALL(writeBuffer(buffer, {0, 0})); + RF_RETURN(); } - x++; - ddF_x += 2; - f += ddF_x + 1; - - setClipping(center.getX() - x, center.getY() - y, 2 * x, 1); - for (std::size_t i = 0; i < 2 * x; ++i) - this->writeData(setColor, 2); - setClipping(center.getX() - y, center.getY() - x, 2 * y, 1); - for (std::size_t i = 0; i < 2 * y; ++i) - this->writeData(setColor, 2); - setClipping(center.getX() - x, center.getY() + y, 2 * x, 1); - for (std::size_t i = 0; i < 2 * x; ++i) - this->writeData(setColor, 2); - setClipping(center.getX() - y, center.getY() + x, 2 * y, 1); - for (std::size_t i = 0; i < 2 * y; ++i) - this->writeData(setColor, 2); } + + // The bare minimum of 'Intersection' needed + p.write_height = std::min(this->getHeight(), R::H); + + RF_CALL(setClipping(Area{{0,0}, Point(R::W, p.write_height)})); + RF_CALL(this->writeData(this->getPlainBuffer(buffer), R::W * p.write_height * 2)); + + RF_END(); +} + +// -- Write Rgb565 Buffer to position ---------------------------------- +template +template +modm::ResumableResult +modm::Ili9341::writeBuffer( + const Buffer, R, Painter> &buffer, Point origin) +{ + RF_BEGIN(); + + p.intersection = this->getIntersection(Rectangle(origin, R::asPoint())); + + RF_CALL(setClipping(p.intersection)); + // FIXME involve p.intersection + RF_CALL(this->writeData(this->getPlainBuffer(buffer), p.intersection.getPixels() * 2)); + RF_END(); } -template -void -Ili9341::drawImageRaw(glcd::Point upperLeft, - uint16_t width, uint16_t height, modm::accessor::Flash data) +// -- Write differend colored Buffer to position ----------------------------- +template +template +modm::ResumableResult +modm::Ili9341::writeBuffer( + const Buffer &buffer, Point origin) { - uint8_t const setColor[] { uint8_t((foregroundColor.color >> 8) & 0xff), - uint8_t(foregroundColor.color & 0xff) }; - uint8_t const clearColor[] { uint8_t((backgroundColor.color >> 8) & 0xff), - uint8_t(backgroundColor.color & 0xff) }; + RF_BEGIN(); - BatchHandle h(*this); + // TODO take p.intersection into account + // p.intersection = this->getIntersection(Rectangle(origin, Point(width, height))); - setClipping(upperLeft.getX(), upperLeft.getY(), width, height); + p.bufferRgb565_pos = {0, 0}; + p.bufferRgb565.color = color; - uint8_t bit = 0x01; - for (uint16_t r = 0; r < height; ++r) + while (true) { - for (uint16_t w = 0; w < width; ++w) + // Convert tile + p.bufferRgb565.writeBuffer(buffer, -p.bufferRgb565_pos); + + // Transfer tile + RF_CALL(writeBuffer(p.bufferRgb565, origin + p.bufferRgb565_pos)); + // Transfer tile alternative: + /* RF_CALL(setClipping(Area( + topLeft + p.bufferRgb565_pos, + topLeft + p.bufferRgb565_pos + Point(bufferRgb565.width, bufferRgb565.height) + )); + RF_CALL(this->writeData(this->getPlainBuffer(bufferRgb565), 2 * bufferRgb565.p.write_pixels)); */ + + // Move to next tile + p.bufferRgb565_pos.x += RB::W; + if (p.bufferRgb565_pos.x >= R::W) { - uint8_t byte = data[(r / 8) * width + w]; - if (byte & bit) - this->writeData(setColor, 2); - else - this->writeData(clearColor, 2); + p.bufferRgb565_pos.x = 0; + p.bufferRgb565_pos.y += RB::H; } - // TODO: optimize, use ROL (rotate left) - bit <<= 1; - if (bit == 0) - bit = 0x01; + if (p.bufferRgb565_pos.y >= R::H) break; } + RF_END(); } -template -void -Ili9341::drawRaw(glcd::Point upperLeft, - uint16_t width, uint16_t height, color::Rgb565* data) -{ - BatchHandle h(*this); +template +modm::ResumableResult +modm::Ili9341::drawFlash(modm::accessor::Flash data, + uint16_t width, uint16_t height, shape::Point origin) { + RF_BEGIN(); - uint16_t* buffer = (uint16_t*)data; - for(size_t i = 0; i < size_t(width*height); i++) { - buffer[i] = modm::fromBigEndian(buffer[i]); - } + (void)data; + (void)width; + (void)height; + (void)origin; - setClipping(upperLeft.getX(), upperLeft.getY(), width, height); - this->writeData((uint8_t*)buffer, width * height * 2); + RF_END(); } -template -void -Ili9341::setScrollArea( - uint16_t topFixedRows, uint16_t bottomFixedRows, uint16_t firstRow) -{ - BatchHandle h(*this); +// --------------------------------------------------------------------------- - uint8_t arg[] - { - uint8_t((topFixedRows >> 8) & 0xff), uint8_t(topFixedRows & 0xff), - uint8_t((firstRow >> 8) & 0xff), uint8_t(firstRow & 0xff), - uint8_t((bottomFixedRows >> 8) & 0xff), uint8_t(bottomFixedRows & 0xff) - }; - this->writeCommand(Command::VerticalScrollDefinition, arg, 6); +template +modm::ResumableResult +modm::Ili9341::drawFast(Point point) +{ + RF_BEGIN(); + RF_CALL(setClipping(point)); + RF_CALL(this->writeData(color)); + RF_END(); } -template -void -Ili9341::scrollTo(uint16_t row) +template +modm::ResumableResult +modm::Ili9341::drawFast(HLine hline) { - BatchHandle h(*this); + RF_BEGIN(); + RF_CALL(drawFast(Area(hline.start, hline.start + Point(hline.end_x, 1)))); + RF_END(); +} - uint8_t arg[] { uint8_t((row >> 8) & 0xff), uint8_t(row & 0xff) }; - this->writeCommand(Command::VerticalScrollStartAddr, arg, 2); +template +modm::ResumableResult +modm::Ili9341::drawFast(VLine vline) +{ + RF_BEGIN(); + RF_CALL(drawFast(Area(vline.start, vline.start + Point(1, vline.end_y)))); + RF_END(); } -template -void -Ili9341::setColoredPixel( - int16_t x, int16_t y, color::Rgb565 const &color) +template +modm::ResumableResult +modm::Ili9341::drawFast(Area area) { - auto const pixelColor { color }; - uint8_t const setColor[] { uint8_t((pixelColor.color >> 8) & 0xff), uint8_t(pixelColor.color & 0xff) }; + RF_BEGIN(); - BatchHandle h(*this); + p.write_pixels = area.getPixels(); + RF_CALL(setClipping(area)); - this->setClipping(x, y, 1, 1); - this->writeData(setColor, 2); -} + // OPTIMIZE Make this impossible fast by using DMA + // An idea is to use `DmaBase::CircularMode::Enabled` to send the color (2 bytes) p.intersection.getPixels() times + // See https://community.st.com/s/question/0D53W00000IXdAuSAL/dma-normal-vs-circular -template -void -Ili9341::setClipping( - uint16_t x, uint16_t y, uint16_t width, uint16_t height) -{ - uint8_t buffer[4]; - - buffer[0] = uint8_t((x >> 8) & 0xff); - buffer[1] = uint8_t(x & 0xff); - buffer[2] = uint8_t(((x + width - 1) >> 8) & 0xff); - buffer[3] = uint8_t((x + width - 1) & 0xff); - this->writeCommand(Command::ColumnAddressSet, buffer, 4); - - buffer[0] = uint8_t((y >> 8) & 0xff); - buffer[1] = uint8_t(y & 0xff); - buffer[2] = uint8_t(((y + height - 1) >> 8) & 0xff); - buffer[3] = uint8_t((y + height - 1) & 0xff); - this->writeCommand(Command::PageAddressSet, buffer, 4); - this->writeCommand(Command::MemoryWrite); + // Without DMA, at least this could be parallelised to setClipping(..) above + p.bufferRgb565.clear(color); + + while (true) + { + if (p.write_pixels > p.bufferRgb565.getPixels()) + { + RF_CALL(this->writeData((uint8_t *)(this->getPlainBuffer(p.bufferRgb565)), 2 * p.bufferRgb565.getPixels())); + p.write_pixels -= p.bufferRgb565.getPixels(); + } else + { + RF_CALL(this->writeData((uint8_t *)(this->getPlainBuffer(p.bufferRgb565)), 2 * p.write_pixels)); + break; + } + } + RF_END(); } -template -void -Ili9341::drawBitmap(glcd::Point upperLeft, - uint16_t width, uint16_t height, modm::accessor::Flash data) +template +modm::ResumableResult +modm::Ili9341::clear(color::Rgb565 color) { - BatchHandle h(*this); + // OPTIMIZE Make this impossible fast by using DMA + RF_BEGIN(); - setClipping(upperLeft.getX(), upperLeft.getY(), width, height); - for (int i = 0; i < width * height; ++i) { - buffer[0] = data[i*2+1]; - buffer[1] = data[i*2]; - this->writeData(buffer, 2); - } -// this->writeData(data.getPointer(), width * height * 2); -} + p.color_temp = color; + this->color = color; + + // RF_CALL(setClipping(this->asArea())); + RF_CALL(drawFast(Area({0, 0}, {this->getWidth(), this->getHeight()}))); + + this->color = p.color_temp; -} // namespace modm + RF_END(); +} \ No newline at end of file diff --git a/src/modm/driver/display/ili9341_parallel.hpp b/src/modm/driver/display/ili9341_interface_parallel.hpp similarity index 63% rename from src/modm/driver/display/ili9341_parallel.hpp rename to src/modm/driver/display/ili9341_interface_parallel.hpp index 4a282e32a3..d773ba0847 100644 --- a/src/modm/driver/display/ili9341_parallel.hpp +++ b/src/modm/driver/display/ili9341_interface_parallel.hpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Pavel Pletenev + * Copyright (c) 2021, Thomas Sommer * * This file is part of the modm project. * @@ -7,32 +8,37 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef MODM_ILI9341_PARALLEL_HPP -#define MODM_ILI9341_PARALLEL_HPP +#pragma once -#include "ili9341.hpp" +#ifndef MODM_ILI9341_HPP +#error "Don't include this file directly, use 'ili9341.hpp' instead!" +#endif + +#include + +#include "ili9341_register.hpp" namespace modm { /// @ingroup modm_driver_ili9341 -template -class Ili9341ParallelInterface: public ili9341 +template +class Ili9341InterfaceParallel: public ili9341_register { - INTERFACE& interface; + Interface& interface; public: - Ili9341ParallelInterface(INTERFACE& interface) + Ili9341InterfaceParallel(Interface& interface) : interface(interface) {} - __attribute__((noinline)) void + void writeCommand(Command command) { - interface.writeIndex(i(command)); + interface.writeIndex(uint8_t(command)); } - __attribute__((noinline)) void + void writeCommand(Command command, uint8_t const *args, std::size_t length) { - interface.writeIndex(i(command)); + interface.writeIndex(uint8_t(command)); for(std::size_t i=0; i -using Ili9341Parallel = Ili9341< - Ili9341ParallelInterface, - Reset, Backlight, BufferSize>; - -} // namespace modm - -#endif // MODM_ILI9341_PARALLEL_HPP +} // namespace modm \ No newline at end of file diff --git a/src/modm/driver/display/ili9341_interface_spi.hpp b/src/modm/driver/display/ili9341_interface_spi.hpp new file mode 100644 index 0000000000..f01dfb8086 --- /dev/null +++ b/src/modm/driver/display/ili9341_interface_spi.hpp @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2019, Mike Wolfram + * Copyright (c) 2021, Thomas Sommer + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#pragma once + +#ifndef MODM_ILI9341_HPP +#error "Don't include this file directly, use 'ili9341.hpp' instead!" +#endif + +#include +#include +#include + +#include "ili9341_register.hpp" + +namespace modm +{ + +/// @ingroup modm_driver_ili9341 +template +class Ili9341InterfaceSpi : public ili9341_register, public modm::SpiDevice< SpiMaster >, protected modm::NestedResumable<4> +{ + uint8_t read; +protected: + Ili9341InterfaceSpi() + { + this->attachConfigurationHandler([]() { + SpiMaster::setDataMode(SpiMaster::DataMode::Mode0); + SpiMaster::setDataOrder(SpiMaster::DataOrder::MsbFirst); + }); + Cs::setOutput(modm::Gpio::High); + Dc::setOutput(); + } + + modm::ResumableResult + writeCommand(Command command) + { + RF_BEGIN(); + + RF_WAIT_UNTIL(this->acquireMaster()); + Cs::reset(); + + Dc::reset(); + RF_CALL(SpiMaster::transfer(uint8_t(command))); + Dc::set(); + + if (this->releaseMaster()) + Cs::set(); + + RF_END(); + } + + modm::ResumableResult + writeCommand(Command command, const uint8_t data) + { + RF_BEGIN(); + + RF_WAIT_UNTIL(this->acquireMaster()); + Cs::reset(); + + Dc::reset(); + RF_CALL(SpiMaster::transfer(uint8_t(command))); + Dc::set(); + + RF_CALL(SpiMaster::transfer(data)); + + if (this->releaseMaster()) + Cs::set(); + + RF_END(); + } + + modm::ResumableResult + writeCommand(Command command, const uint8_t *data, std::size_t length) + { + RF_BEGIN(); + + RF_WAIT_UNTIL(this->acquireMaster()); + Cs::reset(); + + Dc::reset(); + RF_CALL(SpiMaster::transfer(uint8_t(command))); + Dc::set(); + + RF_CALL(SpiMaster::transfer(data, nullptr, length)); + + if (this->releaseMaster()) + Cs::set(); + + RF_END(); + } + + modm::ResumableResult + writeData(const uint8_t *data, size_t length) + { + RF_BEGIN(); + + RF_WAIT_UNTIL(this->acquireMaster()); + Cs::reset(); + + RF_CALL(SpiMaster::transfer(data, nullptr, length)); + + if (this->releaseMaster()) + Cs::set(); + + RF_END(); + } + + // OPTIMIZE determine if implementation is optimal + modm::ResumableResult + writeData(color::Rgb565 rgb565) + { + RF_BEGIN(); + + RF_WAIT_UNTIL(this->acquireMaster()); + Cs::reset(); + + RF_CALL(SpiMaster::transfer((uint8_t*)(&rgb565.color), nullptr, 2)); + + // Alternative + // RF_CALL(SpiMaster::transfer(rgb565.color >> 8)); + // RF_CALL(SpiMaster::transfer(rgb565.color & 0xFF)); + + if (this->releaseMaster()) + Cs::set(); + + RF_END(); + } + + modm::ResumableResult + readData(Command command) + { + RF_BEGIN(); + + RF_WAIT_UNTIL(this->acquireMaster()); + Cs::reset(); + + Dc::reset(); + RF_CALL(SpiMaster::transfer(uint8_t(command))); + Dc::set(); + + read = RF_CALL(SpiMaster::transfer(0x00)).getResult(); + + if (this->releaseMaster()) + Cs::set(); + + RF_END_RETURN(read); + } + + modm::ResumableResult + readData(Command command, uint8_t *buffer, size_t length) + { + RF_BEGIN(); + + RF_WAIT_UNTIL(this->acquireMaster()); + Cs::reset(); + + Dc::reset(); + RF_CALL(SpiMaster::transfer(uint8_t(command))); + Dc::set(); + + RF_CALL(SpiMaster::transfer(nullptr, buffer, length)); + + if (this->releaseMaster()) + Cs::set(); + + RF_END(); + } +}; + +} // namespace modm \ No newline at end of file diff --git a/src/modm/driver/display/ili9341_register.hpp b/src/modm/driver/display/ili9341_register.hpp new file mode 100644 index 0000000000..9688c0a554 --- /dev/null +++ b/src/modm/driver/display/ili9341_register.hpp @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2019, Mike Wolfram + * Copyright (c) 2021, Thomas Sommer + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include + +namespace modm { + +/// @ingroup modm_driver_ili9341 +struct ili9341_register +{ +public: + // Bit0 => false: Off, true: On + enum Toggle : uint8_t { + SleepDisable = 0x10, + Inversion = 0x20, + Enable = 0x28, + TearingEffect = 0x34, + Idle = 0x38, + }; + + // Bit0 => false: Write, true: Read + enum class ReadWrite : uint8_t { + Brightness = 0x51, + CtrlDisplay = 0x53, + ContentAdaptiveBrightnessCtrl = 0x55, + CabcMinimumBrightness = 0x5E, + }; + +// protected: + enum class Command : uint8_t + { + Nop = 0x00, + SwReset = 0x01, + + GammaSet = 0x26, + ColumnAddressSet = 0x2A, + PageAddressSet = 0x2B, + MemoryWrite = 0x2C, + ColorSet = 0x2D, + MemoryRead = 0x2E, + + PartialMode = 0x12, + NormalMode = 0x13, + + PartialArea = 0x30, + VerticalScrollDefinition = 0x33, + MemoryAccessCtrl = 0x36, + VerticalScrollStartAddr = 0x37, + + PixelFormatSet = 0x3A, + WriteMemoryContinue = 0x3C, + ReadMemoryContinue = 0x3E, + SetTearScanLine = 0x44, + GetScanLine = 0x45, + + // Extended + RgbInterfaceSignalCtrl = 0xB0, + FrameCtrlNormalMode = 0xB1, + FrameCtrlIdleMode = 0xB2, + FrameCtrlPartialMode = 0xB3, + InversionCtrl = 0xB4, + BlankingPorchCtrl = 0xB5, + DisplayFunctionCtrl = 0xB6, + EntryModeSet = 0xB7, + BacklightCtrl1 = 0xB8, + BacklightCtrl2 = 0xB9, + BacklightCtrl3 = 0xBA, + BacklightCtrl4 = 0xBB, + BacklightCtrl5 = 0xBC, + BacklightCtrl7 = 0xBE, + BacklightCtrl8 = 0xBF, + PowerCtrl1 = 0xC0, + PowerCtrl2 = 0xC1, + VComCtrl1 = 0xC5, + VComCtrl2 = 0xC7, + PowerCtrlA = 0xCB, + PowerCtrlB = 0xCF, + NvMemoryWrite = 0xD0, + NvMemoryProtectionKey = 0xD1, + NvMemoryStatus = 0xD2, + PositiveGammaCorrection = 0xE0, + NegativeGammaCorrection = 0xE1, + DigitalGammaCtrl = 0xE2, + TimingCtrlA = 0xE8, + TimingCtrlB = 0xEA, + PowerOnSequenceCtrl = 0xED, + Enable3Gamma = 0xF2, + InterfaceCtrl = 0xF6, + PumpRatioCtrl = 0xF7, + }; + + enum class ReadCommand : uint8_t { + // TODO got 0s only for each of ReadId* + Id = 0x04, // returns 4 bytes + Id1 = 0xDA, + Id2 = 0xDB, + Id3 = 0xDC, + Id4 = 0xD3, + + Status = 0x09, // returns 5 bytes + PowerMode = 0x0A, // returns 2 bytes + MemoryAccessCtrl = 0x0B,// returns 2 bytes + PixelFormat = 0x0C, // returns 2 bytes + ImageFormat = 0x0D, // returns 2 bytes + SignalMode = 0x0E, // returns 2 bytes + SelfDiagnostic = 0x0F, // returns 2 bytes + }; + + enum class MemoryAccessCtrl : uint8_t + { + // Rgb565 bits-order + PIXEL_DIR = Bit3, // 0: RGB, 1: BGR + // LCD Refresh + REFRESH_DIR_X = Bit2, // 0: Left->Right, 1: Right->Left + REFRESH_DIR_Y = Bit4, // 0: Top->Bottom, 1: Bottom->Top + // Memory Access + MEMORY_MODE = Bit5, // 0: Normal, 1: Reverse + MEMORY_DIR_X = Bit6, // 0: Left->Right, 1: Right->Left + MEMORY_DIR_Y = Bit7 // 0: Top->Bottom, 1: Bottom->Top + }; + MODM_FLAGS8(MemoryAccessCtrl); +}; +} \ No newline at end of file diff --git a/src/modm/driver/display/ili9341_spi.hpp b/src/modm/driver/display/ili9341_spi.hpp deleted file mode 100644 index 7f145dde49..0000000000 --- a/src/modm/driver/display/ili9341_spi.hpp +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2019, Mike Wolfram - * - * This file is part of the modm project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -#ifndef MODM_ILI9341_SPI_HPP -#define MODM_ILI9341_SPI_HPP - -#include "ili9341.hpp" -#include -#include - -namespace modm -{ - -/// @ingroup modm_driver_ili9341 -template -class Ili9341SPIInterface: public ili9341, public modm::SpiDevice -{ -public: - Ili9341SPIInterface() - { - this->attachConfigurationHandler([]() { - SPI::setDataMode(SPI::DataMode::Mode0); - SPI::setDataOrder(SPI::DataOrder::MsbFirst); - }); - Cs::setOutput(modm::Gpio::High); - Dc::setOutput(); - } - - __attribute__((noinline)) void - writeCommand(Command command) - { - Dc::reset(); // enable command - SPI::transferBlocking(i(command)); - Dc::set(); // reset to data - } - __attribute__((noinline)) void - writeCommand(Command command, uint8_t const *args, std::size_t length) - { - Dc::reset(); // enable command - SPI::transferBlocking(i(command)); - Dc::set(); // reset to data - if (length != 0) - { - SPI::transferBlocking(const_cast(args), nullptr, length); - } - } - void - writeData(uint8_t const *data, std::size_t length) - { - SPI::transferBlocking(const_cast(data), nullptr, length); - } - void - writeCommandValue8(Command command, uint8_t value) - { - writeCommand(command, &value, 1); - } - - void - readData(Command command, uint8_t *buffer, std::size_t length) - { - using modm::platform::SpiBase; - uint8_t b[4]; - - Dc::reset(); // enable command - // SPI::Hal::setDataSize(SpiBase::DataSize::Bit9); - SPI::transferBlocking(i(command) << 1); - SPI::Hal::setDataSize(SpiBase::DataSize::Bit8); - Dc::set(); // reset to data - SPI::transferBlocking(b /*nullptr*/, buffer, length); - } - uint8_t - readData(Command command) - { - writeCommand(command); - return SPI::transferBlocking(0x00); - } - -public: - struct BatchHandle - { - Ili9341SPIInterface& i; - BatchHandle(Ili9341SPIInterface& iface) - : i(iface) - { - i.acquireMaster(); - Cs::reset(); - } - ~BatchHandle() - { - if (i.releaseMaster()) - Cs::set(); - } - }; -}; - -/// @ingroup modm_driver_ili9341 -template -using Ili9341Spi = Ili9341< - Ili9341SPIInterface, - Reset, Backlight, BufferSize>; - -} // namespace modm - -#endif // MODM_ILI9341_SPI_HPP diff --git a/src/modm/driver/display/sh1106.hpp b/src/modm/driver/display/sh1106.hpp index 92120d7c80..6ed86e3aa5 100644 --- a/src/modm/driver/display/sh1106.hpp +++ b/src/modm/driver/display/sh1106.hpp @@ -9,7 +9,8 @@ */ // ---------------------------------------------------------------------------- -#pragma once +#ifndef MODM_SH1106_HPP +#define MODM_SH1106_HPP #include "ssd1306.hpp" @@ -25,51 +26,35 @@ namespace modm * * @ingroup modm_driver_sh1106 */ -template -class Sh1106 : public Ssd1306 + +template +class Sh1106 : public Ssd1306 { public: - Sh1106(uint8_t address = 0x3C) : Ssd1306(address) {} - -protected: - modm::ResumableResult - startWriteDisplay() override - { - RF_BEGIN(); - - this->transaction_success = true; - - this->commandBuffer[0] = ssd1306::AdressingCommands::HigherColumnStartAddress; - this->commandBuffer[1] = 0x02; + Sh1106(uint8_t address = 0x3C) : Ssd1306(address) {} - for (page = 0; page < Height / 8; page++) - { - this->commandBuffer[2] = 0xB0 | page; - this->transaction_success &= RF_CALL(this->writeCommands(3)); + template + modm::ResumableResult + writeBuffer(const Buffer &buffer, shape::Point pos = {0, 0}); - RF_WAIT_UNTIL( - this->transaction.configureDisplayWrite((uint8_t*)&this->buffer[page], 128)); - RF_WAIT_UNTIL(this->startTransaction()); - RF_WAIT_WHILE(this->isTransactionRunning()); - this->transaction_success &= this->wasTransactionSuccessful(); - }; - - RF_END_RETURN(this->transaction_success); - } +protected: + modm::ResumableResult + initializeMemoryMode() override; - modm::ResumableResult - initializeMemoryMode() override - { - RF_BEGIN(); - // Default on Power-up - can be omitted - this->commandBuffer[0] = ssd1306::AdressingCommands::MemoryMode; - this->commandBuffer[1] = ssd1306::MemoryMode::PAGE; - this->transaction_success &= RF_CALL(this->writeCommands(2)); - RF_END(); - } + modm::ResumableResult + setClipping(shape::Area area) final; private: - size_t page; + size_t yd; // vertical index in display (page) + size_t yd_start; // first vertical index in display + size_t yd_end; // last vertical index in display + + // Helpers for transfer loops + size_t yb; // vertical position in buffer }; } // namespace modm + +#include "sh1106_impl.hpp" + +#endif // MODM_SH1106_HPP \ No newline at end of file diff --git a/src/modm/driver/display/sh1106.lb b/src/modm/driver/display/sh1106.lb index 4222f45849..4362da26dd 100644 --- a/src/modm/driver/display/sh1106.lb +++ b/src/modm/driver/display/sh1106.lb @@ -22,3 +22,4 @@ def prepare(module, options): def build(env): env.outbasepath = "modm/src/modm/driver/display" env.copy("sh1106.hpp") + env.copy("sh1106_impl.hpp") diff --git a/src/modm/driver/display/sh1106_impl.hpp b/src/modm/driver/display/sh1106_impl.hpp new file mode 100644 index 0000000000..1fe52181a5 --- /dev/null +++ b/src/modm/driver/display/sh1106_impl.hpp @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2021, Thomas Sommer + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +// ---------------------------------------------------------------------------- + +#ifndef MODM_SH1106_HPP +#error "Don't include this file directly, use 'sh1106.hpp' instead!" +#endif + +template +modm::ResumableResult +modm::Sh1106::initializeMemoryMode() +{ + RF_BEGIN(); + // Default on Power-up - can be omitted + this->commandBuffer[0] = ssd1306::AdressingCommands::MemoryMode; + this->commandBuffer[1] = ssd1306::MemoryMode::PAGE; + RF_END_RETURN_CALL(this->writeCommands(2)); +} + +template +modm::ResumableResult +modm::Sh1106::setClipping(shape::Area area) +{ + RF_BEGIN(); + + // SH1106-Screen wiring has 2 pixels offset on left + this->commandBuffer[0] = + ssd1306::AdressingCommands::HigherColumnStartAddress | ((area.topLeft.x + 2) >> 4); + this->commandBuffer[1] = + ssd1306::AdressingCommands::LowerColumnStartAddress | ((area.topLeft.x + 2) & 0x0F); + + yd_start = area.topLeft.y / 8; + yd_end = (area.bottomRight.y / 8) - 1; + + RF_END_RETURN(true); +} + +template +template +modm::ResumableResult +modm::Sh1106::writeBuffer(const Buffer &buffer, + shape::Point pos) +{ + RF_BEGIN(); + + this->bottom_right = pos + shape::Point(R::W, R::H); + + if (this->bottom_right.x <= 128 && this->bottom_right.y <= H + 7) + { + RF_CALL(setClipping(shape::Area{pos, this->bottom_right})); + + this->transaction_success = true; + yb = 0; + + for (yd = yd_start; yd <= yd_end; yd++) + { + this->commandBuffer[2] = ssd1306::AdressingCommands::PageStartAddress | yd; + this->transaction_success &= RF_CALL(this->writeCommands(3)); + + RF_WAIT_UNTIL(this->transaction.configureDisplayWrite( + this->getPlainBuffer(buffer) + (R::W * yb++), R::W)); + RF_WAIT_UNTIL(this->startTransaction()); + RF_WAIT_WHILE(this->isTransactionRunning()); + this->transaction_success &= this->wasTransactionSuccessful(); + }; + } else { + this->transaction_success = false; + } + RF_END_RETURN(this->transaction_success); +} \ No newline at end of file diff --git a/src/modm/driver/display/ssd1306.hpp b/src/modm/driver/display/ssd1306.hpp index e62881d154..c56c114c20 100644 --- a/src/modm/driver/display/ssd1306.hpp +++ b/src/modm/driver/display/ssd1306.hpp @@ -17,7 +17,9 @@ #include #include #include -#include + +#include +#include #include "ssd1306_register.hpp" @@ -50,13 +52,6 @@ struct ssd1306 : public ssd1306_register // LeftBottom = VerticalAndHorizontalScrollLeft, }; - enum class - DisplayMode : uint8_t - { - Normal = NormalDisplay, - Inverted = InvertedDisplay - }; - public: /// @cond class Ssd1306_I2cWriteTransaction : public modm::I2cWriteTransaction @@ -94,15 +89,17 @@ struct ssd1306 : public ssd1306_register * @author Thomas Sommer * @ingroup modm_driver_ssd1306 */ -template +template class Ssd1306 : public ssd1306, - public MonochromeGraphicDisplayVertical<128, Height>, + public Display>, public I2cDevice { - static_assert((Height == 64) or (Height == 32), "Display height must be either 32 or 64 pixel!"); + static_assert((H == 64) or (H == 32), "Display height must be either 32 or 64 pixel!"); public: - Ssd1306(uint8_t address = 0x3C); + Ssd1306(uint8_t address = 0x3C) + : Display>(true), I2cDevice(address) + {} /// Pings the display bool inline pingBlocking() @@ -112,10 +109,6 @@ class Ssd1306 : public ssd1306, bool inline initializeBlocking() { return RF_CALL_BLOCKING(initialize()); } - /// Update the display with the content of the RAM buffer. - void - update() override - { RF_CALL_BLOCKING(startWriteDisplay()); } /// Use this method to synchronize writing to the displays buffer /// to avoid tearing. @@ -128,16 +121,8 @@ class Ssd1306 : public ssd1306, modm::ResumableResult initialize(); - // starts a frame transfer and waits for completion - virtual modm::ResumableResult - writeDisplay(); - modm::ResumableResult - setDisplayMode(DisplayMode mode = DisplayMode::Normal) - { - commandBuffer[0] = mode; - return writeCommands(1); - } + set(ssd1306_register::Toggle toggle, bool state); modm::ResumableResult setContrast(uint8_t contrast = 0xCE) @@ -148,10 +133,10 @@ class Ssd1306 : public ssd1306, } /** - * \param orientation glcd::Orientation::Landscape0 or glcd::Orientation::Landscape180 + * @param orientation display::Orientation::Landscape0 or display::Orientation::Landscape180 */ modm::ResumableResult - setOrientation(glcd::Orientation orientation); + setOrientation(display::Orientation orientation); modm::ResumableResult configureScroll(uint8_t origin, uint8_t size, ScrollDirection direction, ScrollStep steps); @@ -170,16 +155,39 @@ class Ssd1306 : public ssd1306, return writeCommands(1); } + modm::ResumableResult + clear(bool = false); + + /* pos.y rounds to multiples of 8 + * Arbitrary pos.y must be concidered whilst drawing into buffer + */ + + // Write monochrome Buffer - uses {0, 0} as position + template + modm::ResumableResult + writeBuffer(Buffer &buffer); + + // Write monochrome Buffer to specific position + template + modm::ResumableResult + writeBuffer(Buffer &buffer, shape::Point pos); + protected: + shape::Point bottom_right; + + virtual modm::ResumableResult + setClipping(shape::Area area); + modm::ResumableResult writeCommands(std::size_t length); - virtual modm::ResumableResult + /** + * MemoryMode::HORIZONTAL and MemoryMode::VERTICAL have the best performance + * because the whole buffer is send in one transaction. + */ + virtual modm::ResumableResult initializeMemoryMode(); - virtual modm::ResumableResult - startWriteDisplay(); - uint8_t commandBuffer[7]; bool transaction_success; }; diff --git a/src/modm/driver/display/ssd1306.lb b/src/modm/driver/display/ssd1306.lb index 0b138e8811..64afcbbe4b 100644 --- a/src/modm/driver/display/ssd1306.lb +++ b/src/modm/driver/display/ssd1306.lb @@ -19,7 +19,7 @@ def prepare(module, options): module.depends( ":architecture:i2c.device", ":processing:timer", - ":ui:display") + ":ui:graphic") return True def build(env): diff --git a/src/modm/driver/display/ssd1306_impl.hpp b/src/modm/driver/display/ssd1306_impl.hpp index cde8634f40..cace258897 100644 --- a/src/modm/driver/display/ssd1306_impl.hpp +++ b/src/modm/driver/display/ssd1306_impl.hpp @@ -13,144 +13,109 @@ #error "Don't include this file directly, use 'ssd1306.hpp' instead!" #endif -template -modm::Ssd1306::Ssd1306(uint8_t address) - : I2cDevice(address) -{} - -// ---------------------------------------------------------------------------- -// MARK: - Tasks -template +template modm::ResumableResult -modm::Ssd1306::initialize() +modm::Ssd1306::initialize() { RF_BEGIN(); transaction_success = true; - commandBuffer[0] = FundamentalCommands::DisplayOff; - commandBuffer[1] = TimingAndDrivingCommands::DisplayClockDivideRatio; - commandBuffer[2] = 8 << 4; // Frequency (influences scrolling speed too) - commandBuffer[2] |= 0; // Prescaler - commandBuffer[3] = HardwareConfigCommands::MultiplexRatio; - commandBuffer[4] = 63; // Range 0-63 - commandBuffer[5] = HardwareConfigCommands::DisplayOffset; - commandBuffer[6] = 0; // Range 0-63 - transaction_success &= RF_CALL(writeCommands(7)); + transaction_success &= RF_CALL(set(Toggle::Enable, false)); - RF_CALL(initializeMemoryMode()); + commandBuffer[0] = TimingAndDrivingCommands::DisplayClockDivideRatio; + commandBuffer[1] = 8 << 4; // Frequency (influences scrolling speed too) + commandBuffer[1] |= 0; // Prescaler + commandBuffer[2] = HardwareConfigCommands::MultiplexRatio; + commandBuffer[3] = 63; // Range 0-63 + commandBuffer[4] = HardwareConfigCommands::DisplayOffset; + commandBuffer[5] = 0; // Range 0-63 + transaction_success &= RF_CALL(writeCommands(6)); + + transaction_success &= RF_CALL(initializeMemoryMode()); commandBuffer[0] = TimingAndDrivingCommands::ChargePump; commandBuffer[1] = ChargePump::V7_5; commandBuffer[2] = HardwareConfigCommands::SegmentRemap127; commandBuffer[3] = HardwareConfigCommands::ComOutputScanDirectionDecrement; commandBuffer[4] = HardwareConfigCommands::DisplayStartLine; - commandBuffer[4] |= 0; // Range 0-63 + commandBuffer[4] |= 0; // Range 0-63 transaction_success &= RF_CALL(writeCommands(5)); commandBuffer[0] = HardwareConfigCommands::ComPinsOrder; - commandBuffer[1] = Height == 64 ? 0x12 : 0x02; + commandBuffer[1] = H == 64 ? 0x12 : 0x02; commandBuffer[2] = FundamentalCommands::ContrastControl; - commandBuffer[3] = 0xCF; // Strange non-linear beahaviour + commandBuffer[3] = 0xCF; // Strange non-linear beahaviour commandBuffer[4] = TimingAndDrivingCommands::PreChargePeriod; - commandBuffer[5] = 1; // [3:0] Phase 1 period - commandBuffer[5] |= 15 << 4;// [7:4] Phase 2 period + commandBuffer[5] = 1; // [3:0] Phase 1 period + commandBuffer[5] |= 15 << 4; // [7:4] Phase 2 period transaction_success &= RF_CALL(writeCommands(6)); commandBuffer[0] = TimingAndDrivingCommands::V_DeselectLevel; - commandBuffer[1] = 4 << 4; // [7:4] See Datasheet + commandBuffer[1] = 4 << 4; // [7:4] See Datasheet commandBuffer[2] = ScrollingCommands::DisableScroll; commandBuffer[3] = FundamentalCommands::EntireDisplayResumeToRam; - commandBuffer[4] = FundamentalCommands::NormalDisplay; - transaction_success &= RF_CALL(writeCommands(5)); + transaction_success &= RF_CALL(writeCommands(4)); - commandBuffer[0] = FundamentalCommands::DisplayOn; - transaction_success &= RF_CALL(writeCommands(1)); + transaction_success &= RF_CALL(set(Toggle::Inversion, false)); + transaction_success &= RF_CALL(set(Toggle::Enable, true)); RF_END_RETURN(transaction_success); } -/** - * @brief MemoryMode::HORIZONTAL and MemoryMode::VERTICAL - * have the best performance cause the whole buffer - * is send in one transaction. - */ -template -modm::ResumableResult -modm::Ssd1306::initializeMemoryMode() +template +modm::ResumableResult +modm::Ssd1306::initializeMemoryMode() { RF_BEGIN(); commandBuffer[0] = AdressingCommands::MemoryMode; commandBuffer[1] = MemoryMode::HORIZONTAL; - transaction_success &= RF_CALL(writeCommands(2)); - - // Default on Power-up - can be omitted - commandBuffer[0] = AdressingCommands::ColumnAddress; - commandBuffer[1] = 0; - commandBuffer[2] = 127; - commandBuffer[3] = AdressingCommands::PageAddress; - commandBuffer[4] = 0; - commandBuffer[5] = 7; - transaction_success &= RF_CALL(writeCommands(6)); - - RF_END(); -} - -// ---------------------------------------------------------------------------- -template -modm::ResumableResult -modm::Ssd1306::startWriteDisplay() -{ - RF_BEGIN(); - - RF_WAIT_UNTIL( - this->transaction.configureDisplayWrite((uint8_t*)(&this->buffer), sizeof(this->buffer)) and - this->startTransaction()); - - RF_END(); + RF_END_RETURN_CALL(writeCommands(2)); } -template +template modm::ResumableResult -modm::Ssd1306::writeDisplay() +modm::Ssd1306::setOrientation(display::Orientation orientation) { RF_BEGIN(); - RF_CALL(startWriteDisplay()); + // No support for Portrait + if(orientation & modm::display::OrientationFlags::Portrait) + RF_RETURN(false); - RF_WAIT_WHILE(this->isTransactionRunning()); + switch (orientation) + { + case display::Orientation::Landscape0: + commandBuffer[0] = HardwareConfigCommands::SegmentRemap127; + commandBuffer[1] = HardwareConfigCommands::ComOutputScanDirectionDecrement; + break; + case display::Orientation::Landscape180: + commandBuffer[0] = HardwareConfigCommands::SegmentRemap0; + commandBuffer[1] = HardwareConfigCommands::ComOutputScanDirectionIncrement; + break; + } - RF_END_RETURN(this->wasTransactionSuccessful()); + RF_CALL(writeCommands(2)); + RF_END_RETURN_CALL(clear()); } -template +template modm::ResumableResult -modm::Ssd1306::setOrientation(glcd::Orientation orientation) -{ +modm::Ssd1306::set(Toggle toggle, bool state) { RF_BEGIN(); - if (orientation == glcd::Orientation::Landscape0) - { - commandBuffer[0] = HardwareConfigCommands::SegmentRemap127; - commandBuffer[1] = HardwareConfigCommands::ComOutputScanDirectionDecrement; - } - else if (orientation == glcd::Orientation::Landscape180) - { - commandBuffer[0] = HardwareConfigCommands::SegmentRemap0; - commandBuffer[1] = HardwareConfigCommands::ComOutputScanDirectionIncrement; - } + commandBuffer[0] = uint8_t(toggle) | uint8_t(state); - RF_END_RETURN_CALL(writeCommands(2)); + RF_END_RETURN_CALL(writeCommands(1)); } -template +template modm::ResumableResult -modm::Ssd1306::configureScroll(uint8_t origin, uint8_t size, +modm::Ssd1306::configureScroll(uint8_t origin, uint8_t size, ScrollDirection direction, ScrollStep steps) { RF_BEGIN(); - if (!RF_CALL(disableScroll())) - RF_RETURN(false); + if (!RF_CALL(disableScroll())) RF_RETURN(false); { uint8_t beginY = (origin > 7) ? 7 : origin; @@ -170,11 +135,9 @@ modm::Ssd1306::configureScroll(uint8_t origin, uint8_t size, RF_END_RETURN_CALL(writeCommands(7)); } -// ---------------------------------------------------------------------------- -// MARK: write command -template +template modm::ResumableResult -modm::Ssd1306::writeCommands(std::size_t length) +modm::Ssd1306::writeCommands(std::size_t length) { RF_BEGIN(); @@ -184,3 +147,94 @@ modm::Ssd1306::writeCommands(std::size_t length) RF_END_RETURN(this->wasTransactionSuccessful()); } + +template +modm::ResumableResult +modm::Ssd1306::setClipping(shape::Area area) +{ + RF_BEGIN(); + + commandBuffer[0] = AdressingCommands::ColumnAddress; + commandBuffer[1] = area.topLeft.x; + commandBuffer[2] = area.bottomRight.x - 1; + commandBuffer[3] = AdressingCommands::PageAddress; + commandBuffer[4] = area.topLeft.y / 8; + commandBuffer[5] = (area.bottomRight.y / 8) - 1; + + RF_END_RETURN_CALL(writeCommands(6)); +} + +// TODO Test in Hardware +template +modm::ResumableResult +modm::Ssd1306::clear(bool color) +{ + // OPTIMIZE Make this impossible fast by using DMA + RF_BEGIN(); + + std::fill(commandBuffer[0], commandBuffer[7], color ? 0xFF : 0x00); + transaction_success = true; + + RF_CALL(setClipping(this->asArea())); + + while(true) { + RF_WAIT_UNTIL(this->transaction.configureDisplayWrite(commandBuffer, 7)); + this->startTransaction(); + RF_WAIT_WHILE(this->isTransactionRunning()); + transaction_success &= this->wasTransactionSuccessful(); + + // TODO Needs end condition + } + + RF_END_RETURN(true); +} + +template +template +modm::ResumableResult +modm::Ssd1306::writeBuffer(Buffer &buffer) +{ + // TODO substitute static_assert with concept, so this implementation would be omitted + static_assert(R::W <= 128, "Buffer to wide to be written fast. Use writeBuffer(buffer, {0, 0} instead)"); + + RF_BEGIN(); + + static constexpr uint16_t Wclip = R::W <= 128 ? R::W : 128; + static constexpr uint16_t Hclip = R::H <= H ? R::H : H; + RF_CALL(setClipping(Area{{0,0}, shape::Point(Wclip, Hclip)})); + RF_WAIT_UNTIL(this->transaction.configureDisplayWrite(this->getPlainBuffer(buffer), Wclip * Hclip / 8)); + // OPTIMIZE requires constexpr Area::Area(..) + // static constexpr shape::Area area{ + // {0,0}, + // {R::H <= H ? R::H : H, R::W <= 128 ? R::W : 128} + // }; + // RF_CALL(setClipping(area)); + // RF_WAIT_UNTIL(this->transaction.configureDisplayWrite(this->getPlainBuffer(buffer), area.getPixels() / 8)); + + this->startTransaction(); + RF_WAIT_WHILE(this->isTransactionRunning()); + + RF_END_RETURN(this->wasTransactionSuccessful()); +} + +template +template +modm::ResumableResult +modm::Ssd1306::writeBuffer(Buffer &buffer, + shape::Point topLeft) +{ + RF_BEGIN(); + + this->bottom_right = topLeft + shape::Point(R::W, R::H); + + if (this->bottom_right.x <= 128 && this->bottom_right.y <= H + 7) + { + RF_CALL(setClipping(Area{topLeft, this->bottom_right})); + + RF_WAIT_UNTIL(this->transaction.configureDisplayWrite(this->getPlainBuffer(buffer), R::W * R::H / 8)); + this->startTransaction(); + RF_WAIT_WHILE(this->isTransactionRunning()); + } + + RF_END_RETURN(this->wasTransactionSuccessful()); +} \ No newline at end of file diff --git a/src/modm/driver/display/ssd1306_register.hpp b/src/modm/driver/display/ssd1306_register.hpp index 37d8ea0e5b..6978a54d0e 100644 --- a/src/modm/driver/display/ssd1306_register.hpp +++ b/src/modm/driver/display/ssd1306_register.hpp @@ -16,6 +16,12 @@ namespace modm struct ssd1306_register { +public: + // Bit0 => false: Off, true: On + enum Toggle { + Inversion = 0xA6, + Enable = 0xAE + }; protected: enum Transfer : uint8_t { @@ -27,23 +33,19 @@ struct ssd1306_register enum FundamentalCommands : uint8_t { - ContrastControl = 0x81, // Range 1-255 + ContrastControl = 0x81, // Range 1-255 EntireDisplayResumeToRam = 0xA4, EntireDisplayIgnoreRam = 0xA5, - NormalDisplay = 0xA6, - InvertedDisplay = 0xA7, - DisplayOff = 0xAE, - DisplayOn = 0xAF, }; enum AdressingCommands : uint8_t { - MemoryMode = 0x20, // enum MemoryMode + MemoryMode = 0x20, // enum MemoryMode // HORIZONTAL and VERTICAL addressing only - ColumnAddress = 0x21, // Range 0-127 - PageAddress = 0x22, // Range 0-7 + ColumnAddress = 0x21, // Range 0-127 + PageAddress = 0x22, // Range 0-7 // PAGE addressing only - PageStartAddress = 0xB0, // Range 0-7 + PageStartAddress = 0xB0, // Range 0-7 LowerColumnStartAddress = 0x00, HigherColumnStartAddress = 0x10, }; @@ -53,11 +55,11 @@ struct ssd1306_register DisplayStartLine = 0x40, SegmentRemap0 = 0xA0, SegmentRemap127 = 0xA1, - MultiplexRatio = 0xA8, // Range 16-64 + MultiplexRatio = 0xA8, // Range 16-64 ComOutputScanDirectionIncrement = 0xC0, ComOutputScanDirectionDecrement = 0xC8, - DisplayOffset = 0xD3, // Range 0-63 - ComPinsOrder = 0xDA, // enum ComPinsOrder + DisplayOffset = 0xD3, // Range 0-63 + ComPinsOrder = 0xDA, }; enum ScrollingCommands : uint8_t @@ -71,6 +73,15 @@ struct ssd1306_register EnableScroll = 0x2F, }; + enum TimingAndDrivingCommands : uint8_t + { + ChargePump = 0x8D, // enum ChargePump + DisplayClockDivideRatio = 0xD5, // [7:4] Frequency [3:0] Prescaler + PreChargePeriod = 0xD9, + V_DeselectLevel = 0xDB, // 0: ~0.65 x VCC, 1: 0.71 x VCC, 2: 0.77 x VCC, 3: 0.83 x VCC + Nop = 0xE3 + }; + enum MemoryMode : uint8_t { HORIZONTAL = 0, @@ -78,15 +89,6 @@ struct ssd1306_register PAGE = 2 }; - enum TimingAndDrivingCommands : uint8_t - { - ChargePump = 0x8D, // enum ChargePump - DisplayClockDivideRatio = 0xD5, // [7:4] Frequency [3:0] Prescaler - PreChargePeriod = 0xD9, - V_DeselectLevel = 0xDB, // 0: ~0.65 x VCC, 1: 0.71 x VCC, 2: 0.77 x VCC, 3: 0.83 x VCC - Nop = 0xE3 - }; - enum ChargePump : uint8_t { DISABLE = 0x00, diff --git a/src/modm/ui/display/character_display.cpp b/src/modm/ui/character_display.cpp similarity index 100% rename from src/modm/ui/display/character_display.cpp rename to src/modm/ui/character_display.cpp diff --git a/src/modm/ui/display/character_display.hpp b/src/modm/ui/character_display.hpp similarity index 100% rename from src/modm/ui/display/character_display.hpp rename to src/modm/ui/character_display.hpp diff --git a/src/modm/ui/color.cpp b/src/modm/ui/color.cpp deleted file mode 100644 index 7e19a0655f..0000000000 --- a/src/modm/ui/color.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2009-2010, 2012, Fabian Greif - * Copyright (c) 2010, Martin Rosekeit - * Copyright (c) 2012-2013, Niklas Hauser - * Copyright (c) 2013, David Hebbeker - * - * This file is part of the modm project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -// ---------------------------------------------------------------------------- - -#include "color.hpp" - -// ---------------------------------------------------------------------------- -namespace modm { -namespace color { -template<> template<> -void -HsvT::toRgb(RgbT* color) const -{ - uint16_t vs = value * saturation; - uint16_t h6 = 6 * hue; - - uint8_t p = ((value << 8) - vs) >> 8; - uint8_t i = h6 >> 8; - uint16_t f = ((i | 1) << 8) - h6; - if (i & 1) { - f = -f; - } - - uint8_t u = (((uint32_t) value << 16) - (uint32_t) vs * f) >> 16; - uint8_t r = value; - uint8_t g = value; - uint8_t b = value; - switch(i) - { - case 0: g = u; b = p; break; - case 1: r = u; b = p; break; - case 2: r = p; b = u; break; - case 3: r = p; g = u; break; - case 4: r = u; g = p; break; - case 5: g = p; b = u; break; - } - - color->red = r; - color->green = g; - color->blue = b; -} -} // namespace color -} // namespace modm diff --git a/src/modm/ui/color.hpp b/src/modm/ui/color.hpp index 64e4ef53ce..8fe3d1b110 100644 --- a/src/modm/ui/color.hpp +++ b/src/modm/ui/color.hpp @@ -15,7 +15,7 @@ #include "color/rgb.hpp" #include "color/hsv.hpp" -#include "color/brightness.hpp" +#include "color/grayscale.hpp" #include "color/rgb565.hpp" #include "color/rgbhtml.hpp" diff --git a/src/modm/ui/color/brightness.hpp b/src/modm/ui/color/grayscale.hpp similarity index 66% rename from src/modm/ui/color/brightness.hpp rename to src/modm/ui/color/grayscale.hpp index bc5e961cb5..da6404ba0f 100644 --- a/src/modm/ui/color/brightness.hpp +++ b/src/modm/ui/color/grayscale.hpp @@ -29,34 +29,35 @@ class RgbT; template class HsvT; +template class Rgb565; /** - * @brief Brightness as unsigned integral. Add's the math for conversion to and from - * Color-Types. Use with: Grayscale Buffers, Dimmed LEDs, Brightness sensors + * @brief Grayscale as unsigned integral. Add's the math for conversion to and from + * Color-Types. Use with: Grayscale Buffers, Dimmed LEDs, Grayscale sensors * * @author Thomas Sommer * - * @tparam T Unsigned integral for the brightness-value + * @tparam T Unsigned integral for the grayscale-value * @ingroup modm_ui_color */ template -class BrightnessT +class GrayscaleT { public: T value{0}; - constexpr BrightnessT() = default; + constexpr GrayscaleT() = default; - constexpr BrightnessT(T value) : value(value) {} + constexpr GrayscaleT(T value) : value(value) {} /** * Copy Constructor 8bit->16bit */ template requires std::is_same_v && std::is_same_v - constexpr BrightnessT(const BrightnessT &brightness_other) - : value(brightness_other.value << 8) + constexpr GrayscaleT(const GrayscaleT &other) + : value(other.value << 8) {} /** @@ -64,8 +65,8 @@ class BrightnessT */ template requires std::is_same_v && std::is_same_v - constexpr BrightnessT(const BrightnessT &brightness_other) - : value(brightness_other.value >> 8) + constexpr GrayscaleT(const GrayscaleT &other) + : value(other.value >> 8) {} /** @@ -74,7 +75,7 @@ class BrightnessT * @param rgb RGB Color */ template - constexpr BrightnessT(RgbT rgb) + constexpr GrayscaleT(RgbT rgb) : value((0.2125 * float(rgb.red)) + (0.7154 * float(rgb.green)) + (0.0721 * float(rgb.blue))) {} @@ -85,7 +86,7 @@ class BrightnessT * @param hsv HSV Color */ template - constexpr BrightnessT(HsvT hsv) : value(hsv.value) + constexpr GrayscaleT(HsvT hsv) : value(hsv.value) {} /** @@ -93,13 +94,14 @@ class BrightnessT * * @param rgb565 RGB565 Color */ - constexpr BrightnessT(Rgb565 rgb565) : BrightnessT(RgbT(rgb565)) {} + template + constexpr GrayscaleT(Rgb565 rgb565) : GrayscaleT(RgbT(rgb565)) {} constexpr bool - operator==(const BrightnessT &other) const = default; + operator==(const GrayscaleT &other) const = default; }; /// @ingroup modm_ui_color -using Brightness = BrightnessT; +using Grayscale = GrayscaleT; } // namespace modm::color diff --git a/src/modm/ui/color/hsv.hpp b/src/modm/ui/color/hsv.hpp index 57fada273b..1ab1d87be7 100644 --- a/src/modm/ui/color/hsv.hpp +++ b/src/modm/ui/color/hsv.hpp @@ -19,7 +19,7 @@ #include #include -#include "brightness.hpp" +#include "grayscale.hpp" #include "rgb.hpp" #include "rgb565.hpp" @@ -31,8 +31,9 @@ template class RgbT; template -class BrightnessT; +class GrayscaleT; +template class Rgb565; /** @@ -45,6 +46,8 @@ template class HsvT { public: + static constexpr bool isColor = true; + T hue{0}; T saturation{0}; T value{0}; @@ -80,12 +83,12 @@ class HsvT constexpr HsvT(const RgbT& rgb); /** - * Convertion Constructor for Brightness + * Convertion Constructor for Grayscale * - * @param brightness Brightness 'Color'-object + * @param grayscale Grayscale 'Color'-object */ template - constexpr HsvT(const BrightnessT gray) : hue(0), saturation(0), value(gray.value) + constexpr HsvT(const GrayscaleT gray) : hue(0), saturation(0), value(gray.value) {} /** @@ -93,7 +96,8 @@ class HsvT * * @param rgb565 RGB565 Color */ - constexpr HsvT(const Rgb565& rgb565) : HsvT(RgbT(rgb565)) {} + template + constexpr HsvT(const Rgb565& rgb565) : HsvT(RgbT(rgb565)) {} constexpr bool operator==(const HsvT& other) const = default; diff --git a/src/modm/ui/color/rgb.hpp b/src/modm/ui/color/rgb.hpp index cb5df9f00a..a7f856a6eb 100644 --- a/src/modm/ui/color/rgb.hpp +++ b/src/modm/ui/color/rgb.hpp @@ -24,7 +24,7 @@ #include #include -#include "brightness.hpp" +#include "grayscale.hpp" #include "hsv.hpp" #include "rgb565.hpp" @@ -36,8 +36,9 @@ template class HsvT; template -class BrightnessT; +class GrayscaleT; +template class Rgb565; /** @@ -50,6 +51,8 @@ template class RgbT { public: + static constexpr bool isColor = true; + T red{0}; T green{0}; T blue{0}; @@ -87,14 +90,14 @@ class RgbT constexpr RgbT(const HsvT& hsv); /** - * Convertion Constructor for Brightness + * Convertion Constructor for Grayscale * - * @param brightness Brightness 'Color'-object + * @param grayscale Grayscale 'Color'-object */ // TODO Plump conversion, implement the right way template - constexpr RgbT(const BrightnessT brightness) - : red(brightness), green(brightness), blue(brightness) + constexpr RgbT(const GrayscaleT grayscale) + : red(grayscale.value), green(grayscale.value), blue(grayscale.value) {} /** @@ -102,12 +105,20 @@ class RgbT * * @param rgb565 RGB565 Color */ - constexpr RgbT(const Rgb565& rgb565) + constexpr RgbT(const Rgb565& rgb565) : red((rgb565.color >> 8) & 0xF8), green((rgb565.color >> 3) & 0xFC), blue(rgb565.color << 3) {} + constexpr RgbT(const Rgb565& rgb565) + { + uint16_t color = std::rotr(rgb565.color, 8); + red = (rgb565.color >> 8) & 0xF8; + green = (rgb565.color >> 3) & 0xFC; + blue = rgb565.color << 3; + } + constexpr bool operator==(const RgbT& other) const = default; diff --git a/src/modm/ui/color/rgb565.hpp b/src/modm/ui/color/rgb565.hpp index dbb19aba56..4e4b33b169 100644 --- a/src/modm/ui/color/rgb565.hpp +++ b/src/modm/ui/color/rgb565.hpp @@ -12,8 +12,9 @@ #pragma once #include +#include -#include "brightness.hpp" +#include "grayscale.hpp" #include "hsv.hpp" #include "rgb.hpp" @@ -28,7 +29,7 @@ template class HsvT; template -class BrightnessT; +class GrayscaleT; /** * Color in RGB Colorspace, 16 bits: RRRR RGGG GGGB BBBB @@ -36,9 +37,13 @@ class BrightnessT; * @author Fabian Greif, Thomas Sommer * @ingroup modm_ui_color */ + +template class Rgb565 { public: + static constexpr bool isColor = true; + uint16_t color{0x0000}; using RgbCalcType = RgbT; @@ -61,7 +66,9 @@ class Rgb565 */ constexpr Rgb565(uint8_t red, uint8_t green, uint8_t blue) : color(uint16_t(red & 0xF8) << 8 | uint16_t(green & 0xFC) << 3 | uint16_t(blue >> 3)) - {} + { + if(BigEndian) color = std::rotr(color, 8); + } /** * Convertion Constructor for RGB Color @@ -82,12 +89,12 @@ class Rgb565 {} /** - * Convertion Constructor for Brightness + * Convertion Constructor for Grayscale * - * @param brightness Brightness 'Color'-object + * @param grayscale Grayscale 'Color'-object */ template - constexpr Rgb565(const BrightnessT brightness) : Rgb565(RgbCalcType(brightness)) + constexpr Rgb565(const GrayscaleT grayscale) : Rgb565(RgbCalcType(grayscale)) {} constexpr bool @@ -97,6 +104,7 @@ class Rgb565 Rgb565 operator+(const Rgb565 other) const { + // FIXME implement for BigEndian == true const int8_t red_raw = (color >> 11) + (other.color >> 11); const uint16_t red = std::clamp(red_raw, 0, 31) << 11; @@ -113,6 +121,7 @@ class Rgb565 Rgb565 operator-(const Rgb565 other) const { + // FIXME implement for BigEndian == true const int8_t red_raw = (color >> 11) - (other.color >> 11); const uint16_t red = std::clamp(red_raw, 0, 0x1F) << 11; diff --git a/src/modm/ui/color/rgbhtml.hpp b/src/modm/ui/color/rgbhtml.hpp index 71d6c9dccd..51abcaca86 100644 --- a/src/modm/ui/color/rgbhtml.hpp +++ b/src/modm/ui/color/rgbhtml.hpp @@ -21,6 +21,7 @@ namespace modm::color::html * * @see https://htmlcolorcodes.com/color-names/ * @see modm:color:RgbT + * @author Thomas Sommer * @ingroup modm_ui_color * @{ */ diff --git a/src/modm/ui/color_impl.hpp b/src/modm/ui/color_impl.hpp deleted file mode 100644 index 5cf8aa4439..0000000000 --- a/src/modm/ui/color_impl.hpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2013-2015, Niklas Hauser - * - * This file is part of the modm project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -// ---------------------------------------------------------------------------- - -#ifndef MODM_COLOR_HPP -# error "Don't include this file directly, use 'color.hpp' instead!" -#endif - -#include -#include - -/** - * @see http://de.wikipedia.org/wiki/HSV-Farbraum#Umrechnung_RGB_in_HSV.2FHSL - * @param color - */ -template template -inline void -modm::color::RgbT::toHsv(HsvT* color) const -{ - typedef float CalcType; - const CalcType maxValue = std::numeric_limits::max(); - const CalcType _red = static_cast(red) / maxValue; - const CalcType _blue = static_cast(blue) / maxValue; - const CalcType _green = static_cast(green) / maxValue; - const CalcType _max = std::max(_red, std::max(_green, _blue)); - const CalcType _min = std::min(_red, std::min(_green, _blue)); - const CalcType _diff = _max - _min; - - CalcType hue_temp; - - // CALCULATE HUE - if(_max == _min) { // all three color values are the same - hue_temp = 0; - color->value = _max * maxValue; - } - else if(_max == _red) { - hue_temp = 60 * (0 + (_green - _blue) / _diff ); - color->value = red; - } - else if(_max == _green) { - hue_temp = 60 * (2 + (_blue - _red) / _diff ); - color->value = green; - } - else /*if(_max == _blue)*/ { - hue_temp = 60 * (4 + (_red - _green) / _diff ); - color->value = blue; - } - - if(hue_temp < 0) { - color->hue = (hue_temp + 360 ) * (maxValue / 360); - } - else { - color->hue = (hue_temp ) * (maxValue / 360); - } - - // CALCULATE SATURATION - if(_max == 0) { - color->saturation = 0; - } else { - color->saturation = _diff / _max * maxValue; - } -} - -template -modm::IOStream& -modm::color::operator << ( modm::IOStream& os, const modm::color::RgbT& color) -{ - os << color.red << "\t" << color.green << "\t" << color.blue; - return os; -} - -template -modm::IOStream& -modm::color::operator << ( modm::IOStream& os, const modm::color::HsvT& color) -{ - os << color.hue << "\t" << color.saturation << "\t" << color.value; - return os; -} \ No newline at end of file diff --git a/src/modm/ui/display/color_graphic_display.hpp b/src/modm/ui/display/color_graphic_display.hpp deleted file mode 100644 index c9a6cbf5ef..0000000000 --- a/src/modm/ui/display/color_graphic_display.hpp +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef MODM_COLOR_GRAPHIC_DISPLAY_HPP -#define MODM_COLOR_GRAPHIC_DISPLAY_HPP - -#include - -#include "graphic_display.hpp" - -using namespace modm::platform; - -namespace modm -{ -class ColorGraphicDisplay : public GraphicDisplay -{ -public: - ColorGraphicDisplay() - : foregroundColor(color::html::White), backgroundColor(color::html::Black) - {} - - virtual color::Rgb565 - getPixel(int16_t x, int16_t y) const = 0; - - /** - * Set a new foreground color. - * Used for drawing operations. Default is white. - */ - inline void - setColor(const color::Rgb565 color) - { - foregroundColor = color; - } - - inline color::Rgb565 - getColor() const - { - return foregroundColor; - } - - /** - * Set background color. - * Used when clearing the screen. Default is black. - */ - inline void - setBackgroundColor(const color::Rgb565 color) - { - backgroundColor = color; - } - - inline color::Rgb565 - getBackgroundColor() const - { - return backgroundColor; - } - -protected: - color::Rgb565 foregroundColor; - color::Rgb565 backgroundColor; -}; -} // namespace modm - -#endif // MODM_COLOR_GRAPHIC_DISPLAY_HPP diff --git a/src/modm/ui/display/font/all_caps_3x5.font b/src/modm/ui/display/font/all_caps_3x5.font deleted file mode 100644 index 281d971d6a..0000000000 --- a/src/modm/ui/display/font/all_caps_3x5.font +++ /dev/null @@ -1,677 +0,0 @@ -#font : All Caps 3x5 -#width : 3 -#height : 5 -#hspace : 1 -#vspace : 1 - -#char : 32 ' ' -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 33 '!' -[#] -[#] -[#] -[ ] -[#] - -#char : 34 '"' -[##] -[##] -[ ] -[ ] -[ ] - -#char : 35 '#' -[# # ] -[####] -[# # ] -[####] -[# # ] - -#char : 36 '$' -[ # ] -[###] -[ # ] -[###] -[ # ] - -#char : 37 '%' -[ ] -[# #] -[ # ] -[# #] -[ ] - -#char : 38 '&' -[ ## ] -[# #] -[ ## ] -[# # ] -[## #] - -#char : 39 ''' -[#] -[#] -[ ] -[ ] -[ ] - -#char : 40 '(' -[ #] -[# ] -[# ] -[# ] -[ #] - -#char : 41 ')' -[# ] -[ #] -[ #] -[ #] -[# ] - -#char : 42 '*' -[ ] -[# #] -[ # ] -[# #] -[ ] - -#char : 43 '+' -[ ] -[ # ] -[###] -[ # ] -[ ] - -#char : 44 ',' -[ ] -[ ] -[ ] -[ #] -[# ] - -#char : 45 '-' -[ ] -[ ] -[###] -[ ] -[ ] - -#char : 46 '.' -[ ] -[ ] -[ ] -[ ] -[#] - -#char : 47 '/' -[ #] -[ # ] -[ # ] -[ # ] -[# ] - -#char : 48 '0' -[###] -[# #] -[# #] -[# #] -[###] - -#char : 49 '1' -[ # ] -[## ] -[ # ] -[ # ] -[###] - -#char : 50 '2' -[###] -[ #] -[###] -[# ] -[###] - -#char : 51 '3' -[###] -[ #] -[ ##] -[ #] -[###] - -#char : 52 '4' -[# ] -[# #] -[###] -[ #] -[ #] - -#char : 53 '5' -[###] -[# ] -[###] -[ #] -[###] - -#char : 54 '6' -[###] -[# ] -[###] -[# #] -[###] - -#char : 55 '7' -[###] -[ #] -[ # ] -[ # ] -[ # ] - -#char : 56 '8' -[###] -[# #] -[###] -[# #] -[###] - -#char : 57 '9' -[###] -[# #] -[###] -[ #] -[###] - -#char : 58 ':' -[ ] -[#] -[ ] -[#] -[ ] - -#char : 59 ';' -[ ] -[ #] -[ ] -[ #] -[# ] - -#char : 60 '<' -[ #] -[ # ] -[# ] -[ # ] -[ #] - -#char : 61 '=' -[ ] -[###] -[ ] -[###] -[ ] - -#char : 62 '>' -[# ] -[ # ] -[ #] -[ # ] -[# ] - -#char : 63 '?' -[###] -[ #] -[ # ] -[ ] -[ # ] - -#char : 64 '@' -[ ] -[ ##] -[# ] -[# #] -[###] - -#char : 65 'A' -[ # ] -[# #] -[###] -[# #] -[# #] - -#char : 66 'B' -[## ] -[# #] -[## ] -[# #] -[## ] - -#char : 67 'C' -[ ##] -[# ] -[# ] -[# ] -[ ##] - -#char : 68 'D' -[## ] -[# #] -[# #] -[# #] -[## ] - -#char : 69 'E' -[###] -[# ] -[## ] -[# ] -[###] - -#char : 70 'F' -[###] -[# ] -[## ] -[# ] -[# ] - -#char : 71 'G' -[ ##] -[# ] -[# #] -[# #] -[ ##] - -#char : 72 'H' -[# #] -[# #] -[###] -[# #] -[# #] - -#char : 73 'I' -[#] -[#] -[#] -[#] -[#] - -#char : 74 'J' -[ #] -[ #] -[ #] -[ #] -[# ] - -#char : 75 'K' -[# ] -[# #] -[## ] -[# #] -[# #] - -#char : 76 'L' -[# ] -[# ] -[# ] -[# ] -[###] - -#char : 77 'M' -[# #] -[###] -[# #] -[# #] -[# #] - -#char : 78 'N' -[## ] -[# #] -[# #] -[# #] -[# #] - -#char : 79 'O' -[ ##] -[# #] -[# #] -[# #] -[## ] - -#char : 80 'P' -[## ] -[# #] -[###] -[# ] -[# ] - -#char : 81 'Q' -[ # ] -[# #] -[# #] -[###] -[ ##] - -#char : 82 'R' -[## ] -[# #] -[## ] -[# #] -[# #] - -#char : 83 'S' -[ ##] -[# ] -[ # ] -[ #] -[## ] - -#char : 84 'T' -[###] -[ # ] -[ # ] -[ # ] -[ # ] - -#char : 85 'U' -[# #] -[# #] -[# #] -[# #] -[ ##] - -#char : 86 'V' -[# #] -[# #] -[# #] -[# #] -[ # ] - -#char : 87 'W' -[# #] -[# #] -[# #] -[###] -[# #] - -#char : 88 'X' -[# #] -[# #] -[ # ] -[# #] -[# #] - -#char : 89 'Y' -[# #] -[# #] -[###] -[ # ] -[ # ] - -#char : 90 'Z' -[###] -[ #] -[ # ] -[# ] -[###] - -#char : 91 '[' -[##] -[# ] -[# ] -[# ] -[##] - -#char : 92 '\' -[# ] -[ # ] -[ # ] -[ # ] -[ #] - -#char : 93 ']' -[##] -[ #] -[ #] -[ #] -[##] - -#char : 94 '^' -[ # ] -[# #] -[ ] -[ ] -[ ] - -#char : 95 '_' -[ ] -[ ] -[ ] -[ ] -[###] - -#char : 96 '`' -[# ] -[ #] -[ ] -[ ] -[ ] - -#char : 97 'a' -[ # ] -[# #] -[###] -[# #] -[# #] - -#char : 98 'b' -[## ] -[# #] -[## ] -[# #] -[## ] - -#char : 99 'c' -[ ##] -[# ] -[# ] -[# ] -[ ##] - -#char : 100 'd' -[## ] -[# #] -[# #] -[# #] -[## ] - -#char : 101 'e' -[###] -[# ] -[## ] -[# ] -[###] - -#char : 102 'f' -[###] -[# ] -[## ] -[# ] -[# ] - -#char : 103 'g' -[ ##] -[# ] -[# #] -[# #] -[ ##] - -#char : 104 'h' -[# #] -[# #] -[###] -[# #] -[# #] - -#char : 105 'i' -[#] -[#] -[#] -[#] -[#] - -#char : 106 'j' -[ #] -[ #] -[ #] -[ #] -[# ] - -#char : 107 'k' -[# ] -[# #] -[## ] -[# #] -[# #] - -#char : 108 'l' -[# ] -[# ] -[# ] -[# ] -[###] - -#char : 109 'm' -[# #] -[###] -[# #] -[# #] -[# #] - -#char : 110 'n' -[## ] -[# #] -[# #] -[# #] -[# #] - -#char : 111 'o' -[ ##] -[# #] -[# #] -[# #] -[## ] - -#char : 112 'p' -[## ] -[# #] -[###] -[# ] -[# ] - -#char : 113 'q' -[ # ] -[# #] -[# #] -[###] -[ ##] - -#char : 114 'r' -[## ] -[# #] -[## ] -[# #] -[# #] - -#char : 115 's' -[ ##] -[# ] -[ # ] -[ #] -[## ] - -#char : 116 't' -[###] -[ # ] -[ # ] -[ # ] -[ # ] - -#char : 117 'u' -[# #] -[# #] -[# #] -[# #] -[ ##] - -#char : 118 'v' -[# #] -[# #] -[# #] -[# #] -[ # ] - -#char : 119 'w' -[# #] -[# #] -[# #] -[###] -[# #] - -#char : 120 'x' -[# #] -[# #] -[ # ] -[# #] -[# #] - -#char : 121 'y' -[# #] -[# #] -[###] -[ # ] -[ # ] - -#char : 122 'z' -[###] -[ #] -[ # ] -[# ] -[###] - -#char : 123 '{' -[ #] -[ # ] -[## ] -[ # ] -[ #] - -#char : 124 '|' -[#] -[#] -[#] -[#] -[#] - -#char : 125 '}' -[# ] -[ # ] -[ ##] -[ # ] -[# ] - -#char : 126 '~' -[ ] -[ # ] -[###] -[ ] -[ ] - -#char : 127 -[ ] -[ ] -[ ] -[ ] -[ ] diff --git a/src/modm/ui/display/font/arcade_classic.font b/src/modm/ui/display/font/arcade_classic.font deleted file mode 100644 index 4bde9e6854..0000000000 --- a/src/modm/ui/display/font/arcade_classic.font +++ /dev/null @@ -1,965 +0,0 @@ -#font : Arcade Classic -#width : 7 -#height : 8 -#hspace : 0 -#vspace : 1 - -#char : 32 ' ' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 33 '!' -[ ### ] -[ ### ] -[ ## ] -[ ## ] -[ # ] -[ ] -[ # ] -[ ] - -#char : 34 '"' -[ ## ## ] -[ ## ## ] -[ # # ] -[ # # ] -[ ] -[ ] -[ ] -[ ] - -#char : 35 '#' -[ ## ## ] -[ ## ## ] -[#######] -[ ## ## ] -[#######] -[ ## ## ] -[ ## ## ] -[ ] - -#char : 36 '$' -[ # ] -[ ##### ] -[## ] -[ ##### ] -[ ##] -[ ##### ] -[ # ] -[ ] - -#char : 37 '%' -[ ] -[## ##] -[## ## ] -[ ## ] -[ ## ] -[ ## ##] -[## ##] -[ ] - -#char : 38 '&' -[ #### ] -[## ## ] -[## ## ] -[ ### ] -[## ####] -[## ## ] -[ ### ##] -[ ] - -#char : 39 ''' -[ ## ] -[ ## ] -[ # ] -[ # ] -[ ] -[ ] -[ ] -[ ] - -#char : 40 '(' -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ] - -#char : 41 ')' -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ] - -#char : 42 '*' -[ ] -[ # ] -[ # # # ] -[ ### ] -[ # # # ] -[ # ] -[ ] -[ ] - -#char : 43 '+' -[ ] -[ # ] -[ # ] -[ ##### ] -[ # ] -[ # ] -[ ] -[ ] - -#char : 44 ',' -[ ] -[ ] -[ ] -[ ] -[ ## ] -[ ## ] -[ # ] -[ # ] - -#char : 45 '-' -[ ] -[ ] -[ ] -[ ##### ] -[ ] -[ ] -[ ] -[ ] - -#char : 46 '.' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ## ] -[ ## ] -[ ] - -#char : 47 '/' -[ ] -[ ##] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[## ] -[ ] - -#char : 48 '0' -[ ### ] -[ # ## ] -[## ##] -[## ##] -[## ##] -[ ## # ] -[ ### ] -[ ] - -#char : 49 '1' -[ ## ] -[ ### ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[###### ] -[ ] - -#char : 50 '2' -[ ##### ] -[## ##] -[ ###] -[ #### ] -[ ## ] -[## ] -[#######] -[ ] - -#char : 51 '3' -[ ######] -[ ## ] -[ ## ] -[ #### ] -[ ##] -[## ##] -[ ##### ] -[ ] - -#char : 52 '4' -[ ### ] -[ #### ] -[ ## ## ] -[## ## ] -[#######] -[ ## ] -[ ## ] -[ ] - -#char : 53 '5' -[###### ] -[## ] -[###### ] -[ ##] -[ ##] -[## ##] -[ ##### ] -[ ] - -#char : 54 '6' -[ #### ] -[ ## ] -[## ] -[###### ] -[## ##] -[## ##] -[ ##### ] -[ ] - -#char : 55 '7' -[#######] -[## ##] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ] - -#char : 56 '8' -[ #### ] -[## # ] -[### # ] -[ #### ] -[# ####] -[# ##] -[ ##### ] -[ ] - -#char : 57 '9' -[ ##### ] -[## ##] -[## ##] -[ ######] -[ ##] -[ ## ] -[ #### ] -[ ] - -#char : 58 ':' -[ ] -[ ] -[ ## ] -[ ## ] -[ ] -[ ## ] -[ ## ] -[ ] - -#char : 59 ';' -[ ] -[ ] -[ ## ] -[ ## ] -[ ] -[ ## ] -[ # ] -[ # ] - -#char : 60 '<' -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ] - -#char : 61 '=' -[ ] -[ ] -[ ##### ] -[ ] -[ ##### ] -[ ] -[ ] -[ ] - -#char : 62 '>' -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ] - -#char : 63 '?' -[ ##### ] -[## ##] -[ ##] -[ ### ] -[ ## ] -[ ] -[ ## ] -[ ] - -#char : 64 '@' -[ ### ] -[ # # ] -[# # #] -[# # # #] -[# # ###] -[# # ] -[ # # ] -[ ### ] - -#char : 65 'A' -[ ### ] -[ ## ## ] -[## ##] -[## ##] -[#######] -[## ##] -[## ##] -[ ] - -#char : 66 'B' -[###### ] -[## ##] -[## ##] -[###### ] -[## ##] -[## ##] -[###### ] -[ ] - -#char : 67 'C' -[ #### ] -[ ## ##] -[## ] -[## ] -[## ] -[ ## ##] -[ #### ] -[ ] - -#char : 68 'D' -[##### ] -[## ## ] -[## ##] -[## ##] -[## ##] -[## ## ] -[##### ] -[ ] - -#char : 69 'E' -[###### ] -[## ] -[## ] -[##### ] -[## ] -[## ] -[#######] -[ ] - -#char : 70 'F' -[#######] -[## ] -[## ] -[###### ] -[## ] -[## ] -[## ] -[ ] - -#char : 71 'G' -[ #####] -[ ## ] -[## ] -[## ###] -[## ##] -[ ## ##] -[ #####] -[ ] - -#char : 72 'H' -[## ##] -[## ##] -[## ##] -[#######] -[## ##] -[## ##] -[## ##] -[ ] - -#char : 73 'I' -[###### ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[###### ] -[ ] - -#char : 74 'J' -[ ##] -[ ##] -[ ##] -[ ##] -[ ##] -[## ##] -[ ##### ] -[ ] - -#char : 75 'K' -[## ##] -[## ## ] -[## ## ] -[#### ] -[##### ] -[## ### ] -[## ###] -[ ] - -#char : 76 'L' -[## ] -[## ] -[## ] -[## ] -[## ] -[## ] -[#######] -[ ] - -#char : 77 'M' -[## ##] -[### ###] -[#######] -[## # ##] -[## ##] -[## ##] -[## ##] -[ ] - -#char : 78 'N' -[## ##] -[### ##] -[#### ##] -[## ####] -[## ###] -[## ##] -[## ##] -[ ] - -#char : 79 'O' -[ ##### ] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ##### ] -[ ] - -#char : 80 'P' -[###### ] -[## ##] -[## ##] -[## ##] -[###### ] -[## ] -[## ] -[ ] - -#char : 81 'Q' -[ ##### ] -[## ##] -[## ##] -[## ##] -[## ####] -[## ## ] -[ #### #] -[ ] - -#char : 82 'R' -[###### ] -[## ##] -[## ##] -[## ## ] -[##### ] -[## ### ] -[## ###] -[ ] - -#char : 83 'S' -[ #### ] -[## ## ] -[## ] -[ ##### ] -[ ##] -[## ##] -[ ##### ] -[ ] - -#char : 84 'T' -[###### ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ] - -#char : 85 'U' -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ##### ] -[ ] - -#char : 86 'V' -[## ##] -[## ##] -[## ##] -[## ##] -[ ## ## ] -[ ### ] -[ # ] -[ ] - -#char : 87 'W' -[## ##] -[## ##] -[## ##] -[## # ##] -[#######] -[### ###] -[## ##] -[ ] - -#char : 88 'X' -[## ##] -[### ###] -[ ##### ] -[ ### ] -[ ##### ] -[### ###] -[## ##] -[ ] - -#char : 89 'Y' -[## ## ] -[## ## ] -[## ## ] -[ #### ] -[ ## ] -[ ## ] -[ ## ] -[ ] - -#char : 90 'Z' -[#######] -[ ###] -[ ### ] -[ ### ] -[ ### ] -[### ] -[#######] -[ ] - -#char : 91 '[' -[ ### ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ### ] -[ ] - -#char : 92 '\' -[ ] -[## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ##] -[ ] - -#char : 93 ']' -[ ### ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ### ] -[ ] - -#char : 94 '^' -[ ] -[ # ] -[ ### ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 95 '_' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[#######] - -#char : 96 '`' -[ ] -[ ## ] -[ ## ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 97 'a' -[ ### ] -[ ## ## ] -[## ##] -[## ##] -[#######] -[## ##] -[## ##] -[ ] - -#char : 98 'b' -[###### ] -[## ##] -[## ##] -[###### ] -[## ##] -[## ##] -[###### ] -[ ] - -#char : 99 'c' -[ #### ] -[ ## ##] -[## ] -[## ] -[## ] -[ ## ##] -[ #### ] -[ ] - -#char : 100 'd' -[##### ] -[## ## ] -[## ##] -[## ##] -[## ##] -[## ## ] -[##### ] -[ ] - -#char : 101 'e' -[###### ] -[## ] -[## ] -[##### ] -[## ] -[## ] -[#######] -[ ] - -#char : 102 'f' -[#######] -[## ] -[## ] -[###### ] -[## ] -[## ] -[## ] -[ ] - -#char : 103 'g' -[ #####] -[ ## ] -[## ] -[## ###] -[## ##] -[ ## ##] -[ #####] -[ ] - -#char : 104 'h' -[## ##] -[## ##] -[## ##] -[#######] -[## ##] -[## ##] -[## ##] -[ ] - -#char : 105 'i' -[###### ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[###### ] -[ ] - -#char : 106 'j' -[ ##] -[ ##] -[ ##] -[ ##] -[ ##] -[## ##] -[ ##### ] -[ ] - -#char : 107 'k' -[## ##] -[## ## ] -[## ## ] -[#### ] -[##### ] -[## ### ] -[## ###] -[ ] - -#char : 108 'l' -[## ] -[## ] -[## ] -[## ] -[## ] -[## ] -[#######] -[ ] - -#char : 109 'm' -[## ##] -[### ###] -[#######] -[## # ##] -[## ##] -[## ##] -[## ##] -[ ] - -#char : 110 'n' -[## ##] -[### ##] -[#### ##] -[## ####] -[## ###] -[## ##] -[## ##] -[ ] - -#char : 111 'o' -[ ##### ] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ##### ] -[ ] - -#char : 112 'p' -[###### ] -[## ##] -[## ##] -[## ##] -[###### ] -[## ] -[## ] -[ ] - -#char : 113 'q' -[ ##### ] -[## ##] -[## ##] -[## ##] -[## ####] -[## ## ] -[ #### #] -[ ] - -#char : 114 'r' -[###### ] -[## ##] -[## ##] -[## ## ] -[##### ] -[## ### ] -[## ###] -[ ] - -#char : 115 's' -[ #### ] -[## ## ] -[## ] -[ ##### ] -[ ##] -[## ##] -[ ##### ] -[ ] - -#char : 116 't' -[###### ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ] - -#char : 117 'u' -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ##### ] -[ ] - -#char : 118 'v' -[## ##] -[## ##] -[## ##] -[## ##] -[ ## ## ] -[ ### ] -[ # ] -[ ] - -#char : 119 'w' -[## ##] -[## ##] -[## ##] -[## # ##] -[#######] -[### ###] -[## ##] -[ ] - -#char : 120 'x' -[## ##] -[### ###] -[ ##### ] -[ ### ] -[ ##### ] -[### ###] -[## ##] -[ ] - -#char : 121 'y' -[## ## ] -[## ## ] -[## ## ] -[ #### ] -[ ## ] -[ ## ] -[ ## ] -[ ] - -#char : 122 'z' -[#######] -[ ###] -[ ### ] -[ ### ] -[ ### ] -[### ] -[#######] -[ ] - -#char : 123 '{' -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ] - -#char : 124 '|' -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ] - -#char : 125 '}' -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ] - -#char : 126 '~' -[ ] -[ ] -[ ## # ] -[ ##### ] -[ # ## ] -[ ] -[ ] -[ ] - -#char : 127 -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] diff --git a/src/modm/ui/display/font/assertion.font b/src/modm/ui/display/font/assertion.font deleted file mode 100644 index a4fe087ca6..0000000000 --- a/src/modm/ui/display/font/assertion.font +++ /dev/null @@ -1,1637 +0,0 @@ -#font : Assertion -#width : 7 -#height : 15 -#hspace : 0 -#vspace : 1 - -#char : 32 ' ' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 33 '!' -[##] -[##] -[##] -[##] -[##] -[##] -[##] -[##] -[##] -[ ] -[##] -[##] -[ ] -[ ] -[ ] - -#char : 34 '"' -[## ##] -[## ##] -[## ##] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 35 '#' -[ ] -[ ## ## ] -[ ## ## ] -[ ## ## ] -[##########] -[ ## ## ] -[ ## ## ] -[ ## ## ] -[##########] -[ ## ## ] -[ ## ## ] -[ ## ## ] -[ ] -[ ] -[ ] - -#char : 36 '$' -[ # ] -[ # ] -[ ##### ] -[## ##] -[## ##] -[## ##] -[## ] -[ ##### ] -[ ##] -[## ##] -[## ##] -[## ##] -[ ##### ] -[ # ] -[ # ] - -#char : 37 '%' -[ ] -[ ### #] -[## ## ##] -[## ## ## ] -[## ## ## ] -[ ### ## ] -[ ## ] -[ ## ### ] -[ ## ## ##] -[ ## ## ##] -[## ## ##] -[# ### ] -[ ] -[ ] -[ ] - -#char : 38 '&' -[ ##### ] -[## ## ] -[## ## ] -[## ## ] -[## ] -[ # #####] -[## ## ] -[## ## ] -[## ## ] -[## ## ] -[## ## ] -[ ##### ] -[ ] -[ ] -[ ] - -#char : 39 ''' -[##] -[##] -[##] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 40 '(' -[ #] -[ # ] -[ # ] -[## ] -[## ] -[## ] -[## ] -[## ] -[## ] -[ # ] -[ # ] -[ #] -[ ] -[ ] -[ ] - -#char : 41 ')' -[# ] -[ # ] -[ # ] -[ ##] -[ ##] -[ ##] -[ ##] -[ ##] -[ ##] -[ # ] -[ # ] -[# ] -[ ] -[ ] -[ ] - -#char : 42 '*' -[ ] -[ ] -[ ## ] -[## ## ##] -[ ###### ] -[ #### ] -[ ###### ] -[## ## ##] -[ ## ] -[ ## ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 43 '+' -[ ] -[ ] -[ ] -[ ## ] -[ ## ] -[ ## ] -[######] -[ ## ] -[ ## ] -[ ## ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 44 ',' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ##] -[ ##] -[ ##] -[## ] - -#char : 45 '-' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[#####] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 46 '.' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[##] -[##] -[##] -[ ] - -#char : 47 '/' -[ ##] -[ # ] -[ ## ] -[ ## ] -[ # ] -[ ## ] -[ ## ] -[ # ] -[ ## ] -[ ## ] -[ # ] -[## ] -[## ] -[ ] -[ ] - -#char : 48 '0' -[ ##### ] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ##### ] -[ ] -[ ] -[ ] - -#char : 49 '1' -[####] -[ ##] -[ ##] -[ ##] -[ ##] -[ ##] -[ ##] -[ ##] -[ ##] -[ ##] -[ ##] -[ ##] -[ ] -[ ] -[ ] - -#char : 50 '2' -[ ##### ] -[## ##] -[## ##] -[## ##] -[ ##] -[ ##] -[ ##### ] -[## ] -[## ] -[## ] -[## ] -[#######] -[ ] -[ ] -[ ] - -#char : 51 '3' -[ ##### ] -[## ##] -[## ##] -[## ##] -[ ##] -[ #### ] -[ ##] -[ ##] -[## ##] -[## ##] -[## ##] -[ ##### ] -[ ] -[ ] -[ ] - -#char : 52 '4' -[## ## ] -[## ## ] -[## ## ] -[## ## ] -[## ## ] -[## ## ] -[## ## ] -[## ## ] -[#######] -[ ## ] -[ ## ] -[ ## ] -[ ] -[ ] -[ ] - -#char : 53 '5' -[#######] -[## ] -[## ] -[## ] -[###### ] -[ ##] -[ ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ##### ] -[ ] -[ ] -[ ] - -#char : 54 '6' -[ ##### ] -[## ##] -[## ##] -[## ##] -[## ] -[###### ] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ##### ] -[ ] -[ ] -[ ] - -#char : 55 '7' -[######] -[ ##] -[ ##] -[ ##] -[ ###] -[ ### ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ] -[ ] -[ ] - -#char : 56 '8' -[ ##### ] -[## ##] -[## ##] -[## ##] -[## ##] -[ ##### ] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ##### ] -[ ] -[ ] -[ ] - -#char : 57 '9' -[ ##### ] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ######] -[ ##] -[## ##] -[## ##] -[## ##] -[ ##### ] -[ ] -[ ] -[ ] - -#char : 58 ':' -[ ] -[ ] -[ ] -[ ] -[##] -[##] -[##] -[ ] -[##] -[##] -[##] -[ ] -[ ] -[ ] -[ ] - -#char : 59 ';' -[ ] -[ ] -[ ] -[ ] -[ ##] -[ ##] -[ ##] -[ ] -[ ##] -[ ##] -[ ##] -[## ] -[ ] -[ ] -[ ] - -#char : 60 '<' -[ ] -[ ] -[ ] -[ ##] -[ ## ] -[ ## ] -[## ] -[ ## ] -[ ## ] -[ ##] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 61 '=' -[ ] -[ ] -[ ] -[ ] -[#####] -[ ] -[ ] -[#####] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 62 '>' -[ ] -[ ] -[ ] -[## ] -[ ## ] -[ ## ] -[ ##] -[ ## ] -[ ## ] -[## ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 63 '?' -[ ##### ] -[## ##] -[## ##] -[## ##] -[ ##] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ] -[ ## ] -[ ## ] -[ ] -[ ] -[ ] - -#char : 64 '@' -[ ##### ] -[ # # ] -[ # ### # ] -[## ## ## ##] -[## ## ## ##] -[## ## ## ##] -[## ## ## ##] -[## ## ## ##] -[## ## ## ##] -[ # ### ## ] -[ # ] -[ ####### ] -[ ] -[ ] -[ ] - -#char : 65 'A' -[ ##### ] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[#######] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ] -[ ] -[ ] - -#char : 66 'B' -[###### ] -[## ##] -[## ##] -[## ##] -[## ##] -[###### ] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[###### ] -[ ] -[ ] -[ ] - -#char : 67 'C' -[ ##### ] -[## ##] -[## ##] -[## ##] -[## ##] -[## ] -[## ] -[## ##] -[## ##] -[## ##] -[## ##] -[ ##### ] -[ ] -[ ] -[ ] - -#char : 68 'D' -[###### ] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[###### ] -[ ] -[ ] -[ ] - -#char : 69 'E' -[#######] -[## ] -[## ] -[## ] -[## ] -[###### ] -[## ] -[## ] -[## ] -[## ] -[## ] -[#######] -[ ] -[ ] -[ ] - -#char : 70 'F' -[#######] -[## ] -[## ] -[## ] -[## ] -[###### ] -[## ] -[## ] -[## ] -[## ] -[## ] -[## ] -[ ] -[ ] -[ ] - -#char : 71 'G' -[ ##### ] -[## ##] -[## ##] -[## ##] -[## ##] -[## ] -[## ####] -[## ##] -[## ##] -[## ##] -[## ##] -[ ##### ] -[ ] -[ ] -[ ] - -#char : 72 'H' -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[#######] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ] -[ ] -[ ] - -#char : 73 'I' -[##] -[##] -[##] -[##] -[##] -[##] -[##] -[##] -[##] -[##] -[##] -[##] -[ ] -[ ] -[ ] - -#char : 74 'J' -[ ##] -[ ##] -[ ##] -[ ##] -[ ##] -[ ##] -[ ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ##### ] -[ ] -[ ] -[ ] - -#char : 75 'K' -[## ##] -[## ##] -[## ##] -[## ##] -[## ## ] -[##### ] -[## ## ] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ] -[ ] -[ ] - -#char : 76 'L' -[## ] -[## ] -[## ] -[## ] -[## ] -[## ] -[## ] -[## ] -[## ] -[## ] -[## ] -[######] -[ ] -[ ] -[ ] - -#char : 77 'M' -[######### ] -[## ## ##] -[## ## ##] -[## ## ##] -[## ## ##] -[## ## ##] -[## ## ##] -[## ## ##] -[## ## ##] -[## ## ##] -[## ## ##] -[## ## ##] -[ ] -[ ] -[ ] - -#char : 78 'N' -[###### ] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ] -[ ] -[ ] - -#char : 79 'O' -[ ##### ] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ##### ] -[ ] -[ ] -[ ] - -#char : 80 'P' -[###### ] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[###### ] -[## ] -[## ] -[## ] -[## ] -[## ] -[ ] -[ ] -[ ] - -#char : 81 'Q' -[ ##### ] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ##### ] -[ ## ] -[ ##] -[ ] - -#char : 82 'R' -[###### ] -[## ##] -[## ##] -[## ##] -[## ##] -[###### ] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ] -[ ] -[ ] - -#char : 83 'S' -[ ##### ] -[## ##] -[## ##] -[## ##] -[## ] -[ ##### ] -[ ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ##### ] -[ ] -[ ] -[ ] - -#char : 84 'T' -[######] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ] -[ ] -[ ] - -#char : 85 'U' -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ##### ] -[ ] -[ ] -[ ] - -#char : 86 'V' -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ## ## ] -[ ### ] -[ # ] -[ ] -[ ] -[ ] - -#char : 87 'W' -[## ## ##] -[## ## ##] -[## ## ##] -[## ## ##] -[## ## ##] -[## ## ##] -[## ## ##] -[## ## ##] -[## ## ##] -[ ## #### ## ] -[ ### ### ] -[ # # ] -[ ] -[ ] -[ ] - -#char : 88 'X' -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ## ## ] -[ ### ] -[ ## ## ] -[## ##] -[## ##] -[## ##] -[## ##] -[ ] -[ ] -[ ] - -#char : 89 'Y' -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ #### ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ] -[ ] -[ ] - -#char : 90 'Z' -[###### ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[## ] -[## ] -[## ] -[## ] -[#######] -[ ] -[ ] -[ ] - -#char : 91 '[' -[####] -[## ] -[## ] -[## ] -[## ] -[## ] -[## ] -[## ] -[## ] -[## ] -[## ] -[####] -[ ] -[ ] -[ ] - -#char : 92 '\' -[## ] -[ # ] -[ ## ] -[ ## ] -[ # ] -[ ## ] -[ ## ] -[ # ] -[ ## ] -[ ## ] -[ # ] -[ ##] -[ ##] -[ ] -[ ] - -#char : 93 ']' -[####] -[ ##] -[ ##] -[ ##] -[ ##] -[ ##] -[ ##] -[ ##] -[ ##] -[ ##] -[ ##] -[####] -[ ] -[ ] -[ ] - -#char : 94 '^' -[ # ] -[ ### ] -[ # # ] -[ ## ## ] -[ # # ] -[## ##] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 95 '_' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[#######] - -#char : 96 '`' -[# ] -[ # ] -[ #] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 97 'a' -[ ] -[ ] -[ ] -[ ######] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ######] -[ ] -[ ] -[ ] - -#char : 98 'b' -[## ] -[## ] -[## ] -[###### ] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[###### ] -[ ] -[ ] -[ ] - -#char : 99 'c' -[ ] -[ ] -[ ] -[ ##### ] -[## ##] -[## ##] -[## ] -[## ] -[## ] -[## ##] -[## ##] -[ ##### ] -[ ] -[ ] -[ ] - -#char : 100 'd' -[ ##] -[ ##] -[ ##] -[ ######] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ######] -[ ] -[ ] -[ ] - -#char : 101 'e' -[ ] -[ ] -[ ] -[ ##### ] -[## ##] -[## ##] -[#######] -[## ] -[## ] -[## ##] -[## ##] -[ ##### ] -[ ] -[ ] -[ ] - -#char : 102 'f' -[ ###] -[ ## ] -[ ## ] -[#####] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ] -[ ] -[ ] - -#char : 103 'g' -[ ] -[ ] -[ ] -[ ######] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ######] -[ ##] -[ ##] -[ ##### ] - -#char : 104 'h' -[## ] -[## ] -[## ] -[###### ] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ] -[ ] -[ ] - -#char : 105 'i' -[##] -[##] -[ ] -[##] -[##] -[##] -[##] -[##] -[##] -[##] -[##] -[##] -[ ] -[ ] -[ ] - -#char : 106 'j' -[ ##] -[ ##] -[ ] -[ ##] -[ ##] -[ ##] -[ ##] -[ ##] -[ ##] -[ ##] -[ ##] -[ ##] -[ ##] -[ ##] -[### ] - -#char : 107 'k' -[## ] -[## ] -[## ] -[## ##] -[## ##] -[## ## ] -[##### ] -[## ## ] -[## ##] -[## ##] -[## ##] -[## ##] -[ ] -[ ] -[ ] - -#char : 108 'l' -[##] -[##] -[##] -[##] -[##] -[##] -[##] -[##] -[##] -[##] -[##] -[##] -[ ] -[ ] -[ ] - -#char : 109 'm' -[ ] -[ ] -[ ] -[######### ] -[## ## ##] -[## ## ##] -[## ## ##] -[## ## ##] -[## ## ##] -[## ## ##] -[## ## ##] -[## ## ##] -[ ] -[ ] -[ ] - -#char : 110 'n' -[ ] -[ ] -[ ] -[###### ] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ] -[ ] -[ ] - -#char : 111 'o' -[ ] -[ ] -[ ] -[ ##### ] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ##### ] -[ ] -[ ] -[ ] - -#char : 112 'p' -[ ] -[ ] -[ ] -[###### ] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[###### ] -[## ] -[## ] -[## ] - -#char : 113 'q' -[ ] -[ ] -[ ] -[ ######] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ######] -[ ##] -[ ##] -[ ##] - -#char : 114 'r' -[ ] -[ ] -[ ] -[## ##] -[#### ] -[### ] -[## ] -[## ] -[## ] -[## ] -[## ] -[## ] -[ ] -[ ] -[ ] - -#char : 115 's' -[ ] -[ ] -[ ] -[ ##### ] -[## ##] -[## ##] -[## ] -[ ##### ] -[ ##] -[## ##] -[## ##] -[ ##### ] -[ ] -[ ] -[ ] - -#char : 116 't' -[ # ] -[ ## ] -[ ## ] -[#####] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ###] -[ ] -[ ] -[ ] - -#char : 117 'u' -[ ] -[ ] -[ ] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ##### ] -[ ] -[ ] -[ ] - -#char : 118 'v' -[ ] -[ ] -[ ] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ## ## ] -[ ### ] -[ ] -[ ] -[ ] - -#char : 119 'w' -[ ] -[ ] -[ ] -[## ## ##] -[## ## ##] -[## ## ##] -[## ## ##] -[## ## ##] -[## ## ##] -[## ## ##] -[ ## #### ## ] -[ ### ### ] -[ ] -[ ] -[ ] - -#char : 120 'x' -[ ] -[ ] -[ ] -[## ##] -[## ##] -[## ##] -[ ## ## ] -[ ### ] -[ ## ## ] -[## ##] -[## ##] -[## ##] -[ ] -[ ] -[ ] - -#char : 121 'y' -[ ] -[ ] -[ ] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[ ######] -[ ##] -[ ##] -[ ##### ] - -#char : 122 'z' -[ ] -[ ] -[ ] -[#####] -[ ##] -[ ##] -[ ## ] -[ ## ] -[## ] -[## ] -[## ] -[#####] -[ ] -[ ] -[ ] - -#char : 123 '{' -[ ###] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ###] -[ ] -[ ] - -#char : 124 '|' -[##] -[##] -[##] -[##] -[##] -[##] -[##] -[##] -[##] -[##] -[##] -[##] -[ ] -[ ] -[ ] - -#char : 125 '}' -[### ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ##] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[### ] -[ ] -[ ] - -#char : 126 '~' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ## #] -[#####] -[# ## ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 127 -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] diff --git a/src/modm/ui/display/font/fixed_width_5x8.font b/src/modm/ui/display/font/fixed_width_5x8.font deleted file mode 100644 index 2b87a30298..0000000000 --- a/src/modm/ui/display/font/fixed_width_5x8.font +++ /dev/null @@ -1,965 +0,0 @@ -#font : Fixed Width 5x8 -#width : 5 -#height : 8 -#hspace : 0 -#vspace : 1 - -#char : 32 ' ' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 33 '!' -[ # ] -[ ### ] -[ ### ] -[ # ] -[ # ] -[ ] -[ # ] -[ ] - -#char : 34 '"' -[## ##] -[## ##] -[# # ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 35 '#' -[ ] -[ # # ] -[#####] -[ # # ] -[ # # ] -[#####] -[ # # ] -[ ] - -#char : 36 '$' -[ # ] -[ ####] -[# # ] -[ ### ] -[ # #] -[#### ] -[ # ] -[ ] - -#char : 37 '%' -[## ] -[## #] -[ # ] -[ # ] -[ # ] -[# ##] -[ ##] -[ ] - -#char : 38 '&' -[ # ] -[# # ] -[# # ] -[ # ] -[# # #] -[# # ] -[ ## #] -[ ] - -#char : 39 ''' -[ ## ] -[ ## ] -[ # ] -[ # ] -[ ] -[ ] -[ ] -[ ] - -#char : 40 '(' -[ # ] -[ # ] -[ # ] -[ # ] -[ # ] -[ # ] -[ # ] -[ ] - -#char : 41 ')' -[ # ] -[ # ] -[ # ] -[ # ] -[ # ] -[ # ] -[ # ] -[ ] - -#char : 42 '*' -[ ] -[ # # ] -[ ### ] -[#####] -[ ### ] -[ # # ] -[ ] -[ ] - -#char : 43 '+' -[ ] -[ # ] -[ # ] -[#####] -[ # ] -[ # ] -[ ] -[ ] - -#char : 44 ',' -[ ] -[ ] -[ ] -[ ] -[ ## ] -[ ## ] -[ # ] -[ # ] - -#char : 45 '-' -[ ] -[ ] -[ ] -[#####] -[ ] -[ ] -[ ] -[ ] - -#char : 46 '.' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ## ] -[ ## ] -[ ] - -#char : 47 '/' -[ ] -[ #] -[ # ] -[ # ] -[ # ] -[# ] -[ ] -[ ] - -#char : 48 '0' -[ ### ] -[# #] -[# ##] -[# # #] -[## #] -[# #] -[ ### ] -[ ] - -#char : 49 '1' -[ # ] -[ ## ] -[ # ] -[ # ] -[ # ] -[ # ] -[ ### ] -[ ] - -#char : 50 '2' -[ ### ] -[# #] -[ #] -[ ## ] -[ # ] -[# ] -[#####] -[ ] - -#char : 51 '3' -[ ### ] -[# #] -[ #] -[ ### ] -[ #] -[# #] -[ ### ] -[ ] - -#char : 52 '4' -[ # ] -[ ## ] -[ # # ] -[# # ] -[#####] -[ # ] -[ # ] -[ ] - -#char : 53 '5' -[#####] -[# ] -[# ] -[#### ] -[ #] -[# #] -[ ### ] -[ ] - -#char : 54 '6' -[ ## ] -[ # ] -[# ] -[#### ] -[# #] -[# #] -[ ### ] -[ ] - -#char : 55 '7' -[#####] -[ #] -[ # ] -[ # ] -[ # ] -[ # ] -[ # ] -[ ] - -#char : 56 '8' -[ ### ] -[# #] -[# #] -[ ### ] -[# #] -[# #] -[ ### ] -[ ] - -#char : 57 '9' -[ ### ] -[# #] -[# #] -[ ####] -[ #] -[ # ] -[ ## ] -[ ] - -#char : 58 ':' -[ ] -[ ] -[ # ] -[ ] -[ # ] -[ ] -[ ] -[ ] - -#char : 59 ';' -[ ] -[ ] -[ # ] -[ ] -[ ] -[ # ] -[ # ] -[ # ] - -#char : 60 '<' -[ # ] -[ # ] -[ # ] -[# ] -[ # ] -[ # ] -[ # ] -[ ] - -#char : 61 '=' -[ ] -[ ] -[#####] -[ ] -[#####] -[ ] -[ ] -[ ] - -#char : 62 '>' -[ # ] -[ # ] -[ # ] -[ #] -[ # ] -[ # ] -[ # ] -[ ] - -#char : 63 '?' -[ ### ] -[# #] -[ #] -[ ## ] -[ # ] -[ ] -[ # ] -[ ] - -#char : 64 '@' -[ ### ] -[# #] -[# ###] -[# # #] -[# ###] -[# ] -[ ### ] -[ ] - -#char : 65 'A' -[ ### ] -[# #] -[# #] -[# #] -[#####] -[# #] -[# #] -[ ] - -#char : 66 'B' -[#### ] -[# #] -[# #] -[#### ] -[# #] -[# #] -[#### ] -[ ] - -#char : 67 'C' -[ ### ] -[# #] -[# ] -[# ] -[# ] -[# #] -[ ### ] -[ ] - -#char : 68 'D' -[#### ] -[# #] -[# #] -[# #] -[# #] -[# #] -[#### ] -[ ] - -#char : 69 'E' -[#####] -[# ] -[# ] -[#### ] -[# ] -[# ] -[#####] -[ ] - -#char : 70 'F' -[#####] -[# ] -[# ] -[#### ] -[# ] -[# ] -[# ] -[ ] - -#char : 71 'G' -[ ### ] -[# #] -[# ] -[# ###] -[# #] -[# #] -[ ####] -[ ] - -#char : 72 'H' -[# #] -[# #] -[# #] -[#####] -[# #] -[# #] -[# #] -[ ] - -#char : 73 'I' -[ ### ] -[ # ] -[ # ] -[ # ] -[ # ] -[ # ] -[ ### ] -[ ] - -#char : 74 'J' -[ #] -[ #] -[ #] -[ #] -[# #] -[# #] -[ ### ] -[ ] - -#char : 75 'K' -[# #] -[# # ] -[# # ] -[## ] -[# # ] -[# # ] -[# #] -[ ] - -#char : 76 'L' -[# ] -[# ] -[# ] -[# ] -[# ] -[# ] -[#####] -[ ] - -#char : 77 'M' -[# #] -[## ##] -[# # #] -[# #] -[# #] -[# #] -[# #] -[ ] - -#char : 78 'N' -[# #] -[## #] -[# # #] -[# ##] -[# #] -[# #] -[# #] -[ ] - -#char : 79 'O' -[ ### ] -[# #] -[# #] -[# #] -[# #] -[# #] -[ ### ] -[ ] - -#char : 80 'P' -[#### ] -[# #] -[# #] -[#### ] -[# ] -[# ] -[# ] -[ ] - -#char : 81 'Q' -[ ### ] -[# #] -[# #] -[# #] -[# # #] -[# # ] -[ ## #] -[ ] - -#char : 82 'R' -[#### ] -[# #] -[# #] -[#### ] -[# # ] -[# #] -[# #] -[ ] - -#char : 83 'S' -[ ### ] -[# #] -[# ] -[ ### ] -[ #] -[# #] -[ ### ] -[ ] - -#char : 84 'T' -[#####] -[ # ] -[ # ] -[ # ] -[ # ] -[ # ] -[ # ] -[ ] - -#char : 85 'U' -[# #] -[# #] -[# #] -[# #] -[# #] -[# #] -[ ### ] -[ ] - -#char : 86 'V' -[# #] -[# #] -[# #] -[# #] -[# #] -[ # # ] -[ # ] -[ ] - -#char : 87 'W' -[# #] -[# #] -[# #] -[# # #] -[# # #] -[# # #] -[ # # ] -[ ] - -#char : 88 'X' -[# #] -[# #] -[ # # ] -[ # ] -[ # # ] -[# #] -[# #] -[ ] - -#char : 89 'Y' -[# #] -[# #] -[# #] -[ # # ] -[ # ] -[ # ] -[ # ] -[ ] - -#char : 90 'Z' -[#####] -[ #] -[ # ] -[ # ] -[ # ] -[# ] -[#####] -[ ] - -#char : 91 '[' -[ ## ] -[ # ] -[ # ] -[ # ] -[ # ] -[ # ] -[ ## ] -[ ] - -#char : 92 '\' -[ ] -[# ] -[ # ] -[ # ] -[ # ] -[ #] -[ ] -[ ] - -#char : 93 ']' -[ ## ] -[ # ] -[ # ] -[ # ] -[ # ] -[ # ] -[ ## ] -[ ] - -#char : 94 '^' -[ # ] -[ # # ] -[# #] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 95 '_' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[#####] - -#char : 96 '`' -[ ## ] -[ ## ] -[ # ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 97 'a' -[ ] -[ ] -[ ### ] -[ #] -[ ####] -[# #] -[ ####] -[ ] - -#char : 98 'b' -[# ] -[# ] -[#### ] -[# #] -[# #] -[# #] -[#### ] -[ ] - -#char : 99 'c' -[ ] -[ ] -[ ### ] -[# #] -[# ] -[# #] -[ ### ] -[ ] - -#char : 100 'd' -[ #] -[ #] -[ ####] -[# #] -[# #] -[# #] -[ ####] -[ ] - -#char : 101 'e' -[ ] -[ ] -[ ### ] -[# #] -[#### ] -[# ] -[ ### ] -[ ] - -#char : 102 'f' -[ ## ] -[ # ] -[ # ] -[#### ] -[ # ] -[ # ] -[ # ] -[ ] - -#char : 103 'g' -[ ] -[ ] -[ ####] -[# #] -[# #] -[ ####] -[ #] -[ ### ] - -#char : 104 'h' -[# ] -[# ] -[# ] -[### ] -[# # ] -[# # ] -[# # ] -[ ] - -#char : 105 'i' -[ # ] -[ ] -[ # ] -[ # ] -[ # ] -[ # ] -[ ## ] -[ ] - -#char : 106 'j' -[ # ] -[ ] -[ ## ] -[ # ] -[ # ] -[ # ] -[# # ] -[ ## ] - -#char : 107 'k' -[# ] -[# ] -[# # ] -[# # ] -[## ] -[# # ] -[# # ] -[ ] - -#char : 108 'l' -[ # ] -[ # ] -[ # ] -[ # ] -[ # ] -[ # ] -[ ## ] -[ ] - -#char : 109 'm' -[ ] -[ ] -[## # ] -[# # #] -[# # #] -[# #] -[# #] -[ ] - -#char : 110 'n' -[ ] -[ ] -[### ] -[# # ] -[# # ] -[# # ] -[# # ] -[ ] - -#char : 111 'o' -[ ] -[ ] -[ ### ] -[# #] -[# #] -[# #] -[ ### ] -[ ] - -#char : 112 'p' -[ ] -[ ] -[#### ] -[# #] -[# #] -[#### ] -[# ] -[# ] - -#char : 113 'q' -[ ] -[ ] -[ ####] -[# #] -[# #] -[ ####] -[ #] -[ #] - -#char : 114 'r' -[ ] -[ ] -[# ## ] -[ # #] -[ # ] -[ # ] -[### ] -[ ] - -#char : 115 's' -[ ] -[ ] -[ ### ] -[# ] -[ ### ] -[ #] -[ ### ] -[ ] - -#char : 116 't' -[ # ] -[#### ] -[ # ] -[ # ] -[ # ] -[ # # ] -[ # ] -[ ] - -#char : 117 'u' -[ ] -[ ] -[# #] -[# #] -[# #] -[# #] -[ ### ] -[ ] - -#char : 118 'v' -[ ] -[ ] -[# #] -[# #] -[# #] -[ # # ] -[ # ] -[ ] - -#char : 119 'w' -[ ] -[ ] -[# #] -[# #] -[# # #] -[# # #] -[ # # ] -[ ] - -#char : 120 'x' -[ ] -[ ] -[# # ] -[# # ] -[ ## ] -[# # ] -[# # ] -[ ] - -#char : 121 'y' -[ ] -[ ] -[# #] -[# #] -[# #] -[ ####] -[ #] -[ ### ] - -#char : 122 'z' -[ ] -[ ] -[#### ] -[ # ] -[ ## ] -[# ] -[#### ] -[ ] - -#char : 123 '{' -[ ## ] -[ # ] -[ # ] -[## ] -[ # ] -[ # ] -[ ## ] -[ ] - -#char : 124 '|' -[ # ] -[ # ] -[ # ] -[ ] -[ # ] -[ # ] -[ # ] -[ ] - -#char : 125 '}' -[ ## ] -[ # ] -[ # ] -[ ##] -[ # ] -[ # ] -[ ## ] -[ ] - -#char : 126 '~' -[ ] -[ ] -[ ] -[ # # ] -[# # ] -[ ] -[ ] -[ ] - -#char : 127 -[ # ] -[ ### ] -[## ##] -[# #] -[# #] -[# #] -[#####] -[ ] diff --git a/src/modm/ui/display/font/matrix_8x8.font b/src/modm/ui/display/font/matrix_8x8.font deleted file mode 100644 index fab759dca9..0000000000 --- a/src/modm/ui/display/font/matrix_8x8.font +++ /dev/null @@ -1,105 +0,0 @@ -#font : Matrix 8x8 -#width : 8 -#height : 8 -#hspace : 0 -#vspace : 0 - -#char : 48 '0' -[ ##### ] -[## ## ] -[## ### ] -[## #### ] -[#### ## ] -[### ## ] -[ ##### ] -[ ] - -#char : 49 '1' -[ ## ] -[ ### ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[###### ] -[ ] - -#char : 50 '2' -[ #### ] -[## ## ] -[ ## ] -[ ### ] -[ ## ] -[## ## ] -[###### ] -[ ] - -#char : 51 '3' -[ #### ] -[## ## ] -[ ## ] -[ ### ] -[ ## ] -[## ## ] -[ #### ] -[ ] - -#char : 52 '4' -[ ### ] -[ #### ] -[ ## ## ] -[## ## ] -[####### ] -[ ## ] -[ #### ] -[ ] - -#char : 53 '5' -[###### ] -[## ] -[##### ] -[ ## ] -[ ## ] -[## ## ] -[ #### ] -[ ] - -#char : 54 '6' -[ ### ] -[ ## ] -[## ] -[##### ] -[## ## ] -[## ## ] -[ #### ] -[ ] - -#char : 55 '7' -[###### ] -[## ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[ ] - -#char : 56 '8' -[ #### ] -[## ## ] -[## ## ] -[ #### ] -[## ## ] -[## ## ] -[ #### ] -[ ] - -#char : 57 '9' -[ #### ] -[## ## ] -[## ## ] -[ ##### ] -[ ## ] -[ ## ] -[ ### ] -[ ] diff --git a/src/modm/ui/display/font/numbers_14x32.font b/src/modm/ui/display/font/numbers_14x32.font deleted file mode 100644 index cc95d01289..0000000000 --- a/src/modm/ui/display/font/numbers_14x32.font +++ /dev/null @@ -1,345 +0,0 @@ -#font : Numbers 14x32 -#width : 14 -#height : 32 -#hspace : 3 -#vspace : 4 - -#char : 48 '0' -[ ###### ] -[ ########## ] -[ ############ ] -[ ############ ] -[##### #####] -[#### ####] -[#### ####] -[#### ####] -[#### ####] -[#### ####] -[#### #####] -[#### #####] -[#### ######] -[#### ######] -[#### #######] -[#### ### ####] -[#### ### ####] -[####### ####] -[###### ####] -[###### ####] -[##### ####] -[##### ####] -[#### ####] -[#### ####] -[#### ####] -[#### ####] -[#### ####] -[##### #####] -[ ############ ] -[ ############ ] -[ ########## ] -[ ###### ] - -#char : 49 '1' -[ ### ] -[ ##### ] -[ ###### ] -[ ###### ] -[ ####### ] -[ ######## ] -[ ######## ] -[ #### #### ] -[ #### #### ] -[ #### #### ] -[ #### #### ] -[ ### #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ ## ] - -#char : 50 '2' -[ ###### ] -[ ########## ] -[ ############ ] -[ ############ ] -[##### #####] -[#### ####] -[ ## ####] -[ ####] -[ ####] -[ ####] -[ ####] -[ ####] -[ #####] -[ ##### ] -[ ###### ] -[ ###### ] -[ ###### ] -[ ###### ] -[ ###### ] -[ ###### ] -[ ###### ] -[ ##### ] -[##### ] -[#### ] -[#### ] -[#### ] -[#### ] -[#### ] -[############# ] -[##############] -[##############] -[ ############ ] - -#char : 51 '3' -[ ###### ] -[ ########## ] -[ ############ ] -[ ############ ] -[##### #####] -[#### ####] -[ ## ####] -[ ####] -[ ####] -[ ####] -[ ####] -[ ####] -[ ####] -[ #### ] -[ ####### ] -[ ####### ] -[ ####### ] -[ ####### ] -[ #### ] -[ ####] -[ ####] -[ ####] -[ ####] -[ ####] -[ ####] -[ ## ####] -[#### ####] -[##### #####] -[ ############ ] -[ ############ ] -[ ########## ] -[ ###### ] - -#char : 52 '4' -[ ### ] -[ ##### ] -[ ###### ] -[ ###### ] -[ ####### ] -[ ####### ] -[ ####### ] -[ ######## ] -[ ### #### ] -[ #### #### ] -[ #### #### ] -[ ### #### ] -[ #### #### ] -[ #### #### ] -[ ### #### ] -[ #### #### ] -[ ### #### ] -[#### #### ] -[#### #### ] -[### #### ] -[### #### ] -[##############] -[##############] -[##############] -[ #############] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ ## ] - -#char : 53 '5' -[ ############ ] -[##############] -[##############] -[############# ] -[#### ] -[#### ] -[#### ] -[#### ] -[#### ] -[#### ] -[#### ] -[#### ] -[#### ###### ] -[############ ] -[############# ] -[##############] -[###### #####] -[ ### ####] -[ ####] -[ ####] -[ ####] -[ ####] -[ ####] -[ ####] -[ ####] -[ ## ####] -[#### #####] -[##### ##### ] -[ ############ ] -[ ########### ] -[ ######### ] -[ ###### ] - -#char : 54 '6' -[ ##### ] -[ ######### ] -[ ########### ] -[ ############ ] -[ #### #####] -[#### ####] -[#### ## ] -[#### ] -[#### ] -[#### ] -[#### ] -[#### ] -[#### ###### ] -[############ ] -[############# ] -[##############] -[##### #####] -[#### ####] -[#### ####] -[#### ####] -[#### ####] -[#### ####] -[#### ####] -[#### ####] -[#### ####] -[#### ####] -[#### ####] -[ #### #### ] -[ ############ ] -[ ########## ] -[ ######## ] -[ #### ] - -#char : 55 '7' -[ ############ ] -[##############] -[##############] -[ #############] -[ ####] -[ ####] -[ ####] -[ ####] -[ ####] -[ #####] -[ #### ] -[ ##### ] -[ #### ] -[ ##### ] -[ #### ] -[ ##### ] -[ #### ] -[ ##### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ ## ] - -#char : 56 '8' -[ #### ] -[ ######## ] -[ ########## ] -[ ############ ] -[ #### #### ] -[#### ####] -[#### ####] -[#### ####] -[#### ####] -[#### ####] -[#### ####] -[#### ####] -[ #### #### ] -[ ##### ##### ] -[ ########## ] -[ ######## ] -[ ######## ] -[ ########## ] -[ ##### ##### ] -[ #### #### ] -[#### ####] -[#### ####] -[#### ####] -[#### ####] -[#### ####] -[#### ####] -[#### ####] -[ #### #### ] -[ ############ ] -[ ########## ] -[ ######## ] -[ #### ] - -#char : 57 '9' -[ #### ] -[ ######## ] -[ ########## ] -[ ############ ] -[ #### #### ] -[#### ####] -[#### ####] -[#### ####] -[#### ####] -[#### ####] -[#### ####] -[#### ####] -[#### ####] -[##### #####] -[ ##### ######] -[ #############] -[ ############] -[ ###########] -[ #### ####] -[ ####] -[ ####] -[ ####] -[ ####] -[ ####] -[ ####] -[ ## ####] -[#### ####] -[##### #####] -[ ############ ] -[ ############ ] -[ ########## ] -[ ###### ] diff --git a/src/modm/ui/display/font/numbers_40x56.font b/src/modm/ui/display/font/numbers_40x56.font deleted file mode 100644 index 70a20c5d74..0000000000 --- a/src/modm/ui/display/font/numbers_40x56.font +++ /dev/null @@ -1,591 +0,0 @@ -#font : Numbers 40x57 -#width : 40 -#height : 56 -#hspace : 4 -#vspace : 0 - -#char : 48 '0' -[ ######### ] -[ ############### ] -[ ################### ] -[ ##################### ] -[ ####################### ] -[ ######################### ] -[ ########################### ] -[ ############################# ] -[ ############################## ] -[ ############################### ] -[ ############## ############## ] -[ ############# ############# ] -[ ############ ############ ] -[ ############ ############ ] -[ ############ ############ ] -[ ############ ############ ] -[ ############ ############ ] -[ ############ ############ ] -[ ############ ############ ] -[ ############ ############ ] -[ ########### ########### ] -[############ ############ ] -[############ ############ ] -[############ ############ ] -[############ ############ ] -[############ ############ ] -[############ ############ ] -[############ ############ ] -[############ ############ ] -[############ ############ ] -[############ ############ ] -[############ ############ ] -[############ ############ ] -[############ ############ ] -[############ ############ ] -[ ########### ########### ] -[ ############ ############ ] -[ ############ ############ ] -[ ############ ############ ] -[ ############ ############ ] -[ ############ ############ ] -[ ############ ############ ] -[ ############ ############ ] -[ ############# ############# ] -[ ############# ############# ] -[ ############## ############## ] -[ ############################### ] -[ ############################### ] -[ ############################# ] -[ ########################### ] -[ ######################### ] -[ ####################### ] -[ ##################### ] -[ ################### ] -[ ############### ] -[ ######### ] - -#char : 49 '1' -[ ######### ] -[ ########## ] -[ ########### ] -[ ############ ] -[ ############## ] -[ ############### ] -[ ################# ] -[ ################## ] -[ #################### ] -[ ###################### ] -[ ######################## ] -[ ########################## ] -[ ########################### ] -[ ########################## ] -[ ########################## ] -[ ######################### ] -[ ############ ############ ] -[ ########## ############ ] -[ ####### ############ ] -[ ##### ############ ] -[ # ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] - -#char : 50 '2' -[ ########## ] -[ ################# ] -[ ###################### ] -[ ########################## ] -[ ############################ ] -[ ############################### ] -[ ################################# ] -[ ################################## ] -[ ################################## ] -[ ################################## ] -[ ############ ############### ] -[ ######### ############## ] -[ ###### ############# ] -[ #### ############ ] -[ ## ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############# ] -[ ############ ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############## ] -[ ############## ] -[ ############## ] -[ ############### ] -[ ################ ] -[ ################ ] -[ ################ ] -[ ################ ] -[ ################ ] -[ ################ ] -[ ################ ] -[ ################ ] -[ ############### ] -[ ############### ] -[ ############### ] -[ ############### ] -[ ############### ] -[ ############### ] -[ ############## ] -[ ############## ] -[ ############## ] -[ #################################### ] -[ ##################################### ] -[ ##################################### ] -[ ##################################### ] -[ ##################################### ] -[ ##################################### ] -[ ##################################### ] -[ ##################################### ] -[ ##################################### ] -[ ##################################### ] - -#char : 51 '3' -[ ########### ] -[ ################## ] -[ ####################### ] -[ ########################### ] -[ ############################## ] -[ ################################ ] -[ ############################### ] -[ ################################ ] -[ ############################### ] -[ ################################ ] -[ ######## ############### ] -[ ##### ############## ] -[ ## ############# ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############# ] -[ ############ ] -[ ############# ] -[ ############### ] -[ ######################## ] -[ ####################### ] -[ ###################### ] -[ ##################### ] -[ ################### ] -[ ##################### ] -[ ####################### ] -[ ######################## ] -[ ######################### ] -[ ########################## ] -[ ################ ] -[ ############### ] -[ ############# ] -[ ############ ] -[ ############# ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############# ] -[ ############# ] -[ # ############# ] -[ #### ############## ] -[ ######## ################# ] -[ ################################## ] -[ ################################### ] -[ ################################## ] -[ ################################# ] -[ ################################ ] -[ ################################ ] -[ ############################### ] -[ ############################ ] -[ ###################### ] -[ ############ ] - - -#char : 52 '4' -[ ############ ] -[ ############# ] -[ ############## ] -[ ############### ] -[ ################ ] -[ ################# ] -[ ################# ] -[ ################## ] -[ ################### ] -[ #################### ] -[ #################### ] -[ ##################### ] -[ ###################### ] -[ ####################### ] -[ ####################### ] -[ ########### ############ ] -[ ############ ############ ] -[ ########### ############ ] -[ ########### ############ ] -[ ########### ############ ] -[ ########### ############ ] -[ ########### ############ ] -[ ########### ############ ] -[ ########### ############ ] -[ ########### ############ ] -[ ########## ############ ] -[ ########### ############ ] -[ ########### ############ ] -[ ########### ############ ] -[ ########### ############ ] -[ ########### ############ ] -[ ########### ############ ] -[ ########### ############ ] -[########################################] -[########################################] -[########################################] -[########################################] -[########################################] -[########################################] -[########################################] -[########################################] -[########################################] -[########################################] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] - -#char : 53 '5' -[ ############################## ] -[ ############################## ] -[ ############################## ] -[ ############################## ] -[ ############################## ] -[ ############################## ] -[ ############################## ] -[ ############################## ] -[ ############################## ] -[ ############################### ] -[ ########### ] -[ ########### ] -[ ########### ] -[ ########### ] -[ ########### ] -[ ########### ] -[ ########### ] -[ ########## ] -[ ########## ] -[ ########## ] -[ ############### ] -[ ################### ] -[ ###################### ] -[ ######################### ] -[ ########################### ] -[ ############################# ] -[ ############################## ] -[ ############################## ] -[ ############################### ] -[ ################################ ] -[ ###################### ] -[ ################## ] -[ ############### ] -[ ############## ] -[ ############## ] -[ ############# ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ### ############## ] -[ ####### ################# ] -[ ################################## ] -[ ################################## ] -[ ################################# ] -[ ################################ ] -[ ############################### ] -[ ############################### ] -[ ############################## ] -[ ########################### ] -[ ##################### ] -[ ############ ] - - -#char : 54 '6' -[ ###### ] -[ ########### ] -[ ################ ] -[ ################## ] -[ #################### ] -[ ###################### ] -[ ####################### ] -[ ######################### ] -[ ########################## ] -[ ########################### ] -[ ###################### ] -[ ################## ] -[ ################ ] -[ ############### ] -[ ############### ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############ ] -[ ############ ########## ] -[ ############################ ] -[ ############################## ] -[ ################################ ] -[ ################################# ] -[ ################################## ] -[#################################### ] -[##################################### ] -[##################################### ] -[###################################### ] -[############## ################ ] -[############ ############## ] -[############ ############# ] -[############ ############# ] -[############ ############ ] -[############ ############ ] -[############ ############ ] -[############ ############ ] -[############ ############ ] -[ ############ ############ ] -[ ############ ############ ] -[ ############ ############# ] -[ ############# ############ ] -[ ############ ############# ] -[ ############# ############## ] -[ ############### ############## ] -[ ################################## ] -[ ################################# ] -[ ############################### ] -[ ############################## ] -[ ############################ ] -[ ########################## ] -[ ####################### ] -[ ##################### ] -[ ################ ] -[ ########## ] - - -#char : 55 '7' -[####################################### ] -[####################################### ] -[####################################### ] -[####################################### ] -[####################################### ] -[####################################### ] -[####################################### ] -[####################################### ] -[####################################### ] -[####################################### ] -[ ############## ] -[ ############# ] -[ ############## ] -[ ############## ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############## ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############ ] -[ ############# ] -[ ############ ] -[ ############# ] -[ ############ ] -[ ############# ] -[ ############ ] -[ ############ ] -[ ############# ] -[ ############ ] -[ ############ ] -[ ############# ] -[ ############ ] -[ ############ ] -[ ############# ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] - - -#char : 56 '8' -[ ########## ] -[ ################# ] -[ ##################### ] -[ ######################## ] -[ ########################### ] -[ ############################# ] -[ ############################### ] -[ ################################ ] -[ ################################# ] -[ ################################## ] -[ ############### ############### ] -[ ############# ############## ] -[ ############# ############# ] -[ ############# ############# ] -[ ############ ############ ] -[ ############ ############ ] -[ ############ ############ ] -[ ############# ############ ] -[ ############# ############ ] -[ ############# ############ ] -[ ############## ############ ] -[ ############### ############# ] -[ ################ ############# ] -[ ############################## ] -[ ############################# ] -[ ########################### ] -[ ######################### ] -[ ######################## ] -[ ########################### ] -[ ############################## ] -[ ################################ ] -[ ################################## ] -[ ############# ################# ] -[ ############# ################ ] -[ ############# ############## ] -[ ############ ############# ] -[ ############ ############# ] -[############ ############# ] -[############ ############ ] -[############ ############ ] -[############ ############ ] -[############ ############ ] -[############# ############# ] -[############# ############# ] -[ ############# ############# ] -[ ############### ############### ] -[ ##################################### ] -[ ################################### ] -[ ################################### ] -[ ################################# ] -[ ############################### ] -[ ############################# ] -[ ########################### ] -[ ####################### ] -[ ################### ] -[ ########### ] - - -#char : 57 '9' -[ ########## ] -[ ################# ] -[ ##################### ] -[ ######################## ] -[ ########################### ] -[ ############################# ] -[ ############################### ] -[ ################################ ] -[ ################################# ] -[ ################################### ] -[ ############### ############### ] -[ ############## ############## ] -[ ############# ############# ] -[ ############ ############# ] -[############# ############# ] -[############ ############ ] -[############ ############ ] -[############ ############ ] -[############ ############] -[############ ############] -[############ ############] -[############ ############] -[############# ############] -[############## ############] -[ ############## ############] -[ ################ ##############] -[ #######################################] -[ ######################################] -[ ######################################] -[ #####################################] -[ ####################################] -[ ################################## ] -[ ################################# ] -[ ############################### ] -[ ############################# ] -[ ########## ############ ] -[ ############ ] -[ ############ ] -[ ############# ] -[ ############# ] -[ ############## ] -[ ############## ] -[ ############### ] -[ ################ ] -[ ################## ] -[ ###################### ] -[ ############################# ] -[ ########################### ] -[ ########################## ] -[ ######################### ] -[ ####################### ] -[ ##################### ] -[ ################### ] -[ ################# ] -[ ############# ] -[ ######## ] - diff --git a/src/modm/ui/display/font/numbers_46x64.font b/src/modm/ui/display/font/numbers_46x64.font deleted file mode 100644 index c77b22c333..0000000000 --- a/src/modm/ui/display/font/numbers_46x64.font +++ /dev/null @@ -1,666 +0,0 @@ -#font : Numbers 46x64 -#width : 46 -#height : 64 -#hspace : 4 -#vspace : 4 - -#char : 48 '0' -[ ########## ] -[ ################# ] -[ ##################### ] -[ ######################## ] -[ ########################### ] -[ ############################# ] -[ ############################### ] -[ ################################ ] -[ ################################## ] -[ #################################### ] -[ #################################### ] -[ ################ ################ ] -[ ############## ############## ] -[ ############## ############## ] -[ ############# ############# ] -[ ############## ############## ] -[ ############# ############# ] -[ ############# ############# ] -[ ############# ############## ] -[ ############# ############# ] -[ ############# ############# ] -[ ############# ############# ] -[ ############# ############# ] -[ ############ ############ ] -[############# #############] -[############# #############] -[############# #############] -[############# #############] -[############# #############] -[############# #############] -[############# #############] -[############# #############] -[############# #############] -[############# #############] -[############# #############] -[############# #############] -[############# #############] -[############# #############] -[############# #############] -[############# #############] -[ ############ ############ ] -[ ############# ############# ] -[ ############# ############# ] -[ ############# ############# ] -[ ############# ############# ] -[ ############# ############## ] -[ ############# ############# ] -[ ############# ############# ] -[ ############## ############## ] -[ ############# ############# ] -[ ############## ############## ] -[ ############### ############## ] -[ ################ ################ ] -[ #################################### ] -[ #################################### ] -[ ################################## ] -[ ################################ ] -[ ################################ ] -[ ############################## ] -[ ############################ ] -[ ######################## ] -[ ###################### ] -[ ################## ] -[ ########## ] - -#char : 49 '1' -[ ######### ] -[ ########### ] -[ ############ ] -[ ############# ] -[ ############## ] -[ ################ ] -[ ################# ] -[ ################### ] -[ ##################### ] -[ ###################### ] -[ ######################## ] -[ ########################### ] -[ ############################# ] -[ ############################## ] -[ ############################## ] -[ ############################# ] -[ ############################# ] -[ ############## ############# ] -[ ############# ############# ] -[ ########## ############# ] -[ ####### ############# ] -[ ##### ############# ] -[ # ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] - -#char : 50 '2' -[ ########### ] -[ ################### ] -[ ######################## ] -[ ########################### ] -[ ############################### ] -[ ################################# ] -[ #################################### ] -[ ##################################### ] -[ ####################################### ] -[ ###################################### ] -[ ###################################### ] -[ ############## ################# ] -[ ########### ############## ] -[ ######## ############## ] -[ ##### ############## ] -[ #### ############# ] -[ ## ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############## ] -[ ############# ] -[ ############## ] -[ ############### ] -[ ############## ] -[ ############### ] -[ ############### ] -[ ################ ] -[ ################ ] -[ ################ ] -[ ################# ] -[ ################# ] -[ ################# ] -[ ################# ] -[ ################# ] -[ ################# ] -[ ################# ] -[ ################# ] -[ ################# ] -[ ################# ] -[ ################# ] -[ ################# ] -[ ################# ] -[ ################ ] -[ ################# ] -[ ################# ] -[ ################ ] -[ ################ ] -[ ############### ] -[ ################ ] -[ ############### ] -[ ######################################## ] -[ ######################################### ] -[ ######################################### ] -[ ######################################### ] -[ ######################################### ] -[ ######################################### ] -[ ######################################### ] -[ ######################################### ] -[ ######################################### ] -[ ######################################### ] -[ ######################################### ] - -#char : 51 '3' -[ ########### ] -[ ################### ] -[ ######################## ] -[ ############################ ] -[ ############################### ] -[ ################################### ] -[ ################################### ] -[ ################################### ] -[ #################################### ] -[ ################################### ] -[ #################################### ] -[ ########## ################# ] -[ ####### ############### ] -[ #### ############### ] -[ ## ############## ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############## ] -[ ############# ] -[ ############## ] -[ ############## ] -[ ################# ] -[ ########################## ] -[ ######################### ] -[ ######################## ] -[ ####################### ] -[ ##################### ] -[ ####################### ] -[ ######################### ] -[ ########################## ] -[ ############################ ] -[ ############################ ] -[ ############################# ] -[ ################### ] -[ ################ ] -[ ############### ] -[ ############## ] -[ ############## ] -[ ############## ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############## ] -[ ############## ] -[ ############## ] -[ # ############### ] -[ ##### ################ ] -[ ######### ################## ] -[ ####################################### ] -[ ###################################### ] -[ ####################################### ] -[ ###################################### ] -[ ##################################### ] -[ #################################### ] -[ #################################### ] -[ ################################## ] -[ ############################## ] -[ ####################### ] -[ ############# ] - -#char : 52 '4' -[ ############ ] -[ ############# ] -[ ############## ] -[ ############### ] -[ ################ ] -[ ################# ] -[ ################## ] -[ ################## ] -[ ################### ] -[ #################### ] -[ ##################### ] -[ ###################### ] -[ ###################### ] -[ ####################### ] -[ ######################## ] -[ ######################### ] -[ ######################### ] -[ ########################## ] -[ ############# ############# ] -[ ############ ############# ] -[ ############# ############# ] -[ ############# ############# ] -[ ############ ############# ] -[ ############# ############# ] -[ ############# ############# ] -[ ############ ############# ] -[ ############ ############# ] -[ ############# ############# ] -[ ############ ############# ] -[ ############ ############# ] -[ ############ ############# ] -[ ############ ############# ] -[ ############# ############# ] -[ ############ ############# ] -[ ############# ############# ] -[ ############ ############# ] -[ ############# ############# ] -[ ############ ############# ] -[##############################################] -[##############################################] -[##############################################] -[##############################################] -[##############################################] -[##############################################] -[##############################################] -[##############################################] -[##############################################] -[##############################################] -[##############################################] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] - -#char : 53 '5' -[ ################################## ] -[ ################################## ] -[ ################################## ] -[ ################################## ] -[ ################################## ] -[ ################################## ] -[ ################################## ] -[ ################################## ] -[ ################################### ] -[ ################################### ] -[ ################################### ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ########### ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ################# ] -[ ###################### ] -[ ######################### ] -[ ############################ ] -[ ############################# ] -[ ############################### ] -[ ################################ ] -[ ################################## ] -[ ################################### ] -[ #################################### ] -[ ##################################### ] -[ ########################## ] -[ ##################### ] -[ ################## ] -[ ################ ] -[ ############## ] -[ ############## ] -[ ############## ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############## ] -[ ############## ] -[ # ############### ] -[ #### ################ ] -[ ######### ################## ] -[ ####################################### ] -[ ####################################### ] -[ ###################################### ] -[ ###################################### ] -[ ##################################### ] -[ #################################### ] -[ ################################### ] -[ ################################## ] -[ ############################## ] -[ ####################### ] -[ ############## ] - -#char : 54 '6' -[ ] -[ ####### ] -[ ############# ] -[ ################ ] -[ ################### ] -[ ###################### ] -[ ######################## ] -[ ########################## ] -[ ########################### ] -[ ############################# ] -[ ############################## ] -[ ############################### ] -[ ######################### ] -[ ##################### ] -[ ################### ] -[ ################## ] -[ ################ ] -[ ################ ] -[ ############### ] -[ ############## ] -[ ############## ] -[ ############## ] -[ ############# ] -[ ############## ] -[ ############# ############ ] -[ ################################ ] -[ ################################### ] -[ ##################################### ] -[ ###################################### ] -[ ######################################## ] -[ ######################################### ] -[########################################## ] -[########################################### ] -[############################################ ] -[############################################ ] -[################ ################## ] -[############# ################ ] -[############# ############## ] -[############# ##############] -[############# ##############] -[############# #############] -[############# #############] -[############# #############] -[############# #############] -[ ############# #############] -[ ############# #############] -[ ############# #############] -[ ############# ##############] -[ ############## ############# ] -[ ############## ############## ] -[ ############## ############### ] -[ ################ ############### ] -[ ################# ################# ] -[ ######################################## ] -[ ####################################### ] -[ ##################################### ] -[ #################################### ] -[ ################################## ] -[ ################################ ] -[ ############################## ] -[ ########################### ] -[ ######################## ] -[ ################### ] -[ ############ ] - -#char : 55 '7' -[ ########################################### ] -[ ########################################### ] -[ ########################################### ] -[ ########################################### ] -[ ########################################### ] -[ ########################################### ] -[ ########################################### ] -[ ########################################### ] -[ ########################################### ] -[ ########################################### ] -[ ########################################## ] -[ ############## ] -[ ############### ] -[ ############### ] -[ ############## ] -[ ############### ] -[ ############### ] -[ ############## ] -[ ############### ] -[ ############## ] -[ ############## ] -[ ############## ] -[ ############## ] -[ ############## ] -[ ############## ] -[ ############## ] -[ ############## ] -[ ############## ] -[ ############# ] -[ ############## ] -[ ############# ] -[ ############## ] -[ ############# ] -[ ############# ] -[ ############## ] -[ ############# ] -[ ############# ] -[ ############## ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############## ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] -[ ############# ] - -#char : 56 '8' -[ ########## ] -[ ################## ] -[ ###################### ] -[ ########################## ] -[ ############################ ] -[ ############################### ] -[ ################################# ] -[ ################################## ] -[ #################################### ] -[ ##################################### ] -[ ###################################### ] -[ ################# ################# ] -[ ############### ############### ] -[ ############## ############### ] -[ ############## ############## ] -[ ############# ############# ] -[ ############# ############# ] -[ ############# ############# ] -[ ############# ############# ] -[ ############# ############# ] -[ ############## ############# ] -[ ############## ############# ] -[ ############## ############# ] -[ ############### ############# ] -[ ################ ############## ] -[ ################# ############## ] -[ ################### ############## ] -[ ################################## ] -[ ################################ ] -[ ############################# ] -[ ########################### ] -[ ########################### ] -[ ############################# ] -[ ################################ ] -[ ################################## ] -[ #################################### ] -[ ############### ##################### ] -[ ############## ################### ] -[ ############## ################# ] -[ ############## ################ ] -[ ############## ############### ] -[ ############# ############## ] -[ ############## ############## ] -[ ############# ############# ] -[ ############# ############# ] -[ ############# ############# ] -[ ############# ############# ] -[ ############# ############# ] -[ ############## ############## ] -[ ############## ############## ] -[ ############### ############## ] -[ ############### ############### ] -[ ################# ################# ] -[ ######################################## ] -[ ######################################## ] -[ ###################################### ] -[ ###################################### ] -[ #################################### ] -[ ################################## ] -[ ################################ ] -[ ############################ ] -[ ######################## ] -[ #################### ] -[ ############ ] - -#char : 57 '9' -[ ########### ] -[ ################# ] -[ ###################### ] -[ ######################### ] -[ ############################ ] -[ ############################### ] -[ ################################# ] -[ ################################## ] -[ ################################### ] -[ ##################################### ] -[ ##################################### ] -[ ################ ################ ] -[ ############### ############### ] -[ ############## ############## ] -[ ############## ############## ] -[ ############# ############## ] -[ ############## ############## ] -[ ############# ############# ] -[ ############# ############# ] -[ ############# ############# ] -[ ############# ############# ] -[ ############# ############# ] -[ ############# ############# ] -[ ############# ############# ] -[ ############# ############# ] -[ ############## ############# ] -[ ############## ############# ] -[ ############## ############# ] -[ ############### ############# ] -[ ################## ################ ] -[ ########################################## ] -[ ########################################## ] -[ ######################################### ] -[ ######################################### ] -[ ######################################## ] -[ ####################################### ] -[ ##################################### ] -[ #################################### ] -[ ################################## ] -[ ################## ############# ] -[ ########### ############## ] -[ ############# ] -[ ############# ] -[ ############## ] -[ ############## ] -[ ############## ] -[ ############### ] -[ ############### ] -[ ################# ] -[ ################# ] -[ ################## ] -[ ##################### ] -[ ######################### ] -[ ################################ ] -[ ############################### ] -[ ############################# ] -[ ############################ ] -[ ########################## ] -[ ######################### ] -[ ####################### ] -[ ##################### ] -[ ################## ] -[ ############## ] -[ ######## ] - diff --git a/src/modm/ui/display/font/scripto_narrow.font b/src/modm/ui/display/font/scripto_narrow.font deleted file mode 100644 index fec1ea913c..0000000000 --- a/src/modm/ui/display/font/scripto_narrow.font +++ /dev/null @@ -1,860 +0,0 @@ -#font : Scripto Narrow -#width : 5 -#height : 7 -#vspace : 1 -#hspace : 0 - -#char : 32 ' ' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 33 '!' -[#] -[#] -[#] -[#] -[ ] -[#] -[ ] - -#char : 34 '"' -[# #] -[# #] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 35 '#' -[ # # ] -[#####] -[ # # ] -[ # # ] -[#####] -[ # # ] -[ ] - -#char : 36 '$' -[ # ] -[ ####] -[# # ] -[ ### ] -[ # #] -[#### ] -[ # ] - -#char : 37 '%' -[ ## #] -[# # # ] -[## # ] -[ # ##] -[ # # #] -[# ## ] -[ ] - -#char : 38 '&' -[ ## ] -[# # ] -[ # ] -[## ] -[# # ] -[## #] -[ ] - -#char : 39 ''' -[#] -[#] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 40 '(' -[ #] -[# ] -[# ] -[# ] -[# ] -[ #] -[ ] - -#char : 41 ')' -[# ] -[ #] -[ #] -[ #] -[ #] -[# ] -[ ] - -#char : 42 '*' -[ ] -[# #] -[ ## ] -[####] -[ ## ] -[# #] -[ ] - -#char : 43 '+' -[ ] -[ ] -[ # ] -[###] -[ # ] -[ ] -[ ] - -#char : 44 ',' -[ ] -[ ] -[ ] -[ ] -[ ] -[ #] -[# ] - -#char : 45 '-' -[ ] -[ ] -[ ] -[ ] -[###] -[ ] -[ ] - -#char : 46 '.' -[ ] -[ ] -[ ] -[ ] -[ ] -[ #] -[# ] - -#char : 47 '/' -[ #] -[ #] -[ #] -[# ] -[# ] -[# ] -[ ] - -#char : 48 '0' -[ ##] -[# #] -[# #] -[# #] -[# #] -[## ] -[ ] - -#char : 49 '1' -[ #] -[##] -[ #] -[ #] -[ #] -[ #] -[ ] - -#char : 50 '2' -[## ] -[ #] -[ # ] -[# ] -[# ] -[###] -[ ] - -#char : 51 '3' -[## ] -[ #] -[ # ] -[ #] -[ #] -[###] -[ ] - -#char : 52 '4' -[ #] -[ ##] -[# #] -[###] -[ #] -[ #] -[ ] - -#char : 53 '5' -[###] -[# ] -[## ] -[ #] -[ #] -[###] -[ ] - -#char : 54 '6' -[ ##] -[# ] -[###] -[# #] -[# #] -[ # ] -[ ] - -#char : 55 '7' -[###] -[ #] -[ #] -[ # ] -[ # ] -[ # ] -[ ] - -#char : 56 '8' -[ ##] -[# #] -[ # ] -[# #] -[# #] -[## ] -[ ] - -#char : 57 '9' -[ # ] -[# #] -[# #] -[###] -[ #] -[## ] -[ ] - -#char : 58 ':' -[ ] -[ ] -[#] -[ ] -[#] -[ ] -[ ] - -#char : 59 ';' -[ ] -[ ] -[ #] -[ ] -[ ] -[ #] -[# ] - -#char : 60 '<' -[ ] -[ #] -[ # ] -[# ] -[ # ] -[ #] -[ ] - -#char : 61 '=' -[ ] -[ ] -[###] -[ ] -[###] -[ ] -[ ] - -#char : 62 '>' -[ ] -[# ] -[ # ] -[ #] -[ # ] -[# ] -[ ] - -#char : 63 '?' -[ ## ] -[# #] -[ # ] -[ # ] -[ ] -[ # ] -[ ] - -#char : 64 '@' -[###] -[# #] -[# #] -[# #] -[# ] -[###] -[ ] - -#char : 65 'A' -[## ] -[# #] -[# #] -[###] -[# #] -[# #] -[ ] - -#char : 66 'B' -[## ] -[# #] -[## ] -[# #] -[# #] -[###] -[ ] - -#char : 67 'C' -[ ##] -[# ] -[# ] -[# ] -[# ] -[###] -[ ] - -#char : 68 'D' -[## ] -[# #] -[# #] -[# #] -[# #] -[###] -[ ] - -#char : 69 'E' -[###] -[# ] -[## ] -[# ] -[# ] -[###] -[ ] - -#char : 70 'F' -[###] -[# ] -[## ] -[# ] -[# ] -[# ] -[ ] - -#char : 71 'G' -[ ##] -[# ] -[# ] -[###] -[# #] -[###] -[ ] - -#char : 72 'H' -[# #] -[# #] -[###] -[# #] -[# #] -[# #] -[ ] - -#char : 73 'I' -[#] -[#] -[#] -[#] -[#] -[#] -[ ] - -#char : 74 'J' -[ #] -[ #] -[ #] -[ #] -[ #] -[## ] -[ ] - -#char : 75 'K' -[# #] -[# #] -[## ] -[# #] -[# #] -[# #] -[ ] - -#char : 76 'L' -[# ] -[# ] -[# ] -[# ] -[# ] -[###] -[ ] - -#char : 77 'M' -[# #] -[####] -[# #] -[# #] -[# #] -[# #] -[ ] - -#char : 78 'N' -[# #] -[###] -[# #] -[# #] -[# #] -[# #] -[ ] - -#char : 79 'O' -[ ##] -[# #] -[# #] -[# #] -[# #] -[## ] -[ ] - -#char : 80 'P' -[## ] -[# #] -[# #] -[###] -[# ] -[# ] -[ ] - -#char : 81 'Q' -[ # ] -[# #] -[# #] -[# #] -[###] -[ ##] -[ ] - -#char : 82 'R' -[## ] -[# #] -[# #] -[## ] -[# #] -[# #] -[ ] - -#char : 83 'S' -[ ##] -[# ] -[ # ] -[ #] -[ #] -[## ] -[ ] - -#char : 84 'T' -[###] -[ # ] -[ # ] -[ # ] -[ # ] -[ # ] -[ ] - -#char : 85 'U' -[# #] -[# #] -[# #] -[# #] -[# #] -[ ##] -[ ] - -#char : 86 'V' -[# #] -[# #] -[# #] -[# #] -[# #] -[ # ] -[ ] - -#char : 87 'W' -[# #] -[# #] -[# #] -[# #] -[####] -[# #] -[ ] - -#char : 88 'X' -[# #] -[ ## ] -[ ## ] -[ ## ] -[ ## ] -[# #] -[ ] - -#char : 89 'Y' -[# #] -[# #] -[# #] -[ # ] -[ # ] -[ # ] -[ ] - -#char : 90 'Z' -[###] -[ #] -[ # ] -[# ] -[# ] -[###] -[ ] - -#char : 91 '[' -[##] -[# ] -[# ] -[# ] -[# ] -[##] -[ ] - -#char : 92 '\' -[# ] -[# ] -[# ] -[ #] -[ #] -[ #] -[ ] - -#char : 93 ']' -[##] -[ #] -[ #] -[ #] -[ #] -[##] -[ ] - -#char : 94 '^' -[ # ] -[# #] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 95 '_' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[###] - -#char : 96 '`' -[# ] -[ #] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 97 'a' -[ ] -[ ] -[ ##] -[# #] -[# #] -[###] -[ ] - -#char : 98 'b' -[# ] -[# ] -[## ] -[# #] -[# #] -[###] -[ ] - -#char : 99 'c' -[ ] -[ ] -[ ##] -[# ] -[# ] -[###] -[ ] - -#char : 100 'd' -[ #] -[ #] -[ ##] -[# #] -[# #] -[###] -[ ] - -#char : 101 'e' -[ ] -[ ] -[ # ] -[###] -[# ] -[###] -[ ] - -#char : 102 'f' -[ #] -[# ] -[##] -[# ] -[# ] -[# ] -[ ] - -#char : 103 'g' -[ ] -[ ##] -[# #] -[# #] -[###] -[ #] -[## ] - -#char : 104 'h' -[# ] -[# ] -[## ] -[# #] -[# #] -[# #] -[ ] - -#char : 105 'i' -[#] -[ ] -[#] -[#] -[#] -[#] -[ ] - -#char : 106 'j' -[ #] -[ ] -[ #] -[ #] -[ #] -[ #] -[# ] - -#char : 107 'k' -[# ] -[# ] -[###] -[## ] -[# #] -[# #] -[ ] - -#char : 108 'l' -[#] -[#] -[#] -[#] -[#] -[#] -[ ] - -#char : 109 'm' -[ ] -[ ] -[## # ] -[# # #] -[# # #] -[# # #] -[ ] - -#char : 110 'n' -[ ] -[ ] -[## ] -[# #] -[# #] -[# #] -[ ] - -#char : 111 'o' -[ ] -[ ] -[ ##] -[# #] -[# #] -[## ] -[ ] - -#char : 112 'p' -[ ] -[## ] -[# #] -[# #] -[###] -[# ] -[# ] - -#char : 113 'q' -[ ] -[ ##] -[# #] -[# #] -[###] -[ #] -[ #] - -#char : 114 'r' -[ ] -[ ] -[# #] -[## ] -[# ] -[# ] -[ ] - -#char : 115 's' -[ ] -[ ] -[ ###] -[## ] -[ ##] -[### ] -[ ] - -#char : 116 't' -[ # ] -[ # ] -[###] -[ # ] -[ # ] -[ # ] -[ ] - -#char : 117 'u' -[ ] -[ ] -[# #] -[# #] -[# #] -[ ##] -[ ] - -#char : 118 'v' -[ ] -[ ] -[# #] -[# #] -[# #] -[ # ] -[ ] - -#char : 119 'w' -[ ] -[ ] -[# # #] -[# # #] -[# # #] -[## # ] -[ ] - -#char : 120 'x' -[ ] -[ ] -[# #] -[ # ] -[ # ] -[# #] -[ ] - -#char : 121 'y' -[ ] -[# #] -[# #] -[# #] -[###] -[ #] -[## ] - -#char : 122 'z' -[ ] -[ ] -[####] -[ # ] -[ # ] -[####] -[ ] - -#char : 123 '{' -[ #] -[ # ] -[ # ] -[# ] -[ # ] -[ # ] -[ #] - -#char : 124 '|' -[#] -[#] -[ ] -[ ] -[#] -[#] -[ ] - -#char : 125 '}' -[# ] -[ # ] -[ # ] -[ #] -[ # ] -[ # ] -[# ] - -#char : 126 '~' -[ ] -[ ] -[ ## #] -[# ## ] -[ ] -[ ] -[ ] diff --git a/src/modm/ui/display/font/ubuntu_36.font b/src/modm/ui/display/font/ubuntu_36.font deleted file mode 100644 index f2973b8a3f..0000000000 --- a/src/modm/ui/display/font/ubuntu_36.font +++ /dev/null @@ -1,3557 +0,0 @@ -#font : Ubuntu_36 -#width : 10 -#height : 35 -#hspace : 1 -#vspace : 0 - -#char : 32 ' ' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 33 '!' -[ ] -[ ] -[ ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ # ] -[ # ] -[ ] -[ ] -[ ] -[ ### ] -[#####] -[#####] -[#####] -[ ### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 34 '"' -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[ # # ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 35 '#' -[ ] -[ ] -[ ] -[ ### ### ] -[ ### ### ] -[ #### ### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[####################] -[####################] -[####################] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[####################] -[####################] -[####################] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ #### ### ] -[ ### ### ] -[ ### ### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 36 '$' -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ######## ] -[ ############ ] -[ ############# ] -[ #### # ] -[ #### ] -[ ### ] -[ ### ] -[ ### ] -[ #### ] -[ ##### ] -[ ###### ] -[ ####### ] -[ ###### ] -[ ##### ] -[ #### ] -[ ### ] -[ ###] -[ ###] -[ ###] -[ ####] -[ ## #####] -[############### ] -[############## ] -[ ######### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ] -[ ] - -#char : 37 '%' -[ ] -[ ] -[ ] -[ ###### ### ] -[ ######## ### ] -[ ### ### ### ] -[#### #### ### ] -[### ### ### ] -[### ### ### ] -[### ### ### ] -[### ### ### ] -[#### #### ### ] -[ ### ### ### ] -[ ######## ### ] -[ ###### ### ] -[ ### ] -[ ### ###### ] -[ ### ######## ] -[ ### ### ### ] -[ ### #### ####] -[ ### ### ###] -[ ### ### ###] -[ ### ### ###] -[ ### ### ###] -[ ### #### ####] -[ ### ### ### ] -[ ### ######## ] -[ ### ###### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 38 '&' -[ ] -[ ] -[ ] -[ ##### ] -[ ######## ] -[ ########## ] -[ #### #### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ ### #### ] -[ #### ### ] -[ ### #### ] -[ ######## ] -[ ###### ] -[ ###### ] -[ ######### ## ] -[ #### #### ### ] -[ ### #### ## ] -[### #### ### ] -[### ####### ] -[### ###### ] -[### #### ] -[#### #### ] -[ #### ####### ] -[ ################## ] -[ ########### #### ] -[ ###### ####] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 39 ''' -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[ # ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 40 '(' -[ # ] -[ ###] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ###] -[ # ] - -#char : 41 ')' -[ # ] -[### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[### ] -[ # ] - -#char : 42 '*' -[ ] -[ ] -[ ] -[ ### ] -[ ### ] -[ ### ] -[ # ### # ] -[#### ### ####] -[ ##### # ##### ] -[ ######### ] -[ ### ] -[ ## ## ] -[ ### ### ] -[ ### ### ] -[ #### #### ] -[ ### ### ] -[ # # ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 43 '+' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[#################] -[#################] -[#################] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 44 ',' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ## ] -[ ## ] -[### ] -[## ] -[ # ] -[ ] - -#char : 45 '-' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[#########] -[#########] -[#########] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 46 '.' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ### ] -[#####] -[#####] -[#####] -[ ### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 47 '/' -[ ##] -[ ###] -[ ###] -[ ###] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ #### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[### ] -[### ] -[### ] -[## ] - -#char : 48 '0' -[ ] -[ ] -[ ] -[ ###### ] -[ ######## ] -[ ########## ] -[ #### #### ] -[ #### #### ] -[ ### ### ] -[ ### ### ] -[#### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[#### ###] -[ ### ### ] -[ ### ### ] -[ #### #### ] -[ #### #### ] -[ ########## ] -[ ######## ] -[ ###### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 49 '1' -[ ] -[ ] -[ ] -[ ###] -[ ####] -[ #####] -[ #######] -[ #########] -[###### ###] -[ #### ###] -[ # ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 50 '2' -[ ] -[ ] -[ ] -[ ####### ] -[ ########### ] -[ ############# ] -[##### #### ] -[ ## #### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ ### ] -[### ] -[################] -[################] -[################] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 51 '3' -[ ] -[ ] -[ ] -[ ####### ] -[ ########### ] -[############# ] -[ ## #### ] -[ #### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ####### ] -[ ####### ] -[ ######### ] -[ ##### ] -[ ### ] -[ ####] -[ ###] -[ ###] -[ ###] -[ ###] -[ ### ] -[### ##### ] -[############# ] -[############ ] -[ ######## ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 52 '4' -[ ] -[ ] -[ ] -[ ### ] -[ #### ] -[ ##### ] -[ ###### ] -[ ####### ] -[ #### ### ] -[ ### ### ] -[ #### ### ] -[ #### ### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[### ### ] -[#################] -[#################] -[#################] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 53 '5' -[ ] -[ ] -[ ] -[ ############ ] -[ ############ ] -[ ############ ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ####### ] -[ ########## ] -[ ############ ] -[ ####### ] -[ #### ] -[ ####] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ### ] -[### ##### ] -[############# ] -[############ ] -[ ######## ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 54 '6' -[ ] -[ ] -[ ] -[ #### ] -[ ####### ] -[ ######### ] -[ ###### ] -[ #### ] -[ #### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ###### ] -[############# ] -[############## ] -[#### #### ] -[### ### ] -[### ###] -[### ###] -[### ###] -[### ###] -[#### ###] -[ ### ####] -[ #### ### ] -[ #### ##### ] -[ ############ ] -[ ########## ] -[ ###### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 55 '7' -[ ] -[ ] -[ ] -[################] -[################] -[################] -[ ## ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ## ] -[ ### ] -[ ### ] -[ ## ] -[ ### ] -[ ### ] -[ ### ] -[ ## ] -[ ### ] -[ ### ] -[ ### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 56 '8' -[ ] -[ ] -[ ] -[ ###### ] -[ ########## ] -[ ############ ] -[ #### #### ] -[ #### #### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ #### ### ] -[ ### ### ] -[ ##### #### ] -[ ########## ] -[ ######## ] -[ ########### ] -[ ### ###### ] -[ ### #### ] -[### ####] -[### ###] -[### ###] -[### ###] -[#### ####] -[ #### #### ] -[ ############## ] -[ ########### ] -[ ###### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 57 '9' -[ ] -[ ] -[ ] -[ ###### ] -[ ########## ] -[ ############ ] -[ #### #### ] -[ ### ### ] -[### ### ] -[### ###] -[### ###] -[### ###] -[### ###] -[#### ###] -[ #### ####] -[ ##############] -[ #############] -[ ###### ###] -[ ### ] -[ ### ] -[ #### ] -[ ### ] -[ #### ] -[ #### ] -[ ###### ] -[ ######### ] -[ ####### ] -[ ##### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 58 ':' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ### ] -[#####] -[#####] -[#####] -[ ### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ### ] -[#####] -[#####] -[#####] -[ ### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 59 ';' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ### ] -[#####] -[#####] -[#####] -[ ### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ## ] -[ ## ] -[### ] -[## ] -[ # ] -[ ] - -#char : 60 '<' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ # ] -[ ####] -[ ######] -[ ###### ] -[ ###### ] -[ ###### ] -[ ###### ] -[###### ] -[#### ] -[###### ] -[ ###### ] -[ ###### ] -[ ###### ] -[ ###### ] -[ ######] -[ ####] -[ # ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 61 '=' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[################] -[################] -[################] -[ ] -[ ] -[ ] -[ ] -[ ] -[################] -[################] -[################] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 62 '>' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ # ] -[#### ] -[###### ] -[ ####### ] -[ ####### ] -[ ####### ] -[ ###### ] -[ ######] -[ ####] -[ ######] -[ ###### ] -[ ####### ] -[ ####### ] -[ ####### ] -[###### ] -[#### ] -[ # ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 63 '?' -[ ] -[ ] -[ ] -[ ####### ] -[########### ] -[############ ] -[ ## #####] -[ ####] -[ ###] -[ ###] -[ ###] -[ ### ] -[ ### ] -[ #### ] -[ ### ] -[ #### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ] -[ ] -[ ] -[ # ] -[ ### ] -[ ### ] -[ ### ] -[ # ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 64 '@' -[ ] -[ ] -[ ] -[ ######### ] -[ ############## ] -[ ################## ] -[ ###### ####### ] -[ ##### ##### ] -[ #### #### ] -[ #### #### ] -[ ### ######### #### ] -[ #### ############ ### ] -[ ### ############# ### ] -[ ### ##### ### ###] -[### ### ### ###] -[### #### ### ###] -[### ### ### ###] -[### ### ### ###] -[### ### ### ###] -[### ### ### ###] -[### #### ### ### ] -[### ### ### ### ] -[ ### ##### ### #### ] -[ ### ################### ] -[ #### ################# ] -[ ### ####### ##### ] -[ #### ] -[ #### ] -[ ##### ] -[ ####### # ] -[ ################ ] -[ ############## ] -[ ########## ] -[ ] -[ ] - -#char : 65 'A' -[ ] -[ ] -[ ] -[ ### ] -[ ##### ] -[ ##### ] -[ ###### ] -[ ### ### ] -[ ### ### ] -[ #### ### ] -[ ### ### ] -[ ### #### ] -[ ### ### ] -[ ### #### ] -[ #### ### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ ################# ] -[ ################## ] -[ ################## ] -[ ### #### ] -[ ### ### ] -[ #### ### ] -[ ### ### ] -[ ### ### ] -[### ###] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 66 'B' -[ ] -[ ] -[ ] -[ ########### ] -[############## ] -[################ ] -[### ##### ] -[### #### ] -[### ### ] -[### ### ] -[### ### ] -[### #### ] -[### ##### ] -[############### ] -[############## ] -[################ ] -[### ##### ] -[### ### ] -[### ###] -[### ###] -[### ###] -[### ###] -[### ####] -[### #### ] -[### ###### ] -[################ ] -[############### ] -[ ########### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 67 'C' -[ ] -[ ] -[ ] -[ ######## ] -[ #############] -[ ###############] -[ ###### ### ] -[ ##### ] -[ ### ] -[ #### ] -[ ### ] -[ ### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[#### ] -[ ### ] -[ #### ] -[ ### ] -[ #### ] -[ ##### ## ] -[ ###############] -[ ##############] -[ ######## ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 68 'D' -[ ] -[ ] -[ ] -[ ########### ] -[############### ] -[################ ] -[### ####### ] -[### #### ] -[### #### ] -[### #### ] -[### ### ] -[### ### ] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ### ] -[### ### ] -[### #### ] -[### #### ] -[### #### ] -[### ####### ] -[################ ] -[############### ] -[ ########## ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 69 'E' -[ ] -[ ] -[ ] -[################ ] -[################ ] -[################ ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[############### ] -[############### ] -[############### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[#################] -[#################] -[#################] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 70 'F' -[ ] -[ ] -[ ] -[###############] -[###############] -[###############] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[############## ] -[############## ] -[############## ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 71 'G' -[ ] -[ ] -[ ] -[ ######## ] -[ #############] -[ ###############] -[ ##### ### ] -[ #### ] -[ ### ] -[ #### ] -[ ### ] -[#### ] -[### ] -[### ] -[### ] -[### ] -[### ###] -[### ###] -[### ###] -[#### ###] -[ ### ###] -[ #### ###] -[ ### ###] -[ #### ###] -[ ##### ###] -[ ###############] -[ ##############] -[ ######## ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 72 'H' -[ ] -[ ] -[ ] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[###################] -[###################] -[###################] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 73 'I' -[ ] -[ ] -[ ] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 74 'J' -[ ] -[ ] -[ ] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ####] -[ # ### ] -[ ### #### ] -[############# ] -[ ########### ] -[ ####### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 75 'K' -[ ] -[ ] -[ ] -[### #### ] -[### #### ] -[### #### ] -[### #### ] -[### #### ] -[### #### ] -[### #### ] -[### #### ] -[### #### ] -[### #### ] -[### #### ] -[###### ] -[######## ] -[### ##### ] -[### ##### ] -[### #### ] -[### #### ] -[### ##### ] -[### ##### ] -[### ##### ] -[### ##### ] -[### #### ] -[### #### ] -[### #### ] -[### ####] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 76 'L' -[ ] -[ ] -[ ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[###############] -[###############] -[###############] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 77 'M' -[ ] -[ ] -[ ] -[ ### ### ] -[ #### #### ] -[ #### #### ] -[ ##### ##### ] -[ ###### ##### ] -[ ####### ####### ] -[ ####### ####### ] -[ ### #### #### ### ] -[ ### ### ### ### ] -[ ### #### #### ### ] -[ ### ### ### ### ] -[ ### ### ### ### ] -[ ### ### ### ### ] -[ ### ### ### ### ] -[ ### ### ### ### ] -[ ### ### ### ### ] -[#### ## ## ### ] -[### ### ### ###] -[### ## ### ###] -[### ##### ###] -[### ##### ###] -[### ### ###] -[### ###] -[### ###] -[### ###] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 78 'N' -[ ] -[ ] -[ ] -[### ###] -[#### ###] -[##### ###] -[###### ###] -[###### ###] -[####### ###] -[### #### ###] -[### #### ###] -[### #### ###] -[### #### ###] -[### #### ###] -[### #### ###] -[### #### ###] -[### #### ###] -[### ### ###] -[### ### ###] -[### #### ###] -[### ### ###] -[### ######] -[### #####] -[### #####] -[### ####] -[### ###] -[### ###] -[### ##] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 79 'O' -[ ] -[ ] -[ ] -[ ######## ] -[ ############ ] -[ ################ ] -[ ###### ###### ] -[ ##### ##### ] -[ #### #### ] -[ #### #### ] -[ ### ### ] -[ ### ####] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[ ### ####] -[ ### ### ] -[ #### #### ] -[ #### #### ] -[ ##### ##### ] -[ ###### ###### ] -[ ################ ] -[ ############ ] -[ ######## ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 80 'P' -[ ] -[ ] -[ ] -[ ########### ] -[############## ] -[################ ] -[### ###### ] -[### #### ] -[### ####] -[### ###] -[### ###] -[### ###] -[### ###] -[### ####] -[### #### ] -[### ###### ] -[################ ] -[############## ] -[########### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 81 'Q' -[ ] -[ ] -[ ] -[ ######## ] -[ ############ ] -[ ################ ] -[ ###### ###### ] -[ ##### ##### ] -[ #### #### ] -[ #### #### ] -[ ### ### ] -[ ### ####] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[#### ### ] -[ ### ### ] -[ #### #### ] -[ #### #### ] -[ ##### #### ] -[ ###### ###### ] -[ ############### ] -[ ############ ] -[ ####### ] -[ ### ] -[ #### ] -[ #### ] -[ ###### ] -[ ######## ] -[ ##### ] -[ ## ] - -#char : 82 'R' -[ ] -[ ] -[ ] -[ ########## ] -[############## ] -[############### ] -[### ##### ] -[### ### ] -[### ### ] -[### ### ] -[### ### ] -[### ### ] -[### ### ] -[### ### ] -[### ##### ] -[############### ] -[############## ] -[############ ] -[### #### ] -[### #### ] -[### ### ] -[### #### ] -[### #### ] -[### ### ] -[### #### ] -[### ### ] -[### #### ] -[### ####] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 83 'S' -[ ] -[ ] -[ ] -[ ####### ] -[ ############ ] -[ ############## ] -[ #### ## ] -[ #### ] -[ ### ] -[ ### ] -[ ### ] -[ #### ] -[ #### ] -[ ###### ] -[ ####### ] -[ ######## ] -[ ####### ] -[ ###### ] -[ #### ] -[ ####] -[ ###] -[ ###] -[ ###] -[ ####] -[ ### #### ] -[################ ] -[ ############# ] -[ ######## ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 84 'T' -[ ] -[ ] -[ ] -[###################] -[###################] -[###################] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 85 'U' -[ ] -[ ] -[ ] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[#### ####] -[ ### ### ] -[ #### #### ] -[ ##### ##### ] -[ ############# ] -[ ########### ] -[ ####### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 86 'V' -[ ] -[ ] -[ ] -[### ###] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ #### #### ] -[ ### ### ] -[ ### ### ] -[ #### #### ] -[ ### ### ] -[ #### #### ] -[ ### ### ] -[ ### ### ] -[ #### #### ] -[ ### ### ] -[ #### #### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ ####### ] -[ ##### ] -[ ##### ] -[ ### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 87 'W' -[ ] -[ ] -[ ] -[### ###] -[### ###] -[#### ####] -[ ### ### ### ] -[ ### #### ### ] -[ ### #### ### ] -[ #### ##### ### ] -[ ### ##### ### ] -[ ### ### ### #### ] -[ ### ### ### ### ] -[ #### ### #### ### ] -[ #### ### ### ### ] -[ ### ### ### #### ] -[ ### #### #### #### ] -[ #### ### ### ### ] -[ ### ### ### ### ] -[ ### ### #### ### ] -[ ### ### ### #### ] -[ #### #### #### ### ] -[ ### ### ### ### ] -[ ### ### ### ### ] -[ ###### ####### ] -[ ##### ##### ] -[ ##### ##### ] -[ #### #### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 88 'X' -[ ] -[ ] -[ ] -[#### #### ] -[ ### ### ] -[ ### ### ] -[ #### #### ] -[ #### ### ] -[ ### ### ] -[ #### #### ] -[ #### ### ] -[ ### ### ] -[ ####### ] -[ ###### ] -[ #### ] -[ #### ] -[ ##### ] -[ ####### ] -[ #### ### ] -[ #### ### ] -[ ### #### ] -[ #### #### ] -[ #### ### ] -[ ### ### ] -[ #### #### ] -[ #### ### ] -[ ### ### ] -[#### ####] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 89 'Y' -[ ] -[ ] -[ ] -[#### ####] -[ ### ### ] -[ #### #### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ #### #### ] -[ ### ### ] -[ ### ### ] -[ #### #### ] -[ ### ### ] -[ ####### ] -[ ##### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 90 'Z' -[ ] -[ ] -[ ] -[ ##################] -[ ##################] -[ ##################] -[ ####] -[ #### ] -[ #### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ #### ] -[ #### ] -[ ### ] -[ ### ] -[ ### ] -[ #### ] -[ ### ] -[ ### ] -[ #### ] -[ ### ] -[ ### ] -[ #### ] -[###################] -[###################] -[###################] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 91 '[' -[#########] -[#########] -[#########] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[#########] -[#########] -[#########] - -#char : 92 '\' -[## ] -[### ] -[### ] -[### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ #### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ###] -[ ###] -[ ###] -[ ##] - -#char : 93 ']' -[#########] -[#########] -[#########] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[#########] -[#########] -[#########] - -#char : 94 '^' -[ ] -[ ] -[ ] -[ ### ] -[ ##### ] -[ ##### ] -[ ### ### ] -[ #### #### ] -[ ### ### ] -[ #### #### ] -[ ### ### ] -[ #### #### ] -[ ### ### ] -[ #### #### ] -[ ### ### ] -[#### ####] -[ # # ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 95 '_' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[##################] -[##################] -[##################] - -#char : 96 '`' -[ # ] -[### ] -[#### ] -[ #### ] -[ ####] -[ ###] -[ # ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 97 'a' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ####### ] -[ ########## ] -[ ########### ] -[ # #### ] -[ ####] -[ ###] -[ ###] -[ ##########] -[ ############] -[ #############] -[##### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[##### ###] -[ #############] -[ ############] -[ ######### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 98 'b' -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ###### ] -[############# ] -[############## ] -[##### #### ] -[### #### ] -[### ### ] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ####] -[### ### ] -[### #### ] -[### #### ] -[############# ] -[############ ] -[ ######## ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 99 'c' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ####### ] -[ ##########] -[ ###########] -[ #### # ] -[ #### ] -[ ### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[ ### ] -[ #### ] -[ #### #] -[ ############] -[ ##########] -[ ####### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 100 'd' -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###### ###] -[ #############] -[ ##############] -[ #### #####] -[ #### ###] -[ ### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[#### ###] -[ ### ###] -[ #### ###] -[ #### ###] -[ #############] -[ ############] -[ ######## ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 101 'e' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ##### ] -[ ######### ] -[ ############ ] -[ #### #### ] -[ ### ### ] -[ ### ###] -[### ###] -[################] -[################] -[################] -[### ] -[### ] -[#### ] -[ ### ] -[ #### ] -[ #### ## ] -[ ############# ] -[ ########### ] -[ ####### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 102 'f' -[ #######] -[ #########] -[ ##########] -[ #### ] -[#### ] -[### ] -[### ] -[### ] -[### ] -[########## ] -[########## ] -[########## ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 103 'g' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ######## ] -[ ############] -[ ##############] -[ #### ###] -[ #### ###] -[ ### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[#### ###] -[ #### ###] -[ ##### #####] -[ ##############] -[ #############] -[ ###### ###] -[ ###] -[ ###] -[ ####] -[ ### ] -[ # ##### ] -[ ############# ] -[ ############ ] -[ ######## ] - -#char : 104 'h' -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ####### ] -[############ ] -[############# ] -[### #### ] -[### ### ] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 105 'i' -[ ] -[###] -[###] -[###] -[###] -[ ] -[ ] -[ ] -[ ] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 106 'j' -[ ] -[ ###] -[ ###] -[ ###] -[ ###] -[ ] -[ ] -[ ] -[ ] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ### ] -[##### ] -[#### ] -[### ] - -#char : 107 'k' -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### #### ] -[### #### ] -[### #### ] -[### #### ] -[### #### ] -[### #### ] -[### #### ] -[####### ] -[###### ] -[####### ] -[### #### ] -[### #### ] -[### #### ] -[### #### ] -[### #### ] -[### #### ] -[### #### ] -[### #### ] -[### ####] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 108 'l' -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[#### ] -[######] -[ #####] -[ ###] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 109 'm' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ######## ###### ] -[############ ########## ] -[######################## ] -[### ###### #### ] -[### ### ####] -[### ### ###] -[### ### ###] -[### ### ###] -[### ### ###] -[### ### ###] -[### ### ###] -[### ### ###] -[### ### ###] -[### ### ###] -[### ### ###] -[### ### ###] -[### ### ###] -[### ### ###] -[### ### ###] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 110 'n' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ######### ] -[############# ] -[############# ] -[### #### ] -[### ### ] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 111 'o' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ##### ] -[ ######### ] -[ ############# ] -[ #### #### ] -[ #### #### ] -[ ### ### ] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[ ### ### ] -[ #### #### ] -[ #### #### ] -[ ############# ] -[ ######### ] -[ ##### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 112 'p' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ######## ] -[############ ] -[############# ] -[### #### ] -[### #### ] -[### ### ] -[### ####] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ### ] -[### #### ] -[##### #### ] -[############## ] -[############# ] -[### ###### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] - -#char : 113 'q' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ######## ] -[ ############] -[ #############] -[ #### ###] -[ #### ###] -[ ### ###] -[#### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[ ### ###] -[ #### ###] -[ #### #####] -[ ##############] -[ #############] -[ ###### ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] -[ ###] - -#char : 114 'r' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ #########] -[###########] -[###########] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 115 's' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ####### ] -[ ########## ] -[ ########### ] -[#### # ] -[### ] -[### ] -[#### ] -[ #### ] -[ ####### ] -[ ######## ] -[ ####### ] -[ #####] -[ ####] -[ ###] -[ ###] -[ # ####] -[############ ] -[########### ] -[ ####### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 116 't' -[ ] -[ ] -[ ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[######### ] -[######### ] -[######### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[### ] -[#### ] -[ #########] -[ ########] -[ ###### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 117 'u' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[### ###] -[#### ###] -[ ### ###] -[ #### ###] -[ #############] -[ ############] -[ ######### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 118 'v' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[### ###] -[#### ####] -[ ### ### ] -[ ### ### ] -[ #### #### ] -[ ### ### ] -[ ### ### ] -[ #### #### ] -[ ### ### ] -[ ### ### ] -[ #### #### ] -[ ### ### ] -[ #### #### ] -[ ### ### ] -[ ####### ] -[ ####### ] -[ ##### ] -[ ##### ] -[ ### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 119 'w' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[### ### ###] -[### ### ###] -[ ### ##### ### ] -[ ### ##### ### ] -[ ### ##### ### ] -[ ### ##### #### ] -[ ### ### ### ### ] -[ ### ### ### ### ] -[ ### ### ### ### ] -[ ### ### #### ### ] -[ ### ### ### ### ] -[ ### ### ### ### ] -[ ### #### #### ### ] -[ ### ### ### ### ] -[ ### ### ### ### ] -[ ##### ###### ] -[ ##### ##### ] -[ ##### ##### ] -[ ### #### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 120 'x' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[#### #### ] -[ ### ### ] -[ ### ### ] -[ #### #### ] -[ ### ### ] -[ ### #### ] -[ ####### ] -[ ##### ] -[ ##### ] -[ #### ] -[ ##### ] -[ ####### ] -[ ### #### ] -[ #### #### ] -[ #### ### ] -[ ### #### ] -[ #### #### ] -[ ### ### ] -[#### ####] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 121 'y' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ### ###] -[ ### ####] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ ### ### ] -[ ### ## ] -[ ###### ] -[ ##### ] -[ #### ] -[ #### ] -[ ### ] -[ #### ] -[ ### ] -[ #### ] -[######### ] -[######## ] -[###### ] - -#char : 122 'z' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ##############] -[ ##############] -[ ##############] -[ ####] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ #### ] -[ ### ] -[ ### ] -[ #### ] -[ #### ] -[ #### ] -[ ### ] -[ #### ] -[###############] -[###############] -[###############] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 123 '{' -[ ####] -[ #####] -[ ######] -[ #### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[##### ] -[#### ] -[##### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ #### ] -[ ######] -[ #####] -[ ####] - -#char : 124 '|' -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] -[###] - -#char : 125 '}' -[#### ] -[##### ] -[###### ] -[ #### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ #####] -[ ####] -[ #####] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ ### ] -[ #### ] -[###### ] -[##### ] -[#### ] - -#char : 126 '~' -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ #### ## ] -[ ###### ###] -[ ######### ####] -[ ### ######### ] -[### ###### ] -[ ## #### ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] - -#char : 127 -[ ] -[##############] -[##############] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[## ##] -[##############] -[##############] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] -[ ] diff --git a/src/modm/ui/display/graphic_display.cpp b/src/modm/ui/display/graphic_display.cpp deleted file mode 100644 index 1c5727e66e..0000000000 --- a/src/modm/ui/display/graphic_display.cpp +++ /dev/null @@ -1,292 +0,0 @@ -/* - * Copyright (c) 2009, Martin Rosekeit - * Copyright (c) 2009-2011, 2013, Fabian Greif - * Copyright (c) 2010, Georgi Grinshpun - * Copyright (c) 2012, Sascha Schade - * Copyright (c) 2012-2014, 2017, Niklas Hauser - * Copyright (c) 2014, Daniel Krebs - * Copyright (c) 2016, Antal Szabó - * Copyright (c) 2017, Christopher Durand - * - * This file is part of the modm project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -// ---------------------------------------------------------------------------- - -#include "graphic_display.hpp" - -#include -#include - -#include "font/fixed_width_5x8.hpp" - -// ---------------------------------------------------------------------------- -modm::GraphicDisplay::GraphicDisplay() - : IOStream(writer), writer(this), font(modm::accessor::asFlash(modm::font::FixedWidth5x8)) -{} - -// ---------------------------------------------------------------------------- -void -modm::GraphicDisplay::drawLine(int16_t x1, int16_t y1, int16_t x2, int16_t y2) -{ - if (x1 == x2) - { - // x1|y1 must be the upper point - if (y1 > y2) { modm::swap(y1, y2); } - this->drawVerticalLine(glcd::Point(x1, y1), y2 - y1 + 1); - } else if (y1 == y2) - { - // x1|y1 must be the left point - if (x1 > x2) { modm::swap(x1, x2); } - this->drawHorizontalLine(glcd::Point(x1, y1), x2 - x1 + 1); - } else - { - // bresenham algorithm - bool steep = abs(y2 - y1) > abs(x2 - x1); - if (steep) - { - modm::swap(x1, y1); - modm::swap(x2, y2); - } - - if (x1 > x2) - { - modm::swap(x1, x2); - modm::swap(y1, y2); - } - - int16_t deltaX = x2 - x1; - int16_t deltaY = abs(y2 - y1); - int16_t error = deltaX / 2; - - int16_t yStep; - int16_t y = y1; - - if (y1 < y2) - yStep = 1; - else - yStep = -1; - - for (int_fast16_t x = x1; x <= x2; ++x) - { - if (steep) - this->setPixel(y, x); - else - this->setPixel(x, y); - - error = error - deltaY; - - if (error < 0) - { - y += yStep; - error += deltaX; - } - } - } -} - -void -modm::GraphicDisplay::drawHorizontalLine(glcd::Point start, uint16_t length) -{ - for (int_fast16_t i = start.x; i < static_cast(start.x + length); ++i) - { - this->setPixel(i, start.y); - } -} - -void -modm::GraphicDisplay::drawVerticalLine(glcd::Point start, uint16_t length) -{ - for (int_fast16_t i = start.y; i < static_cast(start.y + length); ++i) - { - this->setPixel(start.x, i); - } -} - -void -modm::GraphicDisplay::drawRectangle(glcd::Point start, uint16_t width, uint16_t height) -{ - uint16_t x2 = start.x + width - 1; - uint16_t y2 = start.y + height - 1; - - this->drawHorizontalLine(start, width); - this->drawHorizontalLine(glcd::Point(start.x, y2), width); - this->drawVerticalLine(start, height); - this->drawVerticalLine(glcd::Point(x2, start.y), height); -} - -void -modm::GraphicDisplay::drawRoundedRectangle(glcd::Point start, uint16_t width, uint16_t height, - uint16_t radius) -{ - if (radius == 0) { this->drawRectangle(start, width, height); } - - const int16_t x = start.x; - const int16_t y = start.y; - - int16_t x1 = 0; - int16_t y1 = radius; - int16_t f = 3 - 2 * radius; - - while (x1 <= y1) - { - this->setPixel(x + radius - x1, y + radius - y1); - this->setPixel(x + radius - x1, y + height - radius + y1); - this->setPixel(x + radius - y1, y + radius - x1); - this->setPixel(x + radius - y1, y + height - radius + x1); - - this->setPixel(x + width - radius + x1, y + radius - y1); - this->setPixel(x + width - radius + x1, y + height - radius + y1); - this->setPixel(x + width - radius + y1, y + radius - x1); - this->setPixel(x + width - radius + y1, y + height - radius + x1); - - if (f < 0) - { - f += (4 * x1 + 6); - } else - { - f += (4 * (x1 - y1) + 10); - y1--; - } - x1++; - } - - this->drawHorizontalLine(glcd::Point(x + radius, y), width - (2 * radius)); - this->drawHorizontalLine(glcd::Point(x + radius, y + height), width - (2 * radius)); - this->drawVerticalLine(glcd::Point(x, y + radius), height - (2 * radius)); - this->drawVerticalLine(glcd::Point(x + width, y + radius), height - (2 * radius)); -} - -void -modm::GraphicDisplay::drawCircle(glcd::Point center, uint16_t radius) -{ - if (radius == 0) { return; } - - int16_t error = -radius; - int16_t x = radius; - int16_t y = 0; - - while (x > y) - { - this->drawCircle4(center, x, y); - this->drawCircle4(center, y, x); - - error += y; - ++y; - error += y; - - if (error >= 0) - { - --x; - error -= x; - error -= x; - } - } - this->drawCircle4(center, x, y); -} - -void -modm::GraphicDisplay::drawCircle4(glcd::Point center, int16_t x, int16_t y) -{ - const int16_t cx = center.x; - const int16_t cy = center.y; - - this->setPixel(cx + x, cy + y); - this->setPixel(cx - x, cy - y); - if (x != 0) { this->setPixel(cx - x, cy + y); } - if (y != 0) { this->setPixel(cx + x, cy - y); } -} - -void -modm::GraphicDisplay::drawEllipse(glcd::Point center, int16_t rx, int16_t ry) -{ - int32_t rx_2 = rx * rx; - int32_t ry_2 = ry * ry; - - int16_t x = 0; - int16_t y = ry; - - int32_t fx = 0; - int32_t fy = rx_2 * 2 * ry; - - int32_t p = ry_2 - (rx_2 * ry) + (rx_2 + 2) / 4; - - drawCircle4(center, x, y); - while (fx < fy) - { - x++; - fx += ry_2 * 2; - - if (p < 0) - { - p += (fx + ry_2); - } else - { - y--; - fy -= rx_2 * 2; - p += (fx + ry_2 - fy); - } - - drawCircle4(center, x, y); - } - - p = ((ry_2 * (4 * x * x + 4 * x + 1) / 2) + 2 * (rx_2 * (y - 1) * (y - 1)) - 2 * (rx_2 * ry_2) + - 1) / - 2; - - while (y > 0) - { - y--; - fy -= rx_2 * 2; - - if (p >= 0) - { - p += (rx_2 - fy); - } else - { - x++; - fx += ry_2 * 2; - p += (fx + rx_2 - fy); - } - - drawCircle4(center, x, y); - } -} - -// ---------------------------------------------------------------------------- -void -modm::GraphicDisplay::drawImage(glcd::Point start, modm::accessor::Flash image) -{ - uint8_t width = image[0]; - uint8_t height = image[1]; - - drawImageRaw(start, width, height, modm::accessor::Flash(image.getPointer() + 2)); -} - -void -modm::GraphicDisplay::drawImageRaw(glcd::Point start, uint16_t width, uint16_t height, - modm::accessor::Flash data) -{ - uint16_t rows = (height + 7) / 8; - for (uint16_t i = 0; i < width; i++) - { - for (uint16_t k = 0; k < rows; k++) - { - uint16_t byte = data[i + k * width]; - uint16_t rowHeight = height - k * 8; - if (rowHeight > 8) { rowHeight = 8; } - for (uint16_t j = 0; j < rowHeight; j++) - { - if (byte & 0x01) - this->setPixel(start.x + i, start.y + k * 8 + j); - else - this->clearPixel(start.x + i, start.y + k * 8 + j); - - byte >>= 1; - } - } - } -} diff --git a/src/modm/ui/display/graphic_display.hpp b/src/modm/ui/display/graphic_display.hpp deleted file mode 100644 index a1c708f21c..0000000000 --- a/src/modm/ui/display/graphic_display.hpp +++ /dev/null @@ -1,459 +0,0 @@ -/* - * Copyright (c) 2009-2010, Martin Rosekeit - * Copyright (c) 2009-2011, 2013, Fabian Greif - * Copyright (c) 2011, 2013, Thorsten Lajewski - * Copyright (c) 2012-2014, 2016, Niklas Hauser - * Copyright (c) 2013, Hans Schily - * Copyright (c) 2014, Daniel Krebs - * Copyright (c) 2015, Niclas Rohrer - * Copyright (c) 2021, Thomas Sommer - * - * This file is part of the modm project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -// ---------------------------------------------------------------------------- - -#ifndef MODM_GRAPHIC_DISPLAY_HPP -#define MODM_GRAPHIC_DISPLAY_HPP - -#include -#include -#include -#include - -#include -#include "font.hpp" - -namespace modm -{ - -/// @ingroup modm_ui_display -namespace glcd -{ - -/// @ingroup modm_ui_display -using Point = Vector; - -enum Orientation : uint8_t -{ - Landscape0, - Portrait90, - Landscape180, - Portrait270, -}; - -} // namespace glcd - -/** - * Base class for graphical displays. - * - * \ingroup modm_ui_display - */ - -/* - * - * Text mode: - * - left adjusted (default) - * - right adjusted - * - centered - * - * All modes relative to the current viewport. This would make - * drawing a menu system easier. - */ -class GraphicDisplay : public IOStream -{ -public: - friend class VirtualGraphicDisplay; - - GraphicDisplay(); - - virtual ~GraphicDisplay() {} - - /** - * Number of pixel in horizontal direction. - */ - virtual uint16_t - getWidth() const = 0; - - /** - * Number of pixel in vertical direction. - */ - virtual uint16_t - getHeight() const = 0; - - // TODO Requires all inherited drivers work with resumable functions - // virtual modm::ResumableResult - // setOrientation() = 0; - - /** - * Buffer-array size of first dimension - */ - virtual std::size_t - getBufferWidth() const = 0; - - /** - * Buffer-array size of second dimension - */ - virtual std::size_t - getBufferHeight() const = 0; - - /** - * Set a pixel to foregroundColor - * - * \param x x-position - * \param y y-position - */ - virtual void - setPixel(int16_t x, int16_t y) = 0; - - /** - * Set a pixel to foregroundColor - * - * \param p point - */ - inline void - setPixel(glcd::Point p) - { - this->setPixel(p.x, p.y); - } - - /** - * Set a pixel to backgroundColor - * - * \param x x-position - * \param y y-position - */ - virtual void - clearPixel(int16_t x, int16_t y) = 0; - - /** - * Set a pixel to backgroundColor - * - * \param p point - */ - inline void - clearPixel(glcd::Point p) - { - this->setPixel(p.x, p.y); - } - - /** - * Set whole screen to backgroundColor - */ - virtual void - clear() = 0; - - /** - * Transfer the content of the RAM buffer to the real display. - */ - virtual void - update() = 0; - - // TODO Requires all inherited drivers work with resumable functions - // modm::ResumableResult - // writeDisplay(); - - // TODO Set a clipping area - // Everything drawn outside this area will be discarded. - // inline void - // setClippingWindow(glcd::Point start, glcd::Point end); - - /** - * Draw a line. - * - * Uses the faster drawHorizontalLine() or drawVerticalLine() if - * possible, otherwise the line is rastered with the Bresenham line - * algorithm. - * - * \param start first point - * \param end second point - */ - inline void - drawLine(glcd::Point start, glcd::Point end) - { - this->drawLine(start.x, start.y, end.x, end.y); - } - - /** - * Draw a line - * - * \param x1 Start x-position - * \param y1 Start y-position - * \param x2 End x-position - * \param y3 End y-position - */ - void - drawLine(int16_t x1, int16_t y1, int16_t x2, int16_t y2); - - /** - * Draw a rectangle. - * - * \param start Upper left corner - * \param width Width of rectangle - * \param height Height of rectangle - */ - void - drawRectangle(glcd::Point start, uint16_t width, uint16_t height); - - /** - * Draw a rectangle. - * - * \param x Upper left corner x-position - * \param y Upper left corner y-position - * \param width Width of rectangle - * \param height Height of rectangle - */ - inline void - drawRectangle(int16_t x, int16_t y, uint16_t width, uint16_t height) - { - drawRectangle(glcd::Point(x, y), width, height); - } - - /** - * Draw a filled rectangle. - * - * \param start Upper left corner - * \param width Width of rectangle - * \param height Height of rectangle - */ - void - fillRectangle(glcd::Point start, uint16_t width, uint16_t height); - - /** - * Draw a rectangle. - * - * \param x Upper left corner x-position - * \param y Upper left corner y-position - * \param width Width of rectangle - * \param height Height of rectangle - */ - inline void - fillRectangle(int16_t x, int16_t y, uint16_t width, uint16_t height) - { - fillRectangle(glcd::Point(x, y), width, height); - } - - /** - * Draw a rectangle with rounded corners - * - * \param start Upper left corner - * \param width Width of rectangle - * \param height Height of rectangle - * \param radius Rounding radius - */ - void - drawRoundedRectangle(glcd::Point start, uint16_t width, uint16_t height, uint16_t radius); - - /** - * Draw a filled rectangle with rounded corners - * - * \param start Upper left corner - * \param width Width of rectangle - * \param height Height of rectangle - * \param radius Rounding radius - */ - // TODO Not yet implemented - // void - // fillRoundedRectangle(glcd::Point start, uint16_t width, uint16_t height, uint16_t radius); - - /** - * Draw a circle - * - * Uses the midpoint circle algorithm. - * - * \param center Center of the circle - * \param radius Radius of the circle - */ - void - drawCircle(glcd::Point center, uint16_t radius); - - /** - * Draw a filled circle. - * - * \param center Center of the circle - * \param radius Radius of the circle - */ - virtual void - fillCircle(glcd::Point center, uint16_t radius); - - /** - * Draw an ellipse. - * - * Uses a variation of the midpoint algorithm. May be improved through - * simplification of the used formula. - * - * \param center Center of the ellipse - * \param rx Radius in x-direction - * \param ry Radius in y-direction - */ - void - drawEllipse(glcd::Point center, int16_t rx, int16_t ry); - - /** - * Draw an image. - * - * The first byte in the image data specifies the with, the second - * byte the height. Afterwards the actual image data. - * - * \param start Upper left corner - * \param image Image data in Flash - * - * \see drawImage() - */ - void - drawImage(glcd::Point start, modm::accessor::Flash image); - - /** - * Draw an image. - * - * \param start Upper left corner - * \param width Image width - * \param height Image height - * \param data Image data in Flash without any size information. - */ - virtual void - drawImageRaw(glcd::Point start, uint16_t width, uint16_t height, - modm::accessor::Flash data); - - /** - * Set the cursor for text drawing. - * - * \param position Cursor position - */ - inline void - setCursor(glcd::Point position) - { - this->cursor = position; - } - - /** - * Set the cursor for text drawing. - * - * \param x Cursor x-position - * \param y Cursor y-position - */ - inline void - setCursor(int16_t x, int16_t y) - { - this->cursor = glcd::Point(x, y); - } - - /** - * Set the cursor x-position for text drawing. - * - * \param x Cursor x-position - */ - inline void - setCursorX(int16_t x) - { - this->cursor.x = x; - } - - /** - * Set the cursor y-position for text drawing. - * - * \param y Cursor y-position - */ - inline void - setCursorY(int16_t y) - { - this->cursor.y = y; - } - - inline glcd::Point - getCursor() const - { - return this->cursor; - } - - /** - * Set a new font. - * - * Default font is modm::font::FixedWidth5x8. - * - * \param newFont Active font - * \see modm::font - */ - inline void - setFont(const uint8_t *newFont) - { - this->font = modm::accessor::asFlash(newFont); - } - - inline void - setFont(const modm::accessor::Flash *font) - { - this->font = *font; - } - - /** - * Get the height of a character. - */ - uint8_t - getFontHeight() const; - - static uint8_t - getFontHeight(const modm::accessor::Flash *font); - - /** - * Get the width of (null terminated) string. - */ - uint16_t - getStringWidth(const char *s) const; - - static uint16_t - getStringWidth(const char *s, const modm::accessor::Flash *font); - - /** - * Write a single character. - */ - void - write(char c); - -protected: - /// helper method for drawCircle() and drawEllipse() - void - drawCircle4(glcd::Point center, int16_t x, int16_t y); - - virtual void - drawHorizontalLine(glcd::Point start, uint16_t length); - - virtual void - drawVerticalLine(glcd::Point start, uint16_t length); - -protected: - // Interface class for the IOStream - class Writer : public IODevice - { - public: - Writer(GraphicDisplay *parent) : parent(parent) {} - - /// Draw a single character - virtual void - write(char c); - - using IODevice::write; - - // unused - virtual void - flush(); - - // unused, returns always `false` - virtual bool - read(char &c); - - private: - GraphicDisplay *parent; - }; - -protected: - Writer writer; - modm::accessor::Flash font; - glcd::Point cursor; -}; -} // namespace modm - -#endif // MODM_GRAPHIC_DISPLAY_HPP diff --git a/src/modm/ui/display/graphic_display_fill.cpp b/src/modm/ui/display/graphic_display_fill.cpp deleted file mode 100644 index 389f8e8564..0000000000 --- a/src/modm/ui/display/graphic_display_fill.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2010-2011, 2013, Fabian Greif - * Copyright (c) 2012-2013, Niklas Hauser - * Copyright (c) 2013, Hans Schily - * Copyright (c) 2013, Thorsten Lajewski - * - * This file is part of the modm project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -// ---------------------------------------------------------------------------- - -#include "graphic_display.hpp" - -// ---------------------------------------------------------------------------- -void -modm::GraphicDisplay::fillRectangle(glcd::Point start, - uint16_t width, uint16_t height) -{ - for (uint16_t i = start.x; (i < start.x + width) && (i < getWidth()); ++i) - for (uint16_t k = start.y; (k < start.y + height) && (k < getHeight()); ++k) - this->setPixel(i, k); -} - -void -modm::GraphicDisplay::fillCircle(glcd::Point center, uint16_t radius) -{ - int16_t f = 1 - radius; - int16_t ddF_x = 0; - int16_t ddF_y = -2 * radius; - uint16_t x = 0; - uint16_t y = radius; - - this->drawVerticalLine(glcd::Point(center.x, center.y - radius), 2 * radius); - - while(x < y) - { - if (f >= 0) - { - y--; - ddF_y += 2; - f += ddF_y; - } - x++; - ddF_x += 2; - f += ddF_x + 1; - - this->drawVerticalLine(glcd::Point(center.x + x, center.y - y), 2 * y); - this->drawVerticalLine(glcd::Point(center.x + y, center.y - x), 2 * x); - this->drawVerticalLine(glcd::Point(center.x - x, center.y - y), 2 * y); - this->drawVerticalLine(glcd::Point(center.x - y, center.y - x), 2 * x); - } -} diff --git a/src/modm/ui/display/graphic_display_text.cpp b/src/modm/ui/display/graphic_display_text.cpp deleted file mode 100644 index f1e6d1d68d..0000000000 --- a/src/modm/ui/display/graphic_display_text.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2010-2011, 2013, Fabian Greif - * Copyright (c) 2012-2013, Niklas Hauser - * Copyright (c) 2014, Daniel Krebs - * - * This file is part of the modm project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -// ---------------------------------------------------------------------------- - -#include "graphic_display.hpp" - -// ---------------------------------------------------------------------------- -uint8_t -modm::GraphicDisplay::getFontHeight() const -{ - return modm::GraphicDisplay::getFontHeight(&(this->font)); -} - -uint8_t -modm::GraphicDisplay::getFontHeight(const modm::accessor::Flash *font) -{ - if (!font->isValid()) - return 0; - - return (*font)[3]; -} - -// ---------------------------------------------------------------------------- -uint16_t -modm::GraphicDisplay::getStringWidth(const char* s) const -{ - return modm::GraphicDisplay::getStringWidth(s, &(this->font)); -} - - -uint16_t -modm::GraphicDisplay::getStringWidth(const char* s, const modm::accessor::Flash *font) -{ - if (!font->isValid()) - return 0; - - const uint8_t offsetWidthTable = 8; - const uint8_t vspace = (*font)[5]; - const uint8_t first = (*font)[6]; - - uint16_t width = 0; - - while(*s) { - width += (*font)[offsetWidthTable + (static_cast(*s) - first)]; - width += vspace; - s++; - } - - return width; -} - -// ---------------------------------------------------------------------------- -void -modm::GraphicDisplay::write(char c) -{ - if (!this->font.isValid()) - return; - - const uint8_t character = static_cast(c); - const uint8_t height = font[3]; - const uint8_t hspace = font[4]; - const uint8_t vspace = font[5]; - - if (character == '\n') { - this->cursor.set(0, this->cursor.y + height + hspace); - return; - } - - const uint8_t first = font[6]; - const uint8_t count = font[7]; - - if (character >= (first + count) || character < first) { - // character is not contained in this font set - return; - } - - const uint8_t offsetWidthTable = 8; - - uint16_t offset = count + offsetWidthTable; - uint8_t position = character - first + offsetWidthTable; - const uint8_t usedRows = (height + 7) / 8; // round up - for (uint8_t i = offsetWidthTable; i < position; i++) - { - offset += font[i] * usedRows; - } - uint8_t width = font[position]; - - this->drawImageRaw(cursor, width, height, - accessor::asFlash(font.getPointer() + offset)); - - cursor.setX(cursor.x + width); - - // all characters below 128 have whitespace afterwards (number given - // by vspace). - if (character < 128) { - //color::Rgb565 oldColor = this->color; - - //this->setColor(color::html::White); - for (uint_fast8_t i = 0; i < vspace; ++i) { - //this->drawVerticalLine(cursor, height); - cursor.setX(cursor.x + 1); - } - - // restore color - //this->setColor(oldColor); - } -} - -// ---------------------------------------------------------------------------- -void -modm::GraphicDisplay::Writer::write(char c) -{ - this->parent->write(c); -} - -void -modm::GraphicDisplay::Writer::flush() -{ -} - -bool -modm::GraphicDisplay::Writer::read(char&) -{ - return false; -} diff --git a/src/modm/ui/display/image/home_16x16.pbm b/src/modm/ui/display/image/home_16x16.pbm deleted file mode 100644 index 8c559dc943..0000000000 --- a/src/modm/ui/display/image/home_16x16.pbm +++ /dev/null @@ -1,7 +0,0 @@ -P1 -# CREATOR: GIMP PNM Filter Version 1.1 -16 16 -0000000000000000000111111111100000100000000001000100000110000010010000 -1111000010010001111110001001001111111100100101100000011010010010000001 -0010010010011101001001001001110100100100100111010010010011111111001000 -1000000000010000011111111110000000000000000000 \ No newline at end of file diff --git a/src/modm/ui/display/image/logo_eurobot_90x64.pbm b/src/modm/ui/display/image/logo_eurobot_90x64.pbm deleted file mode 100644 index 897eb60614..0000000000 --- a/src/modm/ui/display/image/logo_eurobot_90x64.pbm +++ /dev/null @@ -1,86 +0,0 @@ -P1 -# CREATOR: GIMP PNM Filter Version 1.1 -90 64 -0000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000 -0000111111000000000000000000000000000000000000000000000000000000000000 -0000000000011111111111100000001111100000000000000000000000000000000000 -0000000000000000000000001111111111111111111111111100011111000000000000 -0000000000000000000000000000000000000000111111111111111111111111111111 -1110001111100000000000000000000000000000000000000000000001111111111111 -1110111111111111111111111110011110000000000000000000000000000000000000 -0000111111111111111111000111111111111101111111111001111000000000000000 -0000000000000000000000111111111111111111111011111111111110001111111111 -1001110000000000000000000000000000000000111111111101111111111111111111 -1111111101111111111111100111000000000000000000000000000000111111111110 -0011111111111111111111111111111111111111111110111000000000000000000000 -0000000111111111111101111111111111111111111111111111111111111111110111 -0000000000000000000000000111111111111111111111111111001111111111111111 -1111111101111111111110000000000000000000000011111111111111111111111111 -1100111111111111110011111100000111111111110000000000000000000001111111 -1111111111111111111111001111111111111100111111101011111111111110000000 -0000000000001111000011001100100100110000110000011110000110000011111111 -1111111111111100000000000000000111100110010011001000001000000100000011 -0000001000001111111111111111111111100000000000000011111001100100110010 -0011001110010011001001110011001111111111111111111111111000000000000001 -1111100000010011001001110011100100110010011100110011111111111111101111 -1111110000000000001111111001111100110010011100111001001100100111001100 -1111111111110000000111111100000000000011111110011111001000100111001110 -0100110010011100110011111111111111000111111111100000000001111111110000 -0110001010011110000011000001110000011100001111111111100100111111111000 -0000001111111111111111111111111111111111111111111111111111111111111111 -1101111011111111100000000011111111111111111111111111111111111111111111 -1111111111111111111111111111111111111000000000111111111111111111111111 -1111111111111111111111111111111111111111111111111111111110000000011111 -1111111111111111111111111111111111111111111111111111111111111110111111 -1111111000000001111111111111111111110111111111111111110000001111111111 -1111111111111001111111111110000000011111111111111111111100111111111111 -1110000000011111111111111111110000000001111111100000000111111111111111 -1111110001111111111111101000000111111111111111111111000001111111111000 -0000111111111111111111111100001111111111111011000001111111111111111111 -1101110111111111100000001111100011111111111111000001111111111110111000 -0011111111111111111110111110111111111000000011000000111111111111110000 -0011111111111001100000111111111111110111111111111111111110000000110000 -0011111111111111000000000000000000011000001111111111111000111111111111 -1111110000000111000000011111111111110000000000000000001110000011111111 -1000000000001111111111111100000001110000000111111111000000000000000000 -0001010000011111111111110000011111111111111110000000011110000001100000 -0000000000000000000000110000000111111111111000100011111111111111100000 -0001111000000000000000000000000000000000011110001111111111111100111110 -0111111111111100000000011110000001110000000000000000000000001111111111 -1111111111111111111111111111111101000000000111100000001111100000000000 -0000000000111111111111111111111111111111111111111110100000000000111000 -0000111111110000000000000000000111111110000001111111111111111111111111 -0100000000000011110000001111111111100000000000000000111111000000001111 -1111111111111111111010000000000000111100000011111111111100000000000000 -0001110000000000011111111111111111111101000000000000001111000011111111 -1111110000000000000000001100000000000011111111111111111110100000000000 -0000011111111111111111111100000000000000000001001110000000111111111111 -1111100100000000000000000111111111111111111110000000001111000000000111 -1110000011111111111111110010000000000000000001110001111111111111100000 -0001111111100000001111100000111111111111110011000000000000000000000000 -0011111111111110000000111111111110000000011100001111111111110011000000 -0000000000000000000000001111100011100000011111111111111100000111000011 -1111111100111000000000000000000000000000000001100000011000001111111111 -1111111001111100011111111000111000000000000000000000000000000000000000 -0000100001100111111111111111000110001111100001111000000000000000000000 -0000000000000000000000000000111110000001111111111100000100000111111000 -0000000000000000000000000000000000000000000000001111111111100000000000 -0000001111111110000000000000000000000000000000000000010000000000000111 -1111111111111111111111111111111100000000000000000000000000000000000000 -0011001100000000011111111111111111111111111111110000000000000000000000 -0000000000000000000000111011100000000000011111111111111111111111000000 -0000000000000000000000000000000000000000000110111100000000000000000001 -1111100000000000000000000000000000000000000000000000000000000001110111 -1000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000011011110000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000111011110000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000111011100000000 -0000000000000000000000000000000000000000000000000000000000000000000000 -0000011110000001000000000000000000000000000000000000000000000000000000 -0000000000000000000000000011110000100000000000000000000000000000000000 -0000000000000000000000000000000000000000000000011111110000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000001 -1110000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000 \ No newline at end of file diff --git a/src/modm/ui/display/image/logo_rca_90x64.pbm b/src/modm/ui/display/image/logo_rca_90x64.pbm deleted file mode 100644 index 8235011dc6..0000000000 --- a/src/modm/ui/display/image/logo_rca_90x64.pbm +++ /dev/null @@ -1,86 +0,0 @@ -P1 -# CREATOR: GIMP PNM Filter Version 1.1 -90 64 -0000111111111111111111111111111111111111111111111111111111111111111111 -1111111111111111000000111111111111111111111111111111111111111111111111 -1111111111111111111111111111111111111100011110000000000000000000000000 -0000000000000000000000000000000000000000000000000000000111100110000000 -0001111111111100000000000000001111111111000000000000011111111110000000 -0000000110111000000000011111111111111000000000001111111111111100000000 -0001111111111000000000000001111100000000000111111111111111000000000111 -1111111111111000000000011111111110000000000000001111000000000001111111 -1111111110000000011111111111111110000000001111111111110000000000000011 -1100000000000111111100111111100000000111111100111111100000000011111111 -1111000000000000001111000000000001111111001111111000000001111111001111 -1110000000001111111111110000000000000011110000000000011111110011111110 -0000000111111100111111100000000011111111111100000000000000111100000000 -0001111111001111111000000001111111001111111000000001111111111111100000 -0000000011110000000000011111110011111110000000011111110011111110000000 -0111111111111110000000000000111100000000000111111100111111100000000111 -1111001111111000000001111111111111100000000000001111000000000001111111 -0011111110000000011111110011111110000000011111100111111000000000000011 -1100000000000111111111111111000000000111111100000000000000000111111001 -1111100000000000001111000000000001111111111111100000000001111111000000 -0000000000011111100111111000000000000011110000000000011111111111111100 -0000000111111100000000000000000111111001111110000000000000111100000000 -0001111111111111111000000001111111001111111000000011111110011111110000 -0000000011110000000000011111110011111110000000011111110011111110000000 -1111111111111111000000000000111100000000000111111100111111100000000111 -1111001111111000000011111111111111110000000000001111000000000001111111 -0011111110000000011111110011111110000000111111111111111100000000000011 -1100000000000111111100111111100000000111111100111111100000001111111111 -1111110000000000001111000000000001111111001111111000000001111111111111 -1110000000111111100111111100000000000011110000000000011111110011111110 -0000000111111111111111100000001111111001111111000000000000111100000000 -0001111111001111111000000000111111111111110000000011111110011111110000 -0000000011110000000000011111110011111110000000000011111111110000000000 -1111111001111111000000000000111100000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000001111111111111111111111 -1111111111111111111111111111111111111111111111111111111111111111111111 -1100000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000001111000110000001000000010000000000000100000010000001 -0000000000100000000000000000010100000011110001010000010000000100000000 -0000010000001000001010000000001000000000000000000101000000111100010100 -1001100010011001001000110100101011000010101110011011000100010000010001 -0100000011110001100101010101010100101011010001001010101000111000101000 -1010101010100010100101000000111100010101010101010101001110100100010010 -1010100010101110100010101100101000110001010000001111000101010101010101 -0100100010010001001010101000101010101000101010001010001000010100000011 -1100010100100110001000100100100011001001101100001010111001101010010010 -1000010100100100001111000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000011111111111111111111111111111111 -1111111111111111111111111111111111111111111111111111111111111100000000 -0000000000000000000100000000000000000000000000000010000000000000000000 -0000000011110000000000000000000000000001000000000000000000000000000000 -1001111111111111111111111100111100000000000000000011110000010000000000 -0000000000000000000010010000000000000000000001001111000000000000000000 -1000100001000000000011111000000000000000100100110111001001100111010011 -1100000000000000000010000100010000000000111111000000000000001001010000 -1001010101001001001111111111111111111111100001000100000000000111111000 -0000000000100100100010010101100010010011110000000000000000001000010001 -0000000000001111110000000000001001000100100111010100100100111100111111 -1000000000100001111100000000000001111100000000000010010110001001010101 -0010010011110010000010001110001000010001000000000000001111000000000000 -1001000000000000000000000100111111100000111111111110000100010000000000 -0000111100000000000010011111111111111111111111001111001000001000111000 -1000010001000000000000001111000000000000100000000000001000000000000011 -1100111111100001000010001000010011000000000011110000000000001000000000 -0000100000000000001111000000000000010000111100000100111000000000111110 -0000000000100000000000110110000000000011110000000000000100000000000001 -0011110000000011111100000000001000000000110000011000000000111100000000 -0011111110000000000100111110000001111111100000000010000000110000000001 -1000000011110000000000000000000000000001001111111111111111111100000000 -1000001100100000010001100000111100000000001111111000000000010001111111 -1111111111111000000010001100000001101010000110001111000000000000010000 -0000000001000011111111111111111111000000101100000010000010100000011111 -1100000000000001000000000000010000011111111111100111111000001000110000 -1001101010000110001111000000000000010000000000000100000000000111111000 -1111110000100000110001000001000110000011110000000000001110000000000001 -0000000000001111110001111110001000000011000000000110000000111111111111 -1111111111111111111100000000000001111110001111110010000000001100000110 -0000000111011000000000001110000000000001000000000000001111110001111110 -1000000000001101100000000001100111100000000000000000000000010000000000 -0000011111100011111110000000000000100000000001111000111111111111111111 -1111111111111111111111111111111111111111111111111111111111111111111100 -0000111111111111111111111111111111111111111111111111111111111111111111 -11111111111111110000 \ No newline at end of file diff --git a/src/modm/ui/display/image/skull_64x64.pbm b/src/modm/ui/display/image/skull_64x64.pbm deleted file mode 100644 index d7493b9f75..0000000000 --- a/src/modm/ui/display/image/skull_64x64.pbm +++ /dev/null @@ -1,62 +0,0 @@ -P1 -# CREATOR: GIMP PNM Filter Version 1.1 -64 64 -0000000000000000000000000001111111111100000000000000000000000000000000 -0000000000000000011111111111111111110000000000000000000000000000000000 -0000000011111000000000000000111110000000000000000000000000000000000000 -1111000000000000000000000111100000000000000000000000000000000001100000 -0000000000000000000001110000000000000000000000000000000111000000000000 -0000000000000000011000000000000000000000000000000110000000000000000000 -0000000000001100000000000000000000000000001100000000000000000000000000 -0000000110000000000000000000000000011000000000000000000000000000000000 -0011000000000000000000000000110000000000000000000000000000000000001100 -0000000000000000000000110000000000000000000000000000000000000110000000 -0000000000000000100000000000000000000000000000000000000110000000000000 -0000000001100000000000000000000000000000000000000011000000000000000000 -0001100000000000000000000000000000000000000011000000000000000000000100 -0100000000000000000000000000000000010011000000000000000000000100010000 -0000000000000000000000000000010001000000000000000000000100110000000000 -0000000000000000000000011001000000000000000000000100110000000000000000 -0000000000000000011001000000000000000000000100010000000000000000000000 -0000000000010001000000000000000000000100010000000000000000000000000000 -0000010001000000000000000000000110011000000000000000000000000000000011 -0011000000000000000000000110011000000000000000000000000000000011001100 -0000000000000000000110001000000000000000000000000000000010001100000000 -0000000000000011001000000000000000000000000000000010011000000000000000 -0000000011001000011111111000000011111111000010011000000000000000000000 -0001101001111111111000000011111111100010110000000000000000000000000111 -1001111111111000000011111111110011110000000000000000000000000011100111 -1111111000000011111111110011100000000000000000000000000001100111111111 -1000000011111111110011000000000000000000000000000001100111111111000000 -0011111111110011000000000000000001111000000001100011111111000000000111 -1111100011000000001000000001101100000001000011111110000000000011111110 -0001000000111110000001000110000001000001111100000101000001111100000100 -0000110110000011000110000001000000011000001101100000110000000100000110 -0010000011000011000001100000000000011101100000000000001100001100001000 -0111000001110001100000000000011101110000000000001100001100001000111000 -0000111100110000000000011101110000000000011000111000001100110000000000 -1111111000000000011101110000000001111001100000000110100000000000001111 -1111100000011101110000000111111111000000000011111111110000000011111111 -0000011101110000011111111100000000000001011111111100000000011111100001 -1000110000111111110000000011111111000000000111000000011001100000000000 -0000101011000000001111111110000000000001111000001010110000000000000110 -1011000000111000000000000000000000011110001010110000000000000110111000 -0011100000000000000000000000000111101100011111000111111101011000111100 -0000000000000000000000000001111101001010111010100001011011110000000000 -0000000000000000000000011001011010101010100101011111000000000000000000 -0000000000000000001001001110101010111101011100000000000000000000000000 -0000000000011001101010111111101010011000000000000000000000000000000000 -0001111100111010101010000110011100000000000000000000000000000000011100 -1100001110101010111000011111000000000000000000000000000001111000110000 -0001111111000000011011110000000000000000000111111111000000011000000000 -0000000000110000011100000000000000001111111100000000111000000000000000 -0001111000000111111111000000001000000000000011111100000000000000001111 -1110000001111111100000001100000000000111000111000000000000011100011100 -0000000000100000000110000000011100000011110000000001111000000111000000 -0001100000000011000001110000000000111111111111100000000001110000001100 -0000000011000011000000000000000001110000000000000000011000011000000000 -0001000010000000000000000000000000000000000000001000010000000000000100 -0110000000000000000000000000000000000000001100010000000000000110110000 -0000000000000000000000000000000000000110110000000000000111100000000000 -0000000000000000000000000000000011100000000000000000000000000000000000 -000000000000000000000000000000000000 \ No newline at end of file diff --git a/src/modm/ui/display/module.lb b/src/modm/ui/display/module.lb deleted file mode 100644 index e4918ec448..0000000000 --- a/src/modm/ui/display/module.lb +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# -# Copyright (c) 2018, Niklas Hauser -# -# This file is part of the modm project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# ----------------------------------------------------------------------------- - -def init(module): - module.name = ":ui:display" - module.description = """\ -# Display Graphics - -Code for writing and drawing on character and graphical displays. - -## Coordinate System - -``` -(0, 0) - +---------------------+ - | ----> X | - | | | - | | | - | V Y | - | | - | | - | | - +---------------------+ - e.g. (127, 63) -``` - -The size (width and height) of a graphics primitive always correspond -to its mathematical model, ignoring the rendered with. As everything -is drawn one pixel wide, the pixels will be rendered to the right and -below the mathematically defined points. -""" - -def prepare(module, options): - module.depends( - ":architecture:accessor", - ":io", - ":math:geometry", - ":math:utils", - ":ui:color") - return True - -def build(env): - env.outbasepath = "modm/src/modm/ui/display" - env.copy(".", ignore=env.ignore_files("*.font", "*.pbm")) - env.copy("../display.hpp") diff --git a/src/modm/ui/display/monochrome_graphic_display.hpp b/src/modm/ui/display/monochrome_graphic_display.hpp deleted file mode 100644 index 599827de52..0000000000 --- a/src/modm/ui/display/monochrome_graphic_display.hpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2009, Georgi Grinshpun - * Copyright (c) 2009-2011, 2013, 2019, Fabian Greif - * Copyright (c) 2010, Martin Rosekeit - * Copyright (c) 2011, Thorsten Lajewski - * Copyright (c) 2012-2015, Niklas Hauser - * Copyright (c) 2021, Thomas Sommer - * - * This file is part of the modm project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#ifndef MODM_MONOCHROME_GRAPHIC_DISPLAY_HPP -#define MODM_MONOCHROME_GRAPHIC_DISPLAY_HPP - -#include - -#include "graphic_display.hpp" - -namespace modm -{ -/** - * Base class for monochrome graphical displays with a RAM buffer. - * - * Every operation works on the internal RAM buffer, therefore the content - * of the real display is not changed until a call of update(). - * - * \tparam Width Horizontal number of Pixels - * \tparam Height Vertical number of Pixels - * \tparam BufferWidth Horizontal (first) dimension of Buffer - * \tparam BufferHeight Vertical (first) dimension of Buffer - * - * \author Thomas Sommer - * \ingroup modm_ui_display - */ -template -class MonochromeGraphicDisplay : public GraphicDisplay -{ - static_assert(Width > 0, "width must be greater than 0"); - static_assert(Height > 0, "height must be greater than 0"); - -public: - virtual ~MonochromeGraphicDisplay() = default; - - inline uint16_t - getWidth() const final - { - return Width; - } - - inline uint16_t - getHeight() const final - { - return Height; - } - - inline std::size_t - getBufferWidth() const final - { - return BufferWidth; - } - - inline std::size_t - getBufferHeight() const final - { - return BufferHeight; - } - - virtual bool - getPixel(int16_t x, int16_t y) const = 0; - - void - clear() final; - -protected: - uint8_t buffer[BufferHeight][BufferWidth]; -}; -} // namespace modm - -#include "monochrome_graphic_display_impl.hpp" - -#endif // MODM_MONOCHROME_GRAPHIC_DISPLAY_HPP \ No newline at end of file diff --git a/src/modm/ui/display/monochrome_graphic_display_horizontal.hpp b/src/modm/ui/display/monochrome_graphic_display_horizontal.hpp deleted file mode 100644 index 43ce0be339..0000000000 --- a/src/modm/ui/display/monochrome_graphic_display_horizontal.hpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2019, Fabian Greif - * - * This file is part of the modm project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#ifndef MODM_MONOCHROME_GRAPHIC_DISPLAY_HORIZONTAL_HPP -#define MODM_MONOCHROME_GRAPHIC_DISPLAY_HORIZONTAL_HPP - -#include - -#include "monochrome_graphic_display.hpp" - -namespace modm -{ -/** - * Base class for monochrome graphical displays with a RAM buffer. - * - * The pixel are compressed horizontally, this means that 8 pixel in - * y-direction are combined into one byte in the RAM buffer. - * - * Every operation works on the internal RAM buffer, therefore the content - * of the real display is not changed until a call of update(). - * - * \tparam Width Width of the display. Must be a multiple of 8! - * \tparam Height Height of the display. - * - * \ingroup modm_ui_display - */ -template -class MonochromeGraphicDisplayHorizontal - : public MonochromeGraphicDisplay -{ - // Height must be a multiple of 8 - static_assert((Width % 8) == 0, "width must be a multiple of 8"); - -public: - virtual ~MonochromeGraphicDisplayHorizontal() = default; - -protected: - void - setPixel(int16_t x, int16_t y) final; - - void - clearPixel(int16_t x, int16_t y) final; - - bool - getPixel(int16_t x, int16_t y) const final; -}; -} // namespace modm - -#include "monochrome_graphic_display_horizontal_impl.hpp" - -#endif // MODM_MONOCHROME_GRAPHIC_DISPLAY_HORIZONTAL_HPP diff --git a/src/modm/ui/display/monochrome_graphic_display_horizontal_impl.hpp b/src/modm/ui/display/monochrome_graphic_display_horizontal_impl.hpp deleted file mode 100644 index 41fe64fd38..0000000000 --- a/src/modm/ui/display/monochrome_graphic_display_horizontal_impl.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2019, Fabian Greif - * - * This file is part of the modm project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#ifndef MODM_MONOCHROME_GRAPHIC_DISPLAY_HORIZONTAL_HPP -#error "Don't include this file directly, use 'monochrome_graphic_display_horizontal.hpp' instead!" -#endif - -namespace modm -{ -template -void -MonochromeGraphicDisplayHorizontal::setPixel(int16_t x, int16_t y) -{ - if ((x < Width) and (y < Height)) { buffer[y][x / 8] |= (1 << (x % 8)); } -} - -template -void -MonochromeGraphicDisplayHorizontal::clearPixel(int16_t x, int16_t y) -{ - if ((x < Width) and (y < Height)) { buffer[y][x / 8] &= ~(1 << (x % 8)); } -} - -template -bool -MonochromeGraphicDisplayHorizontal::getPixel(int16_t x, int16_t y) -{ - if ((x < Width) and (y < Height)) - return (buffer[y][x / 8] & (1 << (x % 8))); - else - return false; -} -} // namespace modm diff --git a/src/modm/ui/display/monochrome_graphic_display_impl.hpp b/src/modm/ui/display/monochrome_graphic_display_impl.hpp deleted file mode 100644 index 14900c6944..0000000000 --- a/src/modm/ui/display/monochrome_graphic_display_impl.hpp +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2009-2011, 2013, 2019, Fabian Greif - * Copyright (c) 2011, Martin Rosekeit - * Copyright (c) 2012-2013, Niklas Hauser - * Copyright (c) 2016, Antal Szabó - * Copyright (c) 2021, Thomas Sommer - * - * This file is part of the modm project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#include - -#ifndef MODM_MONOCHROME_GRAPHIC_DISPLAY_HPP -#error "Don't include this file directly, use 'monochrome_graphic_display.hpp' instead!" -#endif - -template -void -modm::MonochromeGraphicDisplay::clear() -{ - std::fill(&buffer[0][0], &buffer[0][0] + sizeof(buffer), 0); - this->cursor = {0, 0}; -} \ No newline at end of file diff --git a/src/modm/ui/display/monochrome_graphic_display_vertical.hpp b/src/modm/ui/display/monochrome_graphic_display_vertical.hpp deleted file mode 100644 index 3377d476b9..0000000000 --- a/src/modm/ui/display/monochrome_graphic_display_vertical.hpp +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2009, Georgi Grinshpun - * Copyright (c) 2009-2011, 2013, 2019, Fabian Greif - * Copyright (c) 2010, Martin Rosekeit - * Copyright (c) 2011, Thorsten Lajewski - * Copyright (c) 2012-2015, Niklas Hauser - * Copyright (c) 2021, Thomas Sommer - * - * This file is part of the modm project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#ifndef MODM_MONOCHROME_GRAPHIC_DISPLAY_VERTICAL_HPP -#define MODM_MONOCHROME_GRAPHIC_DISPLAY_VERTICAL_HPP - -#include - -#include "monochrome_graphic_display.hpp" - -namespace modm -{ -/** - * Base class for graphical displays with a RAM buffer. - * - * Every operation works on the internal RAM buffer, therefore the content - * of the real display is not changed until a call of update(). - * - * \tparam Width Width of the display. - * \tparam Height Height of the display. Must be a multiple of 8! - * - * \author Fabian Greif - * \ingroup modm_ui_display - */ -template -class MonochromeGraphicDisplayVertical - : public MonochromeGraphicDisplay -{ - static_assert((Height % 8) == 0, "height must be a multiple of 8"); - -public: - virtual ~MonochromeGraphicDisplayVertical() = default; - - // Faster version adapted for the RAM buffer - void - drawImageRaw(glcd::Point start, uint16_t width, uint16_t height, - modm::accessor::Flash data) final; - - void - setPixel(int16_t x, int16_t y) final; - - void - clearPixel(int16_t x, int16_t y) final; - - bool - getPixel(int16_t x, int16_t y) const final; - -protected: - // Faster version adapted for the RAM buffer - void - drawHorizontalLine(glcd::Point start, uint16_t length) final; - - // Faster version adapted for the RAM buffer - void - drawVerticalLine(glcd::Point start, uint16_t length) final; -}; -} // namespace modm - -#include "monochrome_graphic_display_vertical_impl.hpp" - -#endif // MODM_MONOCHROME_GRAPHIC_DISPLAY_VERTICAL_HPP diff --git a/src/modm/ui/display/monochrome_graphic_display_vertical_impl.hpp b/src/modm/ui/display/monochrome_graphic_display_vertical_impl.hpp deleted file mode 100644 index aefaeaec81..0000000000 --- a/src/modm/ui/display/monochrome_graphic_display_vertical_impl.hpp +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2009-2011, 2013, 2019, Fabian Greif - * Copyright (c) 2011, Martin Rosekeit - * Copyright (c) 2012-2013, Niklas Hauser - * Copyright (c) 2016, Antal Szabó - * Copyright (c) 2021, Thomas Sommer - * - * This file is part of the modm project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#ifndef MODM_MONOCHROME_GRAPHIC_DISPLAY_VERTICAL_HPP -#error "Don't include this file directly, use 'monochrome_graphic_display_vertical.hpp' instead!" -#endif - -template -void -modm::MonochromeGraphicDisplayVertical::drawHorizontalLine(glcd::Point start, - uint16_t length) -{ - if (start.y >= 0 and start.y < Height) - { - const int16_t y = start.y / 8; - - const uint8_t byte = 1 << (start.y % 8); - for (int_fast16_t x = start.x; x < static_cast(start.x + length); ++x) - { - if (x < Width) { this->buffer[y][x] |= byte; } - } - } -} - -template -void -modm::MonochromeGraphicDisplayVertical::drawVerticalLine(glcd::Point start, - uint16_t length) -{ - if (start.x >= 0 and start.x < Width) - { - const int8_t end_y = start.y + length; - const uint8_t y_last = end_y / 8; - - uint_fast8_t y = start.y / 8; - // Mask out start - uint_fast8_t byte = 0xFF << start.y % 8; - while (y != y_last) - { - if (y < Height / 8) - { - this->buffer[y][start.x] |= byte; - byte = 0xFF; - } - y++; - } - // Mask out end - if (y < Height / 8) - { - byte &= 0xFF >> (8 - end_y % 8); - this->buffer[y][start.x] |= byte; - } - } -} - -template -void -modm::MonochromeGraphicDisplayVertical::drawImageRaw( - glcd::Point start, uint16_t width, uint16_t height, modm::accessor::Flash data) -{ - if ((start.y % 8) == 0) - { - uint16_t row = start.y / 8; - uint16_t rowCount = (height + 7) / 8; // always round up - - if ((height % 8) == 0) - { - for (uint_fast16_t i = 0; i < width; i++) - { - for (uint_fast16_t k = 0; k < rowCount; k++) - { - uint16_t x = start.x + i; - uint16_t y = k + row; - - if (x < Width and y < Height) - { - this->buffer[y][x] = data[i + k * width]; - } - } - } - return; - } - } - - GraphicDisplay::drawImageRaw(start, width, height, data); -} - -template -void -modm::MonochromeGraphicDisplayVertical::setPixel(int16_t x, int16_t y) -{ - if (x < Width and y < Height) { this->buffer[y / 8][x] |= (1 << y % 8); } -} - -template -void -modm::MonochromeGraphicDisplayVertical::clearPixel(int16_t x, int16_t y) -{ - if (x < Width and y < Height) { this->buffer[y / 8][x] &= ~(1 << y % 8); } -} - -template -bool -modm::MonochromeGraphicDisplayVertical::getPixel(int16_t x, int16_t y) const -{ - if (x < Width and y < Height) - { - return (this->buffer[y / 8][x] & (1 << y % 8)); - } else - { - return false; - } -} \ No newline at end of file diff --git a/src/modm/ui/display/virtual_graphic_display.cpp b/src/modm/ui/display/virtual_graphic_display.cpp deleted file mode 100644 index 936629c168..0000000000 --- a/src/modm/ui/display/virtual_graphic_display.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2013, Kevin Läufer - * Copyright (c) 2013, Thorsten Lajewski - * - * This file is part of the modm project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -// ---------------------------------------------------------------------------- - -#include "virtual_graphic_display.hpp" - -modm::VirtualGraphicDisplay::VirtualGraphicDisplay(modm::ColorGraphicDisplay* display, - modm::glcd::Point leftUpper, modm::glcd::Point rightLower): - display(display), leftUpper(leftUpper), rightLower(rightLower), - width(static_cast(this->rightLower[0] - this->leftUpper[0])), - height(static_cast(this->rightLower[1] - this->leftUpper[1])) -{ -} - -void -modm::VirtualGraphicDisplay::setDisplay(modm::ColorGraphicDisplay* display) -{ - this->display = display; - return; -} - -void -modm::VirtualGraphicDisplay::clear() -{ - //TODO switch black , white - this->display->setColor(color::Rgb(0, 0, 0)); - this->display->fillRectangle(this->leftUpper, width, height); - this->display->setColor(color::Rgb(255, 255, 255)); -} - -void -modm::VirtualGraphicDisplay::update() -{ - this->display->update(); - return; -} - -void -modm::VirtualGraphicDisplay::setPixel(int16_t x, int16_t y) -{ - this->display->setPixel(x + this->leftUpper[0], y + this->leftUpper[1]); -} - -void -modm::VirtualGraphicDisplay::clearPixel(int16_t x, int16_t y) -{ - this->display->clearPixel(x + this->leftUpper[0], y + this->leftUpper[1] ); -} - -modm::color::Rgb565 -modm::VirtualGraphicDisplay::getPixel(int16_t x, int16_t y) const -{ - return this->display->getPixel(x + this->leftUpper[0], y + this->leftUpper[1] ); -} \ No newline at end of file diff --git a/src/modm/ui/display/virtual_graphic_display.hpp b/src/modm/ui/display/virtual_graphic_display.hpp deleted file mode 100644 index 5d8b9d4b2d..0000000000 --- a/src/modm/ui/display/virtual_graphic_display.hpp +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2009-2010, Fabian Greif - * Copyright (c) 2009-2010, Martin Rosekeit - * Copyright (c) 2012, 2014, Niklas Hauser - * Copyright (c) 2013, Kevin Läufer - * Copyright (c) 2013, Thorsten Lajewski - * - * This file is part of the modm project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -// ---------------------------------------------------------------------------- - -#ifndef MODM_VIRTUAL_GRAPHIC_DISPLAY -#define MODM_VIRTUAL_GRAPHIC_DISPLAY - -#include - -namespace modm -{ -/// @ingroup modm_ui_display -class VirtualGraphicDisplay : public modm::ColorGraphicDisplay -{ -public: - VirtualGraphicDisplay(modm::ColorGraphicDisplay* display, modm::glcd::Point leftUpper, - modm::glcd::Point rightLower); - - void - setDisplay(modm::ColorGraphicDisplay* display); - - virtual inline uint16_t - getWidth() const - { - return this->width; - } - - virtual inline uint16_t - getHeight() const - { - return this->height; - } - - virtual void - clear(); - - virtual void - update(); - -protected: - void - setPixel(int16_t x, int16_t y) final; - - void - clearPixel(int16_t x, int16_t y) final; - - color::Rgb565 - getPixel(int16_t x, int16_t y) const final; - -private: - modm::ColorGraphicDisplay* display; - modm::glcd::Point leftUpper; - modm::glcd::Point rightLower; - const uint16_t width; - const uint16_t height; -}; - -} // namespace modm - -#endif // MODM_VIRTUAL_GRAPHIC_DISPLAY diff --git a/src/modm/ui/display/font.hpp b/src/modm/ui/font.hpp similarity index 100% rename from src/modm/ui/display/font.hpp rename to src/modm/ui/font.hpp diff --git a/src/modm/ui/display/font/SConscript.generate b/src/modm/ui/font/SConscript.generate similarity index 100% rename from src/modm/ui/display/font/SConscript.generate rename to src/modm/ui/font/SConscript.generate diff --git a/src/modm/ui/display/font/all_caps_3x5.cpp b/src/modm/ui/font/all_caps_3x5.cpp similarity index 100% rename from src/modm/ui/display/font/all_caps_3x5.cpp rename to src/modm/ui/font/all_caps_3x5.cpp diff --git a/src/modm/ui/display/font/all_caps_3x5.hpp b/src/modm/ui/font/all_caps_3x5.hpp similarity index 100% rename from src/modm/ui/display/font/all_caps_3x5.hpp rename to src/modm/ui/font/all_caps_3x5.hpp diff --git a/src/modm/ui/display/font/arcade_classic.cpp b/src/modm/ui/font/arcade_classic.cpp similarity index 100% rename from src/modm/ui/display/font/arcade_classic.cpp rename to src/modm/ui/font/arcade_classic.cpp diff --git a/src/modm/ui/display/font/arcade_classic.hpp b/src/modm/ui/font/arcade_classic.hpp similarity index 100% rename from src/modm/ui/display/font/arcade_classic.hpp rename to src/modm/ui/font/arcade_classic.hpp diff --git a/src/modm/ui/display/font/assertion.cpp b/src/modm/ui/font/assertion.cpp similarity index 100% rename from src/modm/ui/display/font/assertion.cpp rename to src/modm/ui/font/assertion.cpp diff --git a/src/modm/ui/display/font/assertion.hpp b/src/modm/ui/font/assertion.hpp similarity index 100% rename from src/modm/ui/display/font/assertion.hpp rename to src/modm/ui/font/assertion.hpp diff --git a/src/modm/ui/display/font/fixed_width_5x8.cpp b/src/modm/ui/font/fixed_width_5x8.cpp similarity index 100% rename from src/modm/ui/display/font/fixed_width_5x8.cpp rename to src/modm/ui/font/fixed_width_5x8.cpp diff --git a/src/modm/ui/display/font/fixed_width_5x8.hpp b/src/modm/ui/font/fixed_width_5x8.hpp similarity index 100% rename from src/modm/ui/display/font/fixed_width_5x8.hpp rename to src/modm/ui/font/fixed_width_5x8.hpp diff --git a/src/modm/ui/font/font.lb b/src/modm/ui/font/font.lb new file mode 100644 index 0000000000..592c6ebc13 --- /dev/null +++ b/src/modm/ui/font/font.lb @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Copyright (c) 2021, Thomas Sommer +# +# This file is part of the modm project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# ----------------------------------------------------------------------------- + +def init(module): + module.name = ":ui:font" + module.description = """ +# Font + +Various Fonts to be written on graphic-displays +""" + +def prepare(module, options): + return True + +def build(env): + env.outbasepath = "modm/src/modm/ui/font" + env.copy(".") + env.copy("../font.hpp") diff --git a/src/modm/ui/display/font/matrix_8x8.cpp b/src/modm/ui/font/matrix_8x8.cpp similarity index 100% rename from src/modm/ui/display/font/matrix_8x8.cpp rename to src/modm/ui/font/matrix_8x8.cpp diff --git a/src/modm/ui/display/font/matrix_8x8.hpp b/src/modm/ui/font/matrix_8x8.hpp similarity index 100% rename from src/modm/ui/display/font/matrix_8x8.hpp rename to src/modm/ui/font/matrix_8x8.hpp diff --git a/src/modm/ui/display/font/numbers_14x32.cpp b/src/modm/ui/font/numbers_14x32.cpp similarity index 100% rename from src/modm/ui/display/font/numbers_14x32.cpp rename to src/modm/ui/font/numbers_14x32.cpp diff --git a/src/modm/ui/display/font/numbers_14x32.hpp b/src/modm/ui/font/numbers_14x32.hpp similarity index 100% rename from src/modm/ui/display/font/numbers_14x32.hpp rename to src/modm/ui/font/numbers_14x32.hpp diff --git a/src/modm/ui/display/font/numbers_40x56.cpp b/src/modm/ui/font/numbers_40x56.cpp similarity index 100% rename from src/modm/ui/display/font/numbers_40x56.cpp rename to src/modm/ui/font/numbers_40x56.cpp diff --git a/src/modm/ui/display/font/numbers_40x56.hpp b/src/modm/ui/font/numbers_40x56.hpp similarity index 100% rename from src/modm/ui/display/font/numbers_40x56.hpp rename to src/modm/ui/font/numbers_40x56.hpp diff --git a/src/modm/ui/display/font/numbers_46x64.cpp b/src/modm/ui/font/numbers_46x64.cpp similarity index 100% rename from src/modm/ui/display/font/numbers_46x64.cpp rename to src/modm/ui/font/numbers_46x64.cpp diff --git a/src/modm/ui/display/font/numbers_46x64.hpp b/src/modm/ui/font/numbers_46x64.hpp similarity index 100% rename from src/modm/ui/display/font/numbers_46x64.hpp rename to src/modm/ui/font/numbers_46x64.hpp diff --git a/src/modm/ui/display/font/scripto_narrow.cpp b/src/modm/ui/font/scripto_narrow.cpp similarity index 100% rename from src/modm/ui/display/font/scripto_narrow.cpp rename to src/modm/ui/font/scripto_narrow.cpp diff --git a/src/modm/ui/display/font/scripto_narrow.hpp b/src/modm/ui/font/scripto_narrow.hpp similarity index 100% rename from src/modm/ui/display/font/scripto_narrow.hpp rename to src/modm/ui/font/scripto_narrow.hpp diff --git a/src/modm/ui/display/font/ubuntu_36.cpp b/src/modm/ui/font/ubuntu_36.cpp similarity index 100% rename from src/modm/ui/display/font/ubuntu_36.cpp rename to src/modm/ui/font/ubuntu_36.cpp diff --git a/src/modm/ui/display/font/ubuntu_36.hpp b/src/modm/ui/font/ubuntu_36.hpp similarity index 100% rename from src/modm/ui/display/font/ubuntu_36.hpp rename to src/modm/ui/font/ubuntu_36.hpp diff --git a/src/modm/ui/display.hpp b/src/modm/ui/graphic.hpp similarity index 70% rename from src/modm/ui/display.hpp rename to src/modm/ui/graphic.hpp index c54170c96d..ba83eb4566 100644 --- a/src/modm/ui/display.hpp +++ b/src/modm/ui/graphic.hpp @@ -12,9 +12,9 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "display/font.hpp" -#include "display/image.hpp" +#include "font.hpp" +#include "shape.hpp" +#include "color.hpp" -#include "display/character_display.hpp" -#include "display/color_graphic_display.hpp" -#include "display/monochrome_graphic_display.hpp" +#include "graphic/buffer.hpp" +#include "graphic/display.hpp" \ No newline at end of file diff --git a/src/modm/ui/graphic/buffer.hpp b/src/modm/ui/graphic/buffer.hpp new file mode 100644 index 0000000000..f7e4abdde5 --- /dev/null +++ b/src/modm/ui/graphic/buffer.hpp @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2021, Thomas Sommer + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +// ---------------------------------------------------------------------------- + +#ifndef MODM_BUFFER_HPP +#define MODM_BUFFER_HPP + +#include "painter_local.hpp" +#include "painter_text.hpp" +#include "../color.hpp" + +using namespace modm::color; +using namespace modm::shape; + +namespace modm +{ +/** + * Colored Graphic buffer + * + * @tparam C Pixelcolor + * @tparam R Resolution with Pixels horizontal and vertical + * @tparam Painter Pass your own specialised Painter with additional draw(...) methods + * + * @author Thomas Sommer + * @ingroup modm_ui_graphic + */ + +// May inherit on modm::Matrix<..> or provide a conversion constructor for modm::Matrix<..> +template> +requires C::isColor or std::is_same_v +class Buffer : public Painter, public TextPainter +{ +public: + C color = html::White; + + Buffer() = default; + + // Copy construct from buffer of same size + template + Buffer(const Buffer &other) + : color(other.color) + { writeBufferFast(other); } + + // Copy construct from buffer of different size + template + Buffer(const Buffer &other) + : color(other.color) + { writeBuffer(other); } + + // Copy construct from monochrome buffer of same size + template + Buffer(const Buffer &other) + : color(html::White) + { writeBuffer(other); } + + /** + * Assignment operators + */ + template + Buffer & + operator=(const Buffer &other) { + color = other.color; + writeBufferFast(other); + return *this; + } + + template + Buffer & + operator=(const Buffer &other) { + color = other.color; + writeBufferFast(other); + return *this; + } + + template + Buffer & + operator=(const Buffer &other) { + writeBuffer(other); + return *this; + } + + /** + * Write buffer (of different size) to position + * + * @param other Other buffer + * @param origin top left corner to copy to + */ + template + void + writeBuffer(const Buffer &other, + shape::Point origin = {0, 0}); + + /** + * Write monochrome buffer (of different size) to position + * + * @param other Other monochrome buffer + * @param origin top left corner to copy to + */ + template + void + writeBuffer(const Buffer &other, + shape::Point origin = {0, 0}); + + void + drawFlash(modm::accessor::Flash data, uint16_t width, uint16_t height, + shape::Point origin) final; + + void clear(color::Rgb565 color = html::Black); + +protected: + C buffer[R::W][R::H]; + + /** + * Buffer-manipulations + * CAUTION: No protection against segmentation errors! + */ + void drawFast(Point point) final; + void drawFast(HLine hline) final; + void drawFast(VLine vline) final; + void drawFast(Area area) final; + +private: + template + void + writeBufferFast(const Buffer &other); + + // Permit direct buffer access for conversion + template + friend class Buffer; + + // Permit direct buffer access for transmission + template + friend class Display; +}; +} // namespace modm + +#include "buffer_impl.hpp" + +#include "buffer_bool.hpp" + +#endif // MODM_BUFFER_HPP \ No newline at end of file diff --git a/src/modm/ui/graphic/buffer_bool.hpp b/src/modm/ui/graphic/buffer_bool.hpp new file mode 100644 index 0000000000..303346f856 --- /dev/null +++ b/src/modm/ui/graphic/buffer_bool.hpp @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2021, Thomas Sommer + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +// ---------------------------------------------------------------------------- + +#ifndef MODM_BUFFER_BOOL_HPP +#define MODM_BUFFER_BOOL_HPP + +#include + +#include "painter_local.hpp" +#include "painter_text.hpp" +namespace modm +{ + +/** + * Monochrome Graphic buffer + * + * @tparam R Resolution with Pixels horizontal and vertical + * @tparam Painter Pass your own specialised Painter with additional draw(...) methods + * + * @author Thomas Sommer + * @ingroup modm_ui_graphic + */ +template +class Buffer : public Painter, public TextPainter +{ + // Buffer stacks up to 8 pixels in one byte + static constexpr size_t HB = (R::H + 7) / 8; +public: + bool color = true; + + Buffer() = default; + + // Copy construct from monochrome buffer of same size + template + Buffer(const Buffer &other) + { writeBufferFast(other); } + + // Copy construct from monochrome buffer of different size + template + Buffer(const Buffer &other) + { writeBuffer(other); } + + // Write monochrome buffer (of different size) to position + template + void + writeBuffer(const Buffer &other, + shape::Point origin = {0, 0}); + + // TODO Add copy and assignment constructors + + void + drawFlash(modm::accessor::Flash data, uint16_t width, uint16_t height, + shape::Point origin) final; + + void clear(bool color = false); + + bool get(shape::Point point) const + { return this->pointInCanvas(point) ? getFast(point) : false; }; + + // ################################## + // # Experimental Features + // ################################## + + void + shiftVertical(const int16_t difference); + + void + shiftHorizontal(const int16_t difference); + + void + rollVertical(const int16_t difference); + + void + rollHorizontal(const int16_t difference); + +protected: + uint8_t buffer[HB][R::W]; + + /** + * Buffer-manipulations + * CAUTION: No protection against segmentation errors! + */ + void drawFast(Point point) final; + void drawFast(HLine hline) final; + void drawFast(VLine vline) final; + void drawFast(Area area) final; + + // TODO required? +/* void + clearFast(shape::Point point) final + { this->buffer[point.y / 8][point.x] &= ~(1 << point.y % 8); } */ + + bool + getFast(shape::Point point) const + { return (this->buffer[point.y / 8][point.x] & (1 << point.y % 8)); } + + +private: + template + void + writeBufferFast(const Buffer &other); + + // Permit direct buffer access for conversion + template + friend class Buffer; + + // Permit direct buffer access for transmission + template + friend class Display; +}; + +} // namespace modm + +#include "buffer_bool_impl.hpp" + +#endif // MODM_BUFFER_BOOL_HPP \ No newline at end of file diff --git a/src/modm/ui/graphic/buffer_bool_impl.hpp b/src/modm/ui/graphic/buffer_bool_impl.hpp new file mode 100644 index 0000000000..63a3c3f3dc --- /dev/null +++ b/src/modm/ui/graphic/buffer_bool_impl.hpp @@ -0,0 +1,371 @@ +/* + * Copyright (c) 2009, Martin Rosekeit + * Copyright (c) 2009-2011, 2013, Fabian Greif + * Copyright (c) 2010, Georgi Grinshpun + * Copyright (c) 2012, Sascha Schade + * Copyright (c) 2012-2014, 2017, Niklas Hauser + * Copyright (c) 2014, Daniel Krebs + * Copyright (c) 2016, Antal Szabó + * Copyright (c) 2017, Christopher Durand + * Copyright (c) 2021, Thomas Sommer + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +// ---------------------------------------------------------------------------- + +#ifndef MODM_BUFFER_BOOL_HPP +#error "Don't include this file directly, use 'buffer_bool.hpp' instead!" +#endif + +#include +#include + +using namespace modm::shape; + +// Copy monochrome buffer of same size +template +template +void +modm::Buffer::writeBufferFast(const Buffer &other) +{ + size_t yb = 0; + size_t x = 0; + while (yb < R::H / 8) + { + while (x < R::W) + { + buffer[yb][x] = other.buffer[yb][x]; + x++; + } + x = 0; + yb++; + } +} + +template +template +void +modm::Buffer::writeBuffer(const Buffer &other, shape::Point origin) +{ + const shape::Area intersection = this->getIntersection(Rectangle(origin, R_::asPoint())); + + // TODO may be required + // if(intersection.getPixels() == 0) return; + + const size_t yb_min = intersection.topLeft.y / 8; + size_t yb_max = (intersection.bottomRight.y - 1) / 8; + + /* shape::Point dataMin = this->getSourceOrigin(origin); + size_t i_start = dataMin.x + (dataMin.y / 8) * width; + + if (origin.y % 8) + { + // Split bytes, shift and glue together + + if(intersection.bottomRight.y == int16_t(R::H)) yb_max++; + const uint8_t lshift_upper = origin.y & 0b111; + const uint8_t rshift_lower = 8 - lshift_upper; + + for (int16_t x = intersection.topLeft.x; x < intersection.bottomRight.x; x++) + { + size_t i = i_start++; + size_t yb = yb_min; + + if (intersection.topLeft.y > 0) + { + // if(x == intersection.topLeft.x) MODM_LOG_DEBUG << "t"; + // Preserve existing pixels on top + this->buffer[yb][x] &= 0xFF >> rshift_lower; + this->buffer[yb][x] |= data[i] << lshift_upper; + yb++; + } + while (yb < yb_max) + { + // if(x == intersection.topLeft.x) MODM_LOG_DEBUG << "m"; + this->buffer[yb][x] = data[i] >> rshift_lower; + i += width; + this->buffer[yb][x] |= data[i] << lshift_upper; + yb++; + } + if (intersection.bottomRight.y < int16_t(R::H)) + { + // if(x == intersection.topLeft.x) MODM_LOG_DEBUG << "b"; + // Preserve existing pixels on bottom + this->buffer[yb][x] &= 0xFF << lshift_upper; + this->buffer[yb][x] |= data[i] >> rshift_lower; + } + } + } else if (intersection.topLeft.y < intersection.bottomRight.y) + { + // Copy data to buffer as is + for (int16_t x = intersection.topLeft.x; x < intersection.bottomRight.x; x++) + { + size_t i = i_start++; + size_t yb = yb_min; + while (yb < yb_max) + { + // if(x == intersection.topLeft.x) MODM_LOG_DEBUG << "c"; + this->buffer[yb][x] = data[i]; + i += width; + yb++; + } + // if(x == intersection.topLeft.x) MODM_LOG_DEBUG << "c+"; + + // Preserve existing pixels on bottom + this->buffer[yb][x] &= 0xFF << (intersection.bottomRight.y % 8); + // Unused bits not set. No need to mask out end from data + // this->buffer[yb][x] |= data[i] & (0xFF >> (8 - (intersection.bottomRight.y % + 8))); this->buffer[yb][x] |= data[i]; + } + } */ +} + +// ------------------------------------------------------------ + +template +void +modm::Buffer::drawFlash(modm::accessor::Flash data, uint16_t width, + uint16_t height, shape::Point origin) +{ + const Area intersection = this->getIntersection(Rectangle(origin, Point(width, height))); + + // TODO may be required + // if(intersection.getPixels() == 0) return; + + const size_t yb_min = intersection.topLeft.y / 8; + size_t yb_max = (intersection.bottomRight.y - 1) / 8; + + shape::Point dataMin = this->getSourceOrigin(origin); + size_t i_start = dataMin.x + (dataMin.y / 8) * width; + + if (origin.y % 8) + { + // Split bytes, shift and glue together + if (intersection.bottomRight.y == int16_t(R::H)) yb_max++; + const uint8_t lshift_upper = origin.y & 0b111; + const uint8_t rshift_lower = 8 - lshift_upper; + + if(color) { + for (int16_t x = intersection.topLeft.x; x < intersection.bottomRight.x; x++) + { + size_t i = i_start++; + size_t yb = yb_min; + + if (intersection.topLeft.y > 0) + { + this->buffer[yb][x] |= data[i] << lshift_upper; + yb++; + } + while (yb < yb_max) + { + this->buffer[yb][x] |= data[i] >> rshift_lower; + i += width; + this->buffer[yb][x] |= data[i] << lshift_upper; + yb++; + } + if (intersection.bottomRight.y < int16_t(R::H)) + this->buffer[yb][x] |= data[i] >> rshift_lower; + } + } else { + for (int16_t x = intersection.topLeft.x; x < intersection.bottomRight.x; x++) + { + size_t i = i_start++; + size_t yb = yb_min; + + if (intersection.topLeft.y > 0) + { + this->buffer[yb][x] &= ~(data[i] << lshift_upper); + yb++; + } + while (yb < yb_max) + { + this->buffer[yb][x] &= ~(data[i] >> rshift_lower); + i += width; + this->buffer[yb][x] &= ~(data[i] << lshift_upper); + yb++; + } + if (intersection.bottomRight.y < int16_t(R::H)) + this->buffer[yb][x] &= ~(data[i] >> rshift_lower); + } + } + } else if (intersection.topLeft.y < intersection.bottomRight.y) + { + // Write data to buffer as is + if(color) { + for (int16_t x = intersection.topLeft.x; x < intersection.bottomRight.x; x++) + { + size_t i = i_start++; + size_t yb = yb_min; + + while (yb < yb_max) + { + this->buffer[yb][x] |= data[i]; + i += width; + yb++; + } + this->buffer[yb][x] |= data[i]; + } + } else { + for (int16_t x = intersection.topLeft.x; x < intersection.bottomRight.x; x++) + { + size_t i = i_start++; + size_t yb = yb_min; + + while (yb < yb_max) + { + this->buffer[yb][x] &= ~data[i]; + i += width; + yb++; + } + this->buffer[yb][x] &= ~data[i]; + } + } + } +} + +template +void +modm::Buffer::drawFast(Point point) +{ + // OPTIMIZE Switch color in LocalPainter ? + if (color) + this->buffer[point.y / 8][point.x] |= (1 << point.y % 8); + else + this->buffer[point.y / 8][point.x] &= ~(1 << point.y % 8); +} + +template +void +modm::Buffer::drawFast(HLine hline) +{ + const uint8_t byte = Bit0 << (hline.start.y % 8); + const size_t yb = hline.start.y / 8; + + size_t x = hline.start.x; + + // OPTIMIZE Switch color in LocalPainter ? + if(color) + while (x < hline.end_x) + buffer[yb][x++] |= byte; + else + while (x < hline.end_x) + buffer[yb][x++] &= ~byte; +} + +template +void +modm::Buffer::drawFast(VLine vline) +{ + size_t yb = vline.start.y / 8; + const size_t yb_max = vline.end_y / 8; + + // OPTIMIZE Switch color in LocalPainter ? + if (color) + { + uint8_t byte = 0xFF << vline.start.y % 8; // Mask out top end + while (yb < yb_max) + { + buffer[yb][vline.start.x] |= byte; + yb++; + byte = 0xFF; + } + + byte &= ~(0xFF << vline.end_y % 8); // Mask out bottom end + buffer[yb][vline.start.x] |= byte; + } else + { + uint8_t byte = ~(0xFF << vline.start.y % 8); // Mask out top end + + while (yb < yb_max) + { + buffer[yb][vline.start.x] &= byte; + yb++; + byte = 0x00; + } + + byte |= 0xFF << vline.end_y % 8; // Mask out bottom end + buffer[yb][vline.start.x] &= byte; + } +} + +template +void +modm::Buffer::drawFast(Area area) +{ + const size_t yb_max = area.bottomRight.y / 8; + size_t yb = area.topLeft.y / 8; + + // OPTIMIZE Switch color in LocalPainter + if (color) + { + uint8_t byte = 0xFF << area.topLeft.y % 8; // Mask out top end + while (yb < yb_max) + { + for (int16_t x = area.topLeft.x; x < area.bottomRight.x; x++) buffer[yb][x] |= byte; + yb++; + byte = 0xFF; + } + + byte &= 0xFF >> (8 - area.bottomRight.y % 8); // Mask out bottom end + for (int16_t x = area.topLeft.x; x < area.bottomRight.x; x++) buffer[yb][x] |= byte; + } else + { + uint8_t byte = 0xFF >> (8 - area.topLeft.y % 8); // Mask out top end + + while (yb < yb_max) + { + for (int16_t x = area.topLeft.x; x < area.bottomRight.x; x++) buffer[yb][x] &= byte; + yb++; + byte = 0x00; + } + + byte |= 0xFF << area.bottomRight.y % 8; // Mask out bottom end + for (int16_t x = area.topLeft.x; x < area.bottomRight.x; x++) buffer[yb][x] &= byte; + } +} + +template +void +modm::Buffer::clear(bool color) +{ + // OPTIMIZE Make this impossible fast by using DMA + std::fill(buffer[0], buffer[0] + R::W * HB, color ? 0xFF : 0x00); + this->cursor = {0, 0}; +} + +// ----------------------------------------------------------------- + +template +void +modm::Buffer::shiftVertical(const int16_t distance) +{ + if (distance > 0) + { + for (size_t yb = 0; yb < HB; yb++) + { + size_t x = R::W; + while (x > distance) + { + x--; + buffer[yb][x] = buffer[yb][x - distance]; + } + while (x) buffer[yb][--x] = 0x00; + } + } else if (distance < 0) + { + for (size_t yb = 0; yb < HB; yb++) + { + size_t x = 0; + while (x < R::W + distance) + { + buffer[yb][x] = buffer[yb][x - distance]; + x++; + } + while (x < R::W) buffer[yb][x++] = 0x00; + } + } +} \ No newline at end of file diff --git a/src/modm/ui/graphic/buffer_impl.hpp b/src/modm/ui/graphic/buffer_impl.hpp new file mode 100644 index 0000000000..58d430fd30 --- /dev/null +++ b/src/modm/ui/graphic/buffer_impl.hpp @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2009, Martin Rosekeit + * Copyright (c) 2009-2011, 2013, Fabian Greif + * Copyright (c) 2010, Georgi Grinshpun + * Copyright (c) 2012, Sascha Schade + * Copyright (c) 2012-2014, 2017, Niklas Hauser + * Copyright (c) 2014, Daniel Krebs + * Copyright (c) 2016, Antal Szabó + * Copyright (c) 2017, Christopher Durand + * Copyright (c) 2021, Thomas Sommer + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +// ---------------------------------------------------------------------------- + +#ifndef MODM_BUFFER_HPP +#error "Don't include this file directly, use 'buffer.hpp' instead!" +#endif + +#include +#include + +using namespace modm::shape; + +// Copy buffer of same size +template +template +void +modm::Buffer::writeBufferFast( + const Buffer &other) +{ + Point scanner{0, 0}; + while(scanner.y < R::H) { + while(scanner.x < R::W) { + setPixelFast(scanner, other.getPixelFast(scanner)); + scanner.x++; + } + scanner.x = 0; + scanner.y++; + } +} + +// Write buffer (of different size) to position +template +template +void +modm::Buffer::writeBuffer( + const Buffer &other, Point origin) +{ + const Area intersection = this->getIntersection(Rectangle(origin, R_::asPoint())); + + const Point otherTopLeft = this->getSourceOrigin(origin); + + Point scanner = intersection.topLeft; + Point scannerOther = otherTopLeft; + + while (scanner.x < intersection.bottomRight.x) + { + while (scanner.y < intersection.bottomRight.y) + { + setPixelFast(scanner, other.getPixelFast(scannerOther)); + scanner.y++; + scannerOther.y++; + } + scanner.x++; + scanner.y = intersection.topLeft.y; + + scannerOther.x++; + scannerOther.y = otherTopLeft.y; + } +} + +// Write monochrome buffer (of different size) to position +template +template +void +modm::Buffer::writeBuffer( + const Buffer &other, Point origin) +{ + const Area intersection = this->getIntersection(Rectangle(origin, R_::asPoint())); + const Point otherTopLeft = this->getSourceOrigin(origin); + + const uint8_t bit_top = std::rotl(Bit0, otherTopLeft.y % 8); + const size_t yb_other_top = otherTopLeft.y / 8; + + Point scanner = intersection.topLeft; + size_t x_other = otherTopLeft.x; + + while (scanner.x < intersection.bottomRight.x) + { + uint8_t bit = bit_top; + size_t yb_other = yb_other_top; + while (scanner.y < intersection.bottomRight.y) + { + auto pixel = other.buffer[yb_other][x_other] & bit ? color : C(html::Black); + buffer[scanner.x][scanner.y] = pixel; + scanner.y++; + + bit = std::rotl(bit, 1); + if (bit == Bit0) yb_other++; + } + scanner.x++; + scanner.y = intersection.topLeft.y; + + x_other++; + } +} + +// --------------------------------------------------- + +template +void +modm::Buffer::drawFlash(modm::accessor::Flash data, + uint16_t width, uint16_t height, Point origin) +{ + const Area intersection = this->getIntersection(Rectangle(origin, Point(width, height))); + + // TODO maybe a good thing + //if(intersection.getPixels() == 0) return; + + const Point dataMin = this->getSourceOrigin(origin); + size_t byte_top = dataMin.x + (dataMin.y / 8) * width; + const uint8_t bit_top = std::rotl(Bit0, dataMin.y % 8); + + for (int16_t x = intersection.topLeft.x; x < intersection.bottomRight.x; x++) + { + size_t byte = byte_top++; + uint8_t bit = bit_top; + for (int16_t y = intersection.topLeft.y; y < intersection.bottomRight.y; y++) + { + this->setPixelFast({x, y}, data[byte] & bit); + + bit = std::rotl(bit, 1); + if (bit == Bit0) byte += width; + } + } +} + +template +void +modm::Buffer::drawFast(Point point) +{ + buffer[point.x][point.y] = color; +} + +template +void +modm::Buffer::drawFast(HLine hline) +{ + while (hline.start.x < hline.end_x) + { + drawFast(hline.start); + hline.start.x++; + } +} + +template +void +modm::Buffer::drawFast(VLine vline) +{ + while (vline.start.y < vline.end_y) + { + drawFast(vline.start); + vline.start.y++; + } +} + +template +void +modm::Buffer::drawFast(Area area) +{ + Point index = area.topLeft; + const uint16_t length = area.bottomRight.x + area.topLeft.x; + + while (index.x < area.bottomRight.x) + { + this->draw(VLine{index, length}); + index.x++; + } +} + +template +void +modm::Buffer::clear(color::Rgb565 color) +{ + // OPTIMIZE Make this impossible fast by using DMA + std::fill(buffer[0], buffer[0] + R::W * R::H, color); + this->cursor = {0, 0}; +} \ No newline at end of file diff --git a/src/modm/ui/graphic/canvas.hpp b/src/modm/ui/graphic/canvas.hpp new file mode 100644 index 0000000000..7b0a45c93a --- /dev/null +++ b/src/modm/ui/graphic/canvas.hpp @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2021, Thomas Sommer + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +// ---------------------------------------------------------------------------- + +#ifndef MODM_CANVAS_HPP +#define MODM_CANVAS_HPP + +#include "../shape.hpp" + +using namespace modm::shape; + +namespace modm +{ + +template +struct Resolution{ +public: + static constexpr uint16_t W = Width; + static constexpr uint16_t H = Height; + static constexpr uint32_t Pixels = Width * Height; + + static inline Point asPoint() { + return Point(Width, Height); + } +}; + +/** + * Baseclass for 2D Graphic Objects like Display and Buffer + * + * @tparam R Resolution with Pixels horizontal and vertical + * + * @author Thomas Sommer + * @ingroup modm_ui_graphic + */ +template +class Canvas +{ +public: + // TODO Not sure about these constexpr + constexpr virtual uint16_t + getWidth() const + { return R::W; } + + constexpr virtual uint16_t + getHeight() const + { return R::H; } + + constexpr uint32_t getPixels() const + { return R::Pixels; } + + constexpr Area + asArea() const + { return {{0, 0}, {R::W, R::H}}; } + + inline Area + getIntersection(Area area) { + // TODO implement constexpr Point modm::clamp(Point a, Point b, Point c); + return Area({ + std::clamp(area.topLeft.x, 0, R::W), + std::clamp(area.topLeft.y, 0, R::H) + }, + { + std::clamp(area.bottomRight.x, 0, R::W), + std::clamp(area.bottomRight.y, 0, R::H) + }); + } + + // Helper function for copying pixmaps to pixmaps + // TODO Find better place and better Name + static Point + getSourceOrigin(Point origin) { + return { + origin.x < 0 ? -origin.x : 0, + origin.y < 0 ? -origin.y : 0 + }; + } + +protected: + bool + xInCanvas(int16_t x) const + { return x >= 0 and x < int16_t(getWidth()); } + + bool + yInCanvas(int16_t y) const + { return y >= 0 and y < int16_t(getHeight()); } + + bool + pointInCanvas(Point position) const + { return xInCanvas(position.x) and yInCanvas(position.y); } +}; +} // namespace modm + +#endif // MODM_CANVAS_HPP \ No newline at end of file diff --git a/src/modm/ui/graphic/composition_canvas.hpp b/src/modm/ui/graphic/composition_canvas.hpp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/modm/ui/graphic/display.hpp b/src/modm/ui/graphic/display.hpp new file mode 100644 index 0000000000..1741848cb9 --- /dev/null +++ b/src/modm/ui/graphic/display.hpp @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2021, Thomas Sommer + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +// ---------------------------------------------------------------------------- + +#pragma once + +#include "canvas.hpp" +#include "buffer.hpp" +namespace modm +{ + +namespace display +{ + +enum OrientationFlags : uint8_t +{ + Portrait = Bit0, + Rotate180 = Bit1 +}; + +enum Orientation : uint8_t +{ + Landscape0 = 0, + Portrait90 = Portrait, + Landscape180 = Rotate180, + Portrait270 = Portrait | Rotate180 +}; +} // namespace display + +/** + * Baseclass for Graphic Display + * + * @tparam C Resolution: Pixel-color. Pass one of modm::ui::color::* or bool for a monochrome buffer + * @tparam R Resolution: Pixel-count in horizontal and vertical direction + * + * @author Thomas Sommer + * @ingroup modm_ui_graphic + */ + +// May inherit on modm::Matrix<..> or provide a conversion constructor for modm::Matrix<..> +template +requires C::isColor or std::is_same_v +class Display : virtual public Canvas +{ +public: + using colorType = C; + C color; + + Display(C color) : color(color) {}; + + display::Orientation + getOrientation() const + { return orientation; } + + uint16_t + getWidth() const final + { return (orientation & display::OrientationFlags::Portrait) ? R::H : R::W; } + + uint16_t + getHeight() const final + { return (orientation & display::OrientationFlags::Portrait) ? R::W : R::H; } + +protected: + display::Orientation orientation = display::Orientation::Landscape0; + + template + constexpr uint8_t* + getPlainBuffer(const Buffer& buffer) + { return (uint8_t*)(buffer.buffer); } +}; + +} // namespace modm \ No newline at end of file diff --git a/src/modm/ui/graphic/graphic.lb b/src/modm/ui/graphic/graphic.lb new file mode 100644 index 0000000000..fbcc79966f --- /dev/null +++ b/src/modm/ui/graphic/graphic.lb @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Copyright (c) 2018, Niklas Hauser +# Copyright (c) 2021, Thomas Sommer +# +# This file is part of the modm project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# ----------------------------------------------------------------------------- + +def init(module): + module.name = ":ui:graphic" + module.description = FileReader("graphic.md") + +def prepare(module, options): + module.depends( + ":architecture:accessor", + ":io", + ":math:utils", + ":ui:color", + ":ui:shape", + ":ui:font") + return True + +def build(env): + env.outbasepath = "modm/src/modm/ui/graphic" + env.copy(".") + env.copy("../graphic.hpp") diff --git a/src/modm/ui/graphic/graphic.md b/src/modm/ui/graphic/graphic.md new file mode 100644 index 0000000000..d563961e12 --- /dev/null +++ b/src/modm/ui/graphic/graphic.md @@ -0,0 +1,33 @@ +# Graphic + +Code for writing and drawing on graphical displays + +## Coordinate System + +{0, 0} + ┌─────────────────────┐ + │ ┌───➤ X │ + │ │ │ + │ 🠛 Y │ + │ │ + │ │ + │ │ + │ │ + └─────────────────────┘ + e.g. {127, 63} + +The size (width and height) of a graphics primitive always correspond +to its mathematical model, ignoring the rendered width. As everything +is drawn one pixel wide, the pixels will be rendered to the right and +below the mathematically defined points. + +## Example + +```cpp +#include + +buffer = GraphicBuffer +buffer << "Hello World" +ssd1306.write(buffer); + +′′′ \ No newline at end of file diff --git a/src/modm/ui/graphic/painter_flash.hpp b/src/modm/ui/graphic/painter_flash.hpp new file mode 100644 index 0000000000..ae4b396c52 --- /dev/null +++ b/src/modm/ui/graphic/painter_flash.hpp @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2021, Thomas Sommer + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +// ---------------------------------------------------------------------------- + +#pragma once + +#include +#include +#include + +namespace modm +{ + +/** + * Painter for Images stored in flash-memory + * + * @tparam RF true: Resumable Functions, false: Normal functions + * + * @author Thomas Sommer + * @ingroup modm_ui_graphic + */ +template +class FlashPainter +{ + using returnType = std::conditional_t, void>; + +public: + /** + * Draw a monochrome Pixmap from Flash-memory + * + * @param origin Top left corner + * @param width Width of pixmap + * @param height Height of pixmap + * @param data Pixmap data in Flash + */ + virtual returnType + drawFlash(modm::accessor::Flash data, uint16_t width, uint16_t height, + Point origin) = 0; +}; + +} // namespace modm \ No newline at end of file diff --git a/src/modm/ui/graphic/painter_local.hpp b/src/modm/ui/graphic/painter_local.hpp new file mode 100644 index 0000000000..5b557aff38 --- /dev/null +++ b/src/modm/ui/graphic/painter_local.hpp @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2021, Thomas Sommer + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +// ---------------------------------------------------------------------------- + +#ifndef MODM_PAINTER_LOCAL_HPP +#define MODM_PAINTER_LOCAL_HPP + +#include +#include "canvas.hpp" +#include "../shape.hpp" +#include "style.hpp" + +using namespace modm::shape; + +namespace modm +{ + +/** + * Painter for shapes like Point, Line, Rectangle, Circle, ... + * + * @tparam R Resolution with Pixels horizontal and vertical + * + * @author Thomas Sommer + * @ingroup modm_ui_graphic + */ +template +class LocalPainter : virtual public Canvas +{ +public: + void draw(Point point); + void draw(Line line); + void draw(Rectangle rectangle, Style style = Style::Outline); + void draw(Rectangle rectangle, uint16_t radius, Style style = Style::Outline); + void draw(Circle circle, Style style = Style::Outline); + void draw(Ellipse ellipse, Style style = Style::Outline); + // TODO Best technique to pass container of shapes? + // void draw(container shape); + +private: + void drawQuadPoints(Point center, Point point); + +protected: + LocalPainter() = default; + + /** + * Buffer-manipulations + * CAUTION: No protection against segmentation errors! + */ + virtual void drawFast(Point point) = 0; + virtual void drawFast(HLine hline) = 0; + virtual void drawFast(VLine vline) = 0; + virtual void drawFast(Area area) = 0; +}; +} // namespace modm + +#include "painter_local_impl.hpp" + +#endif // MODM_PAINTER_LOCAL_HPP \ No newline at end of file diff --git a/src/modm/ui/graphic/painter_local_impl.hpp b/src/modm/ui/graphic/painter_local_impl.hpp new file mode 100644 index 0000000000..4b177b39aa --- /dev/null +++ b/src/modm/ui/graphic/painter_local_impl.hpp @@ -0,0 +1,351 @@ +/* + * Copyright (c) 2009, Martin Rosekeit + * Copyright (c) 2009-2011, 2013, Fabian Greif + * Copyright (c) 2010, Georgi Grinshpun + * Copyright (c) 2012, Sascha Schade + * Copyright (c) 2012-2014, 2017, Niklas Hauser + * Copyright (c) 2014, Daniel Krebs + * Copyright (c) 2016, Antal Szabó + * Copyright (c) 2017, Christopher Durand + * Copyright (c) 2021, Thomas Sommer + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +// ---------------------------------------------------------------------------- + +#ifndef MODM_PAINTER_LOCAL_HPP +#error "Don't include this file directly, use 'painter_local.hpp' instead!" +#endif + +#include +#include + +#include "../font/fixed_width_5x8.hpp" + +using namespace modm::shape; + +template +void +modm::LocalPainter::draw(Point point) +{ + if (this->pointInCanvas(point)) drawFast(point); +}; + +template +void +modm::LocalPainter::draw(Line line) +{ + if (line.isHorizontal()) + { + if(this->yInCanvas(line.start.y)) { + if (line.start.x > line.end.x) std::swap(line.start.x, line.end.x); + + // Clip only x + line.start.x = std::max(line.start.x, 0); + line.end.x = std::min(line.end.x, R::W); + + drawFast(HLine(line)); + } + } else if (line.isVertical()) + { + if(this->xInCanvas(line.start.x)) { + if (line.start.y > line.end.y) std::swap(line.start.y, line.end.y); + + // Clip only y + line.start.y = std::max(line.start.y, 0); + line.end.y = std::min(line.end.y, R::H); + + drawFast(VLine(line)); + } + } else + { + line.clip(this->asArea()); + + // Bresenham algorithm + const Point delta = line.end - line.start; + const bool steep = std::abs(delta.y) > std::abs(delta.x); + if (steep) + { + std::swap(line.start.x, line.start.y); + std::swap(line.end.x, line.end.y); + } + if (line.start.x > line.end.x) + std::swap(line.start, line.end); + + const Point deltaLoop = line.end - line.start; + const int16_t step = deltaLoop.y > 0 ? 1 : -1; + int16_t error = deltaLoop.x / 2; + + if (steep) + { + while (line.start.x <= line.end.x) + { + drawFast({line.start.y, line.start.x}); + line.start.x++; + + error -= std::abs(deltaLoop.y); + if (error < 0) + { + line.start.y += step; + error += deltaLoop.x; + } + } + } else + { + while (line.start.x <= line.end.x) + { + drawFast(line.start); + line.start.x++; + + error -= std::abs(deltaLoop.y); + if (error < 0) + { + line.start.y += step; + error += deltaLoop.x; + } + } + } + } +} + +template +void +modm::LocalPainter::draw(Rectangle rectangle, Style style) +{ + const Area is = this->getIntersection(rectangle); + + switch (style) + { + case Style::Outline: + if (this->yInCanvas(rectangle.origin.y)) + drawFast(HLine({is.topLeft.x + 1, is.topLeft.y}, is.bottomRight.x - 2)); + + if (this->yInCanvas(rectangle.origin.y + rectangle.size.y - 1)) + drawFast(HLine({is.topLeft.x + 1, is.bottomRight.y - 1}, is.bottomRight.x - 2)); + + if (this->xInCanvas(rectangle.origin.x)) + drawFast(VLine(is.topLeft, is.bottomRight.y)); + + if (this->xInCanvas(rectangle.origin.x + rectangle.size.x - 1)) + drawFast(VLine({is.bottomRight.x - 1, is.topLeft.y}, is.bottomRight.y)); + break; + case Style::Filled: + drawFast(is); + } +} + +template +void +modm::LocalPainter::draw(Rectangle rectangle, uint16_t radius, Style style) +{ + if (radius == 0) { + draw(rectangle, style); + return; + } + + switch(style) { + case Style::Outline: { + const Point center = rectangle.getCenter(); + const Point circle_off = rectangle.size / 2 - Point(radius, radius); + + int16_t error = -radius; + Point p(radius, 0); + + while (p.x > p.y) + { + drawQuadPoints(center, p + circle_off); + drawQuadPoints(center, Point(p.y, p.x) + circle_off); + + error += p.y; + ++p.y; + error += p.y; + + if (error >= 0) + error -= 2 * --p.x; + } + drawQuadPoints(center, p + circle_off); + + // FIXME Crashes if one of these lines cross screen-border + // OPTIMIZE There's potential for more recycling + if (this->yInCanvas(rectangle.origin.y)) + drawFast(HLine({center.x - circle_off.x, rectangle.origin.y}, center.x + circle_off.x)); + + if (this->yInCanvas(rectangle.getBottomRight().y)) + drawFast(HLine({center.x - circle_off.x, rectangle.getBottomRight().y}, center.x + circle_off.x)); + + if (this->xInCanvas(rectangle.origin.x)) + drawFast(VLine({rectangle.origin.x, center.y - circle_off.y}, center.y + circle_off.y)); + + if (this->xInCanvas(rectangle.getBottomRight().x)) + drawFast(VLine({rectangle.getBottomRight().x, center.y - circle_off.y}, center.y + circle_off.y)); + break; + } + case Style::Filled: { + // Todo Implement filled, rounded Rectangle + draw(rectangle, style); + break; + } + } +} + +template +void +modm::LocalPainter::draw(Circle circle, Style style) +{ + if (circle.radius == 0) { + draw(circle.center); + return; + } + + switch(style) { + case Style::Outline: { + int16_t error = -circle.radius; + Point p(circle.radius, 0); + + while (p.x > p.y) + { + drawQuadPoints(circle.center, p); + drawQuadPoints(circle.center, Point(p.y, p.x)); + + error += p.y; + ++p.y; + error += p.y; + + if (error >= 0) + error -= 2 * --p.x; + } + drawQuadPoints(circle.center, p); + break; + } + case Style::Filled: { + int16_t f = 1 - circle.radius; + int16_t ddF_x = 0; + int16_t ddF_y = -2 * circle.radius; + int16_t x = 0; + int16_t y = circle.radius; + + Point start(circle.center.x, circle.center.y - circle.radius); + drawFast(VLine(start, start.y + 2 * circle.radius)); + + while (x < y) + { + if (f >= 0) + { + y--; + ddF_y += 2; + f += ddF_y; + } + x++; + ddF_x += 2; + f += ddF_x + 1; + + start = circle.center + Point(x, -y); + drawFast(VLine(start, start.y + 2 * y)); + start = circle.center + Point(y, -x); + drawFast(VLine(start, start.y + 2 * x)); + start = circle.center - Point(x, y); + drawFast(VLine(start, start.y + 2 * y)); + start = circle.center - Point(y, x); + drawFast(VLine(start, start.y + 2 * x)); + } + break; + } + } +} + +template +void +modm::LocalPainter::draw(Ellipse ellipse, Style style) +{ + switch(style) { + case Style::Outline: { + int32_t rx_2 = ellipse.radius_x * ellipse.radius_x; + int32_t ry_2 = ellipse.radius_y * ellipse.radius_y; + + int16_t x = 0; + int16_t y = ellipse.radius_y; + + int32_t fx = 0; + int32_t fy = rx_2 * 2 * ellipse.radius_y; + + int32_t p = ry_2 - (rx_2 * ellipse.radius_y) + (rx_2 + 2) / 4; + + drawQuadPoints(ellipse.center, x, y); + while (fx < fy) + { + x++; + fx += ry_2 * 2; + + if (p < 0) + { + p += (fx + ry_2); + } else + { + y--; + fy -= rx_2 * 2; + p += (fx + ry_2 - fy); + } + + drawQuadPoints(ellipse.center, x, y); + } + + p = ((ry_2 * (4 * x * x + 4 * x + 1) / 2) + 2 * (rx_2 * (y - 1) * (y - 1)) - 2 * (rx_2 * ry_2) + + 1) / + 2; + + while (y > 0) + { + y--; + fy -= rx_2 * 2; + + if (p >= 0) + p += (rx_2 - fy); + else { + x++; + fx += ry_2 * 2; + p += (fx + rx_2 - fy); + } + + drawQuadPoints(ellipse.center, x, y); + } + break; + } + case Style::Filled: + // TODO implement Ellipse Style::Filled; + draw(ellipse, Style::Outline); + break; + } +} + +template +void +modm::LocalPainter::drawQuadPoints(Point center, Point point) +{ + Point qpoint = center + point; + bool drawXpos = this->xInCanvas(qpoint.x); + bool drawXneg = this->xInCanvas(center.x - point.x); + + if(this->yInCanvas(qpoint.y)) { + if(drawXpos) + drawFast(qpoint); + if(point.x != 0 and drawXneg) { + qpoint.x = center.x - point.x; + drawFast(qpoint); + } + } + if(point.y != 0) { + qpoint = center - point; + if(this->yInCanvas(qpoint.y)) { + if(drawXneg) + drawFast(qpoint); + if(point.x != 0 and drawXpos) { + qpoint.x = center.x + point.x; + drawFast(qpoint); + } + } + } +} \ No newline at end of file diff --git a/src/modm/ui/graphic/painter_remote.hpp b/src/modm/ui/graphic/painter_remote.hpp new file mode 100644 index 0000000000..6e09506b81 --- /dev/null +++ b/src/modm/ui/graphic/painter_remote.hpp @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2021, Thomas Sommer + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +// ---------------------------------------------------------------------------- + +#ifndef MODM_PAINTER_REMOTE_HPP +#define MODM_PAINTER_REMOTE_HPP + +#include +#include +#include "canvas.hpp" +#include "../shape.hpp" +#include "style.hpp" + +using namespace modm::shape; + +namespace modm +{ + +/** + * Painter for shapes like Point, Line, Rectangle, Circle, ... + * + * @tparam R Resolution with Pixels horizontal and vertical + * @tparam Interface Inherit on Interface with Resumables + * + * @author Thomas Sommer + * @ingroup modm_ui_graphic + */ +template +class RemotePainter : public Interface, virtual public Canvas +{ +public: + modm::ResumableResult draw(Point point); + modm::ResumableResult draw(Line line); + modm::ResumableResult draw(Rectangle rectangle, Style style = Style::Outline); + modm::ResumableResult draw(Rectangle rectangle, uint16_t radius, Style style = Style::Outline); + modm::ResumableResult draw(Circle circle, Style style = Style::Outline); + modm::ResumableResult draw(Ellipse ellipse, Style style = Style::Outline); + // TODO Best technique to pass container of shapes? + // modm::ResumableResult draw(container shape); + +private: + modm::ResumableResult drawQuadPoints(Point center, Point point); + +protected: + RemotePainter() = default; + // template + // RemotePainter(Args &&...args) : Interface(std::forward(args)...) {} + + /** + * Buffer-manipulations + * CAUTION: No protection against segmentation errors! + */ + virtual modm::ResumableResult drawFast(Point point) = 0; + virtual modm::ResumableResult drawFast(HLine hline) = 0; + virtual modm::ResumableResult drawFast(VLine vline) = 0; + virtual modm::ResumableResult drawFast(Area area) = 0; +}; +} // namespace modm + +// #include "painter_remote_impl.hpp" + +#endif // MODM_PAINTER_REMOTE_HPP \ No newline at end of file diff --git a/src/modm/ui/graphic/painter_remote_impl.hpp b/src/modm/ui/graphic/painter_remote_impl.hpp new file mode 100644 index 0000000000..ab5c886f0e --- /dev/null +++ b/src/modm/ui/graphic/painter_remote_impl.hpp @@ -0,0 +1,387 @@ +/* + * Copyright (c) 2009, Martin Rosekeit + * Copyright (c) 2009-2011, 2013, Fabian Greif + * Copyright (c) 2010, Georgi Grinshpun + * Copyright (c) 2012, Sascha Schade + * Copyright (c) 2012-2014, 2017, Niklas Hauser + * Copyright (c) 2014, Daniel Krebs + * Copyright (c) 2016, Antal Szabó + * Copyright (c) 2017, Christopher Durand + * Copyright (c) 2021, Thomas Sommer + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +// ---------------------------------------------------------------------------- + +#ifndef MODM_PAINTER_REMOTE_HPP +#error "Don't include this file directly, use 'painter_local.hpp' instead!" +#endif + +#include +#include + +#include "../font/fixed_width_5x8.hpp" + +using namespace modm::shape; + +template +modm::ResumableResult +modm::RemotePainter::draw(Point point) +{ + // RF_BEGIN(); + + if (this->pointInCanvas(point)) drawFast(point); + + // RF_END(); + return {modm::rf::Stop}; +}; + +template +modm::ResumableResult +modm::RemotePainter::draw(Line line) +{ + // RF_BEGIN(); + + if (line.isHorizontal()) + { + if(this->yInCanvas(line.start.y)) { + if (line.start.x > line.end.x) std::swap(line.start.x, line.end.x); + + // Clip only x + line.start.x = std::max(line.start.x, 0); + line.end.x = std::min(line.end.x, R::W); + + drawFast(HLine(line)); + } + } else if (line.isVertical()) + { + if(this->xInCanvas(line.start.x)) { + if (line.start.y > line.end.y) std::swap(line.start.y, line.end.y); + + // Clip only y + line.start.y = std::max(line.start.y, 0); + line.end.y = std::min(line.end.y, R::H); + + drawFast(VLine(line)); + } + } else + { + line.clip(this->asArea()); + + // Bresenham algorithm + const Point delta = line.end - line.start; + const bool steep = std::abs(delta.y) > std::abs(delta.x); + if (steep) + { + std::swap(line.start.x, line.start.y); + std::swap(line.end.x, line.end.y); + } + if (line.start.x > line.end.x) + std::swap(line.start, line.end); + + const Point deltaLoop = line.end - line.start; + const int16_t step = deltaLoop.y > 0 ? 1 : -1; + int16_t error = deltaLoop.x / 2; + + if (steep) + { + while (line.start.x <= line.end.x) + { + drawFast({line.start.y, line.start.x}); + line.start.x++; + + error -= std::abs(deltaLoop.y); + if (error < 0) + { + line.start.y += step; + error += deltaLoop.x; + } + } + } else + { + while (line.start.x <= line.end.x) + { + drawFast(line.start); + line.start.x++; + + error -= std::abs(deltaLoop.y); + if (error < 0) + { + line.start.y += step; + error += deltaLoop.x; + } + } + } + } + + // RF_END(); + return {modm::rf::Stop}; +} + +template +modm::ResumableResult +modm::RemotePainter::draw(Rectangle rectangle, Style style) +{ + // RF_BEGIN(); + + const Area is = this->getIntersection(rectangle); + + switch (style) + { + case Style::Outline: + if (this->yInCanvas(rectangle.origin.y)) + drawFast(HLine({is.topLeft.x + 1, is.topLeft.y}, is.bottomRight.x - 2)); + + if (this->yInCanvas(rectangle.origin.y + rectangle.size.y - 1)) + drawFast(HLine({is.topLeft.x + 1, is.bottomRight.y - 1}, is.bottomRight.x - 2)); + + if (this->xInCanvas(rectangle.origin.x)) + drawFast(VLine(is.topLeft, is.bottomRight.y)); + + if (this->xInCanvas(rectangle.origin.x + rectangle.size.x - 1)) + drawFast(VLine({is.bottomRight.x - 1, is.topLeft.y}, is.bottomRight.y)); + break; + case Style::Filled: + drawFast(is); + } + + // RF_END(); + return {modm::rf::Stop}; +} + +template +modm::ResumableResult +modm::RemotePainter::draw(Rectangle rectangle, uint16_t radius, Style style) +{ + // RF_BEGIN(); + + if (radius == 0) { + draw(rectangle, style); + // RF_RETURN(); + return {modm::rf::Stop}; + } + + switch(style) { + case Style::Outline: { + const Point center = rectangle.getCenter(); + const Point circle_off = rectangle.size / 2 - Point(radius, radius); + + int16_t error = -radius; + Point p(radius, 0); + + while (p.x > p.y) + { + drawQuadPoints(center, p + circle_off); + drawQuadPoints(center, Point(p.y, p.x) + circle_off); + + error += p.y; + ++p.y; + error += p.y; + + if (error >= 0) + error -= 2 * --p.x; + } + drawQuadPoints(center, p + circle_off); + + // FIXME Crashes if one of these lines cross screen-border + // OPTIMIZE There's potential for more recycling + if (this->yInCanvas(rectangle.origin.y)) + drawFast(HLine({center.x - circle_off.x, rectangle.origin.y}, center.x + circle_off.x)); + + if (this->yInCanvas(rectangle.getBottomRight().y)) + drawFast(HLine({center.x - circle_off.x, rectangle.getBottomRight().y}, center.x + circle_off.x)); + + if (this->xInCanvas(rectangle.origin.x)) + drawFast(VLine({rectangle.origin.x, center.y - circle_off.y}, center.y + circle_off.y)); + + if (this->xInCanvas(rectangle.getBottomRight().x)) + drawFast(VLine({rectangle.getBottomRight().x, center.y - circle_off.y}, center.y + circle_off.y)); + break; + } + case Style::Filled: { + // Todo Implement filled, rounded Rectangle + draw(rectangle, style); + break; + } + } + // RF_END(); + return {modm::rf::Stop}; +} + +template +modm::ResumableResult +modm::RemotePainter::draw(Circle circle, Style style) +{ + // RF_BEGIN(); + + if (circle.radius == 0) { + draw(circle.center); + // RF_RETURN(); + return {modm::rf::Stop}; + } + + switch(style) { + case Style::Outline: { + int16_t error = -circle.radius; + Point p(circle.radius, 0); + + while (p.x > p.y) + { + drawQuadPoints(circle.center, p); + drawQuadPoints(circle.center, Point(p.y, p.x)); + + error += p.y; + ++p.y; + error += p.y; + + if (error >= 0) + error -= 2 * --p.x; + } + drawQuadPoints(circle.center, p); + break; + } + case Style::Filled: { + int16_t f = 1 - circle.radius; + int16_t ddF_x = 0; + int16_t ddF_y = -2 * circle.radius; + int16_t x = 0; + int16_t y = circle.radius; + + Point start(circle.center.x, circle.center.y - circle.radius); + drawFast(VLine(start, start.y + 2 * circle.radius)); + + while (x < y) + { + if (f >= 0) + { + y--; + ddF_y += 2; + f += ddF_y; + } + x++; + ddF_x += 2; + f += ddF_x + 1; + + start = circle.center + Point(x, -y); + drawFast(VLine(start, start.y + 2 * y)); + start = circle.center + Point(y, -x); + drawFast(VLine(start, start.y + 2 * x)); + start = circle.center - Point(x, y); + drawFast(VLine(start, start.y + 2 * y)); + start = circle.center - Point(y, x); + drawFast(VLine(start, start.y + 2 * x)); + } + break; + } + } + + // RF_END(); + return {modm::rf::Stop}; +} + +template +modm::ResumableResult +modm::RemotePainter::draw(Ellipse ellipse, Style style) +{ + // RF_BEGIN(); + + switch(style) { + case Style::Outline: { + int32_t rx_2 = ellipse.radius_x * ellipse.radius_x; + int32_t ry_2 = ellipse.radius_y * ellipse.radius_y; + + int16_t x = 0; + int16_t y = ellipse.radius_y; + + int32_t fx = 0; + int32_t fy = rx_2 * 2 * ellipse.radius_y; + + int32_t p = ry_2 - (rx_2 * ellipse.radius_y) + (rx_2 + 2) / 4; + + drawQuadPoints(ellipse.center, x, y); + while (fx < fy) + { + x++; + fx += ry_2 * 2; + + if (p < 0) + { + p += (fx + ry_2); + } else + { + y--; + fy -= rx_2 * 2; + p += (fx + ry_2 - fy); + } + + drawQuadPoints(ellipse.center, x, y); + } + + p = ((ry_2 * (4 * x * x + 4 * x + 1) / 2) + 2 * (rx_2 * (y - 1) * (y - 1)) - 2 * (rx_2 * ry_2) + + 1) / + 2; + + while (y > 0) + { + y--; + fy -= rx_2 * 2; + + if (p >= 0) + p += (rx_2 - fy); + else { + x++; + fx += ry_2 * 2; + p += (fx + rx_2 - fy); + } + + drawQuadPoints(ellipse.center, x, y); + } + break; + } + case Style::Filled: + // TODO implement Ellipse Style::Filled; + draw(ellipse, Style::Outline); + break; + } + + // RF_END(); + return {modm::rf::Stop}; +} + +template +modm::ResumableResult +modm::RemotePainter::drawQuadPoints(Point center, Point point) +{ + // RF_BEGIN(); + + Point qpoint = center + point; + bool drawXpos = this->xInCanvas(qpoint.x); + bool drawXneg = this->xInCanvas(center.x - point.x); + + if(this->yInCanvas(qpoint.y)) { + if(drawXpos) + drawFast(qpoint); + if(point.x != 0 and drawXneg) { + qpoint.x = center.x - point.x; + drawFast(qpoint); + } + } + if(point.y != 0) { + qpoint = center - point; + if(this->yInCanvas(qpoint.y)) { + if(drawXneg) + drawFast(qpoint); + if(point.x != 0 and drawXpos) { + qpoint.x = center.x + point.x; + drawFast(qpoint); + } + } + } + + // RF_END(); + return {modm::rf::Stop}; +} \ No newline at end of file diff --git a/src/modm/ui/graphic/painter_text.hpp b/src/modm/ui/graphic/painter_text.hpp new file mode 100644 index 0000000000..f6e22c5320 --- /dev/null +++ b/src/modm/ui/graphic/painter_text.hpp @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2009-2010, Martin Rosekeit + * Copyright (c) 2009-2011, 2013, Fabian Greif + * Copyright (c) 2011, 2013, Thorsten Lajewski + * Copyright (c) 2012-2014, 2016, Niklas Hauser + * Copyright (c) 2013, Hans Schily + * Copyright (c) 2014, Daniel Krebs + * Copyright (c) 2015, Niclas Rohrer + * Copyright (c) 2021, Thomas Sommer + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +// ---------------------------------------------------------------------------- + +#ifndef MODM_PAINTER_TEXT_HPP +#define MODM_PAINTER_TEXT_HPP + +#include +#include "canvas.hpp" +#include "painter_flash.hpp" +#include "../font.hpp" + +using namespace modm::shape; + +namespace modm +{ + +/** + * Painter for text with support for IOStream + * + * @tparam R Resolution with Pixels horizontal and vertical + * + * @author Thomas Sommer + * @ingroup modm_ui_graphic + */ +template +class TextPainter : public FlashPainter, public IOStream, virtual public Canvas +{ +protected: + TextPainter() : IOStream(writer), writer(this) + { setFont(modm::font::FixedWidth5x8); } + +public: + Point cursor; + bool auto_linebreak = true; + modm::accessor::Flash font; + + /** + * Write a single character. + */ + void + write(char c); + + /** + * Sets a new font. + * + * @param newFont Active font + * @see modm::font + */ + void + setFont(const uint8_t *font); + + void + setFont(const modm::accessor::Flash *font) + { setFont(font->getPointer()); } + + /** + * Get the width of (null terminated) string with current font + */ + uint16_t + getStringWidth(const char *s) const; + + /** + * Get the width of (null terminated) string for arbitrary font + */ + static uint16_t + getStringWidth(const char *s, const modm::accessor::Flash *font); + +private: + // Interface class for the IOStream + class Writer : public IODevice + { + TextPainter *parent; + public: + Writer(TextPainter *parent) : parent(parent) {} + + virtual void + write(char c) + { this->parent->write(c); } + + using IODevice::write; + + // unused + virtual void + flush() {} + + // unused + virtual bool + read(char&) + { return false; } + }; + + Writer writer; + + static constexpr uint8_t offsetWidthTable = 8; + struct + { + uint8_t height; + uint8_t hspace; + uint8_t vspace; + uint8_t first; + uint8_t count; + + inline void + update(modm::accessor::Flash font) { + height = font[3]; + hspace = font[4]; + vspace = font[5]; + first = font[6]; + count = font[7]; + } + } font_specs; + + void linebreak() + { + cursor.x = 0; + cursor.y += font_specs.height + font_specs.hspace; + } +}; +} // namespace modm + +#include "painter_text_impl.hpp" + +#endif // MODM_PAINTER_TEXT_HPP \ No newline at end of file diff --git a/src/modm/ui/graphic/painter_text_impl.hpp b/src/modm/ui/graphic/painter_text_impl.hpp new file mode 100644 index 0000000000..cd1b76ba38 --- /dev/null +++ b/src/modm/ui/graphic/painter_text_impl.hpp @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2010-2011, 2013, Fabian Greif + * Copyright (c) 2012-2013, Niklas Hauser + * Copyright (c) 2014, Daniel Krebs + * Copyright (c) 2021, Thomas Sommer + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +// ---------------------------------------------------------------------------- + +#ifndef MODM_PAINTER_TEXT_HPP +#error "Don't include this file directly, use 'painter_text.hpp' instead!" +#endif + +template +void +modm::TextPainter::setFont(const uint8_t* font) +{ + if (modm::accessor::asFlash(font).isValid()) + { + this->font = modm::accessor::asFlash(font); + font_specs.update(this->font); + } +} + +template +uint16_t +modm::TextPainter::getStringWidth(const char* s) const +{ + uint16_t width = 0; + + while (*s) + { + width += (*font)[offsetWidthTable + (uint8_t(*s) - font_specs.first)]; + width += font_specs.vspace; + s++; + } + + return width; +} + +template +uint16_t +modm::TextPainter::getStringWidth( + const char* s, const modm::accessor::Flash* font) +{ + uint16_t width = 0; + + const uint8_t vspace = (*font)[5]; + const uint8_t first = (*font)[6]; + + while (*s) + { + width += (*font)[offsetWidthTable + (uint8_t(*s) - first)]; + width += vspace; + s++; + } + + return width; +} + +template +void +modm::TextPainter::write(char character) +{ + if (character == '\n') + { + linebreak(); + return; + } + + if (character == '\t') + { + const uint8_t tab_width = 2 * font_specs.height; + if (cursor.x < R::W + tab_width) + cursor.x += tab_width; + else + linebreak(); + return; + } + + // Character is contained in this font? + if (character < font_specs.first or character >= (font_specs.first + font_specs.count)) + return; + + const uint8_t usedRows = (font_specs.height + 7) / 8; // round up + + const uint8_t position = character - font_specs.first + offsetWidthTable; + const uint8_t width = font[position]; + + uint16_t offset = font_specs.count + offsetWidthTable; + for (uint8_t i = offsetWidthTable; i < position; i++) { offset += font[i] * usedRows; } + + if (auto_linebreak and cursor.x > R::W - width) + linebreak(); + + drawFlash(accessor::asFlash(font.getPointer() + offset), width, font_specs.height, cursor); + + // Add Whitespace + cursor.x += character < 128 ? width + font_specs.vspace : width; +} \ No newline at end of file diff --git a/src/modm/ui/gui.hpp b/src/modm/ui/graphic/style.hpp similarity index 57% rename from src/modm/ui/gui.hpp rename to src/modm/ui/graphic/style.hpp index 10da89d433..fb55f133d1 100644 --- a/src/modm/ui/gui.hpp +++ b/src/modm/ui/graphic/style.hpp @@ -1,7 +1,5 @@ /* - * Copyright (c) 2014, Daniel Krebs - * Copyright (c) 2014, Niklas Hauser - * Copyright (c) 2014, Sascha Schade + * Copyright (c) 2021, Thomas Sommer * * This file is part of the modm project. * @@ -11,8 +9,15 @@ */ // ---------------------------------------------------------------------------- -#include "gui/types.hpp" -#include "gui/colorpalette.hpp" -#include "gui/view_stack.hpp" -#include "gui/view.hpp" -#include "gui/widgets.hpp" +#pragma once + +namespace modm +{ +enum class Style : uint8_t +{ + Outline, + Filled, + // Outline_Dotted, + // Outline_Dashed, +}; +} \ No newline at end of file diff --git a/src/modm/ui/display/image.hpp b/src/modm/ui/image.hpp similarity index 100% rename from src/modm/ui/display/image.hpp rename to src/modm/ui/image.hpp diff --git a/src/modm/ui/display/image/SConscript.generate b/src/modm/ui/image/SConscript.generate similarity index 100% rename from src/modm/ui/display/image/SConscript.generate rename to src/modm/ui/image/SConscript.generate diff --git a/src/modm/ui/display/image/home_16x16.cpp b/src/modm/ui/image/home_16x16.cpp similarity index 100% rename from src/modm/ui/display/image/home_16x16.cpp rename to src/modm/ui/image/home_16x16.cpp diff --git a/src/modm/ui/display/image/home_16x16.hpp b/src/modm/ui/image/home_16x16.hpp similarity index 100% rename from src/modm/ui/display/image/home_16x16.hpp rename to src/modm/ui/image/home_16x16.hpp diff --git a/src/modm/ui/image/image.lb b/src/modm/ui/image/image.lb new file mode 100644 index 0000000000..5f3f6447c4 --- /dev/null +++ b/src/modm/ui/image/image.lb @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Copyright (c) 2021, Thomas Sommer +# +# This file is part of the modm project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# ----------------------------------------------------------------------------- + +def init(module): + module.name = ":ui:image" + module.description = """ +# Image + +Image examples to be written on graphic-displays +""" + +def prepare(module, options): + return True + +def build(env): + env.outbasepath = "modm/src/modm/ui/image" + env.copy(".") + env.copy("../image.hpp") diff --git a/src/modm/ui/display/image/logo_eurobot_90x64.cpp b/src/modm/ui/image/logo_eurobot_90x64.cpp similarity index 100% rename from src/modm/ui/display/image/logo_eurobot_90x64.cpp rename to src/modm/ui/image/logo_eurobot_90x64.cpp diff --git a/src/modm/ui/display/image/logo_eurobot_90x64.hpp b/src/modm/ui/image/logo_eurobot_90x64.hpp similarity index 100% rename from src/modm/ui/display/image/logo_eurobot_90x64.hpp rename to src/modm/ui/image/logo_eurobot_90x64.hpp diff --git a/src/modm/ui/display/image/logo_rca_90x64.cpp b/src/modm/ui/image/logo_rca_90x64.cpp similarity index 100% rename from src/modm/ui/display/image/logo_rca_90x64.cpp rename to src/modm/ui/image/logo_rca_90x64.cpp diff --git a/src/modm/ui/display/image/logo_rca_90x64.hpp b/src/modm/ui/image/logo_rca_90x64.hpp similarity index 100% rename from src/modm/ui/display/image/logo_rca_90x64.hpp rename to src/modm/ui/image/logo_rca_90x64.hpp diff --git a/src/modm/ui/display/image/skull_64x64.cpp b/src/modm/ui/image/skull_64x64.cpp similarity index 100% rename from src/modm/ui/display/image/skull_64x64.cpp rename to src/modm/ui/image/skull_64x64.cpp diff --git a/src/modm/ui/display/image/skull_64x64.hpp b/src/modm/ui/image/skull_64x64.hpp similarity index 100% rename from src/modm/ui/display/image/skull_64x64.hpp rename to src/modm/ui/image/skull_64x64.hpp diff --git a/src/modm/ui/shape.hpp b/src/modm/ui/shape.hpp new file mode 100644 index 0000000000..945423253a --- /dev/null +++ b/src/modm/ui/shape.hpp @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2021, Thomas Sommer + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +// ---------------------------------------------------------------------------- + + +// TODO class or struct for shape-classes? +// https://stackoverflow.com/questions/54585/when-should-you-use-a-class-vs-a-struct-in-c + +// Drawing Shapes without style (yet) +#include "shape/point.hpp" +#include "shape/line.hpp" + +// Drawing Shapes with style +#include "shape/rectangle.hpp" +#include "shape/triangle.hpp" +#include "shape/circle.hpp" +#include "shape/ellipse.hpp" + +// Shapes with special behaviour +#include "shape/area.hpp" diff --git a/src/modm/ui/shape/area.cpp b/src/modm/ui/shape/area.cpp new file mode 100644 index 0000000000..089ef77c18 --- /dev/null +++ b/src/modm/ui/shape/area.cpp @@ -0,0 +1,14 @@ +#include "area.hpp" + +namespace modm::shape +{ +Area::Area(Rectangle rectangle) : topLeft(rectangle.origin), bottomRight(rectangle.origin + rectangle.size) {} + +Area::Area(Circle circle) +{ + Point half_size(circle.radius, circle.radius); + topLeft = circle.center - half_size; + bottomRight = circle.center + half_size; +} + +} // namespace modm::shape \ No newline at end of file diff --git a/src/modm/ui/shape/area.hpp b/src/modm/ui/shape/area.hpp new file mode 100644 index 0000000000..1c84c399d0 --- /dev/null +++ b/src/modm/ui/shape/area.hpp @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2021, Thomas Sommer + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +// ---------------------------------------------------------------------------- + +#pragma once + +#include "point.hpp" +#include "rectangle.hpp" +#include "circle.hpp" + +namespace modm::shape +{ + +// forward declarations for convertion constructors +class Point; +class Rectangle; +class Circle; + +class Area +{ +public: + Point topLeft, bottomRight; + + Area(Point topLeft, Point bottomRight) : topLeft(topLeft), bottomRight(bottomRight) {} + + // Conversion constructors + Area(Rectangle rectangle); + Area(Circle circle); + + Point + getTopLeft() const { + return topLeft; + } + + Point + getBottomRight() const { + return bottomRight; + } + + Point + getTopRight() const { + return {bottomRight.x, topLeft.x}; + } + + Point + getBottomLeft() const { + return {topLeft.x, bottomRight.y}; + } + + uint16_t getWidth() const + { return bottomRight.x - topLeft.x; } + + uint16_t getHeight() const + { return bottomRight.y - topLeft.y; } + + uint32_t getPixels() const + { return getWidth() * getHeight(); } +}; +} // namespace modm::shape \ No newline at end of file diff --git a/src/modm/ui/shape/circle.cpp b/src/modm/ui/shape/circle.cpp new file mode 100644 index 0000000000..6ade675ed3 --- /dev/null +++ b/src/modm/ui/shape/circle.cpp @@ -0,0 +1,10 @@ +#include "circle.hpp" + +namespace modm::shape +{ +Circle::Circle(Rectangle rectangle) +{ + center = rectangle.getCenter(); + radius = std::min(rectangle.size.x, rectangle.size.y); +} +} // namespace modm::shape \ No newline at end of file diff --git a/src/modm/ui/shape/circle.hpp b/src/modm/ui/shape/circle.hpp new file mode 100644 index 0000000000..d9a0ad1bac --- /dev/null +++ b/src/modm/ui/shape/circle.hpp @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021, Thomas Sommer + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +// ---------------------------------------------------------------------------- + +#pragma once + +#include "shape.hpp" +#include "point.hpp" +#include "rectangle.hpp" + +#include +namespace modm::shape +{ + +class Rectangle; +class Circle : public Shape +{ +public: + Point center; + uint16_t radius; + + /** + * @brief Construct a new Circle object + * + * @param center Center of the circle + * @param radius Radius of the circle + */ + Circle(Point center, uint16_t radius) + : center(center), radius(radius) + {} + + // Conversion constructors + Circle(Rectangle rectangle); + + template + Circle(Circle2D &circle2d); +}; +} // namespace modm::shape \ No newline at end of file diff --git a/src/modm/ui/shape/ellipse..cpp b/src/modm/ui/shape/ellipse..cpp new file mode 100644 index 0000000000..bccc8d207b --- /dev/null +++ b/src/modm/ui/shape/ellipse..cpp @@ -0,0 +1,9 @@ +#include "ellipse.hpp" + +namespace modm::shape +{ +Ellipse::Ellipse(Rectangle rectangle) : radius_x(rectangle.size.x / 2), radius_y(rectangle.size.y / 2) +{ + center = rectangle.getCenter(); +} +} // namespace modm::shape \ No newline at end of file diff --git a/src/modm/ui/shape/ellipse.hpp b/src/modm/ui/shape/ellipse.hpp new file mode 100644 index 0000000000..5327af9acb --- /dev/null +++ b/src/modm/ui/shape/ellipse.hpp @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021, Thomas Sommer + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +// ---------------------------------------------------------------------------- + +#pragma once + +#include "shape.hpp" + +#include "rectangle.hpp" +#include "ellipse.hpp" + +namespace modm::shape +{ + +class Rectangle; +class Ellipse; +class Ellipse : public Shape +{ +public: + Point center; + uint16_t radius_x, radius_y; + + Ellipse(Point center, uint16_t radius_x, uint16_t radius_y) + : center(center), radius_x(radius_x), radius_y(radius_y) + {} + + // Conversion constructors + Ellipse(Rectangle circle); + Ellipse(Area area); +}; +} // namespace modm::shape \ No newline at end of file diff --git a/src/modm/ui/shape/line.hpp b/src/modm/ui/shape/line.hpp new file mode 100644 index 0000000000..a3c05971b6 --- /dev/null +++ b/src/modm/ui/shape/line.hpp @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2021, Thomas Sommer + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +// ---------------------------------------------------------------------------- + +#pragma once + +#include "shape.hpp" +#include "area.hpp" + +#include +namespace modm::shape +{ +class Line : public Shape +{ +public: + Point start, end; + + /** + * @brief Construct a new Line object + * + * @param start Start point of the line + * @param end End point of the line + */ + Line(Point start, Point end) : start(start), end(end) {} + + // Convertion + template + Line(Line2D &line2d); + + void + clip(Area area) { + // FIXME Not working when line does not intersect with area at all + + const Point axis = end - start; + start = clipPoint(start, area, axis); + end = clipPoint(end, area, axis); + } + + bool + isHorizontal() const + { return start.y == end.y; } + + bool + isVertical() const + { return start.x == end.x; } + +private: + // Moves point along axis to make it intersect with area + Point + clipPoint(Point point, const Area area, const Point axis) + { + if (point.x < area.topLeft.x) + { + point.y += (area.topLeft.x - point.x) * axis.y / axis.x; + point.x = area.topLeft.x; + } else if (point.x >= area.bottomRight.x) + { + point.y += (area.bottomRight.x - point.x) * axis.y / axis.x; + point.x = area.bottomRight.x - 1; + } + + if (point.y < area.topLeft.y) + { + point.x += (area.topLeft.y - point.y) * axis.x / axis.y; + point.y = area.topLeft.y; + } else if (point.y >= area.bottomRight.y) + { + point.x += (area.bottomRight.y - point.y) * axis.x / axis.y; + point.y = area.bottomRight.y - 1; + } + + return point; + } +}; + +class HLine +{ +public: + Point start; + uint16_t end_x; + + HLine(Point start, uint16_t end_x) : start(start), end_x(end_x) {} + + HLine(Line line) : start(line.start), end_x(line.end.x) {} +}; + +class VLine +{ +public: + Point start; + uint16_t end_y; + + VLine(Point start, uint16_t end_y) : start(start), end_y(end_y) {} + + VLine(Line line) : start(line.start), end_y(line.end.y) {} +}; +} // namespace modm \ No newline at end of file diff --git a/src/modm/ui/shape/point.hpp b/src/modm/ui/shape/point.hpp new file mode 100644 index 0000000000..8ced664f46 --- /dev/null +++ b/src/modm/ui/shape/point.hpp @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2021, Thomas Sommer + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +// ---------------------------------------------------------------------------- + +#pragma once + +#include +#include "shape.hpp" + +namespace modm::shape +{ + +// OPTIMIZE constexpr Vector<>::Vector<>(..) so we can also constexpr Point::Point(..) +class Point : public Vector, public Shape +{ +public: + Point() = default; + + // Allow arbitray arithmetic Types for Point-construction + // This suspresses "narrowing conversion" compiler warnings + template + requires std::is_arithmetic_v and std::is_arithmetic_v + Point(T x, U y) : Vector(x, y){}; + + template + requires std::is_arithmetic_v + Point(Vector vector) : Vector(vector){}; +}; +} // namespace modm::shape \ No newline at end of file diff --git a/src/modm/ui/shape/rectangle.cpp b/src/modm/ui/shape/rectangle.cpp new file mode 100644 index 0000000000..9ebc0e5e13 --- /dev/null +++ b/src/modm/ui/shape/rectangle.cpp @@ -0,0 +1,14 @@ +#include "rectangle.hpp" + +namespace modm::shape +{ +Rectangle::Rectangle(Area area): origin(area.topLeft), size(area.bottomRight - area.topLeft) {} + +Rectangle::Rectangle(Circle circle) +{ + Point half_size(circle.radius, circle.radius); + origin = circle.center - half_size; + size = 2 * half_size; +} + +} // namespace modm::shape \ No newline at end of file diff --git a/src/modm/ui/shape/rectangle.hpp b/src/modm/ui/shape/rectangle.hpp new file mode 100644 index 0000000000..4b3505e2b7 --- /dev/null +++ b/src/modm/ui/shape/rectangle.hpp @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2021, Thomas Sommer + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +// ---------------------------------------------------------------------------- + +#pragma once + +#include "shape.hpp" + +#include "point.hpp" +#include "area.hpp" +#include "circle.hpp" + +namespace modm::shape +{ + +// forward declarations for convertion constructors +class Point; +class Area; +class Circle; + +class Rectangle : public Shape +{ +public: + Point origin, size; + + /** + * @brief Construct a new Rectangle object + * + * @param origin Top left corner of the Rectangle + * @param size Size x and y of the Rectangle + */ + Rectangle(Point origin, Point size) : origin(origin), size(size) {} + + // Conversion constructors + Rectangle(Area area); + Rectangle(Circle circle); + + Point + getBottomRight() const { + return origin + size; + } + + Point + getCenter() const { + return origin + size / 2; + } +}; +} // namespace modm::shape \ No newline at end of file diff --git a/src/modm/ui/shape/shape.hpp b/src/modm/ui/shape/shape.hpp new file mode 100644 index 0000000000..3319c0a836 --- /dev/null +++ b/src/modm/ui/shape/shape.hpp @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021, Thomas Sommer + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +// ---------------------------------------------------------------------------- + +#pragma once + +namespace modm::shape +{ + +// Baseclass to all shapes to make them containerable +// Work in progress... not yet thought to the end +class Shape +{ +protected: + Shape() = default; +}; + +} // namespace modm::shape \ No newline at end of file diff --git a/src/modm/ui/shape/shape.lb b/src/modm/ui/shape/shape.lb new file mode 100644 index 0000000000..c3622cbb10 --- /dev/null +++ b/src/modm/ui/shape/shape.lb @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Copyright (c) 2021, Thomas Sommer +# +# This file is part of the modm project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# ----------------------------------------------------------------------------- + +def init(module): + module.name = ":ui:shape" + module.description = """ +# Shape + +Primitive geometric shapes like Point, Line, Rectangle, Circle, Ellipse, ... +""" + +def prepare(module, options): + module.depends(":math:geometry") + return True + +def build(env): + env.outbasepath = "modm/src/modm/ui/shape" + env.copy(".") + env.copy("../shape.hpp") diff --git a/src/modm/ui/shape/triangle.hpp b/src/modm/ui/shape/triangle.hpp new file mode 100644 index 0000000000..b0ea938f4b --- /dev/null +++ b/src/modm/ui/shape/triangle.hpp @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021, Thomas Sommer + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +// ---------------------------------------------------------------------------- + +#pragma once + +#include "shape.hpp" + +namespace modm::shape +{ +class Triangle : public Shape +{ +public: + Point a, b, c; + + Triangle(Point a, Point b, Point c) : a(a), b(b), c(c) {} +}; +} // namespace modm \ No newline at end of file