modm API documentation
monochrome_graphic_display_horizontal.hpp
1 /*
2  * Copyright (c) 2019, Fabian Greif
3  *
4  * This file is part of the modm project.
5  *
6  * This Source Code Form is subject to the terms of the Mozilla Public
7  * License, v. 2.0. If a copy of the MPL was not distributed with this
8  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9  */
10 
11 #ifndef MODM_MONOCHROME_GRAPHIC_DISPLAY_HORIZONTAL_HPP
12 #define MODM_MONOCHROME_GRAPHIC_DISPLAY_HORIZONTAL_HPP
13 
14 #include <stdlib.h>
15 
16 #include "monochrome_graphic_display.hpp"
17 
18 namespace modm
19 {
20 /**
21  * Base class for monochrome graphical displays with a RAM buffer.
22  *
23  * The pixel are compressed horizontally, this means that 8 pixel in
24  * y-direction are combined into one byte in the RAM buffer.
25  *
26  * Every operation works on the internal RAM buffer, therefore the content
27  * of the real display is not changed until a call of update().
28  *
29  * \tparam Width Width of the display. Must be a multiple of 8!
30  * \tparam Height Height of the display.
31  *
32  * \ingroup modm_ui_display
33  */
34 template<int16_t Width, int16_t Height>
36  : public MonochromeGraphicDisplay<Width, Height, Width / 8, Height>
37 {
38  // Height must be a multiple of 8
39  static_assert((Width % 8) == 0, "width must be a multiple of 8");
40 
41 public:
42  virtual ~MonochromeGraphicDisplayHorizontal() = default;
43 
44 protected:
45  void
46  setPixel(int16_t x, int16_t y) final;
47 
48  void
49  clearPixel(int16_t x, int16_t y) final;
50 
51  bool
52  getPixel(int16_t x, int16_t y) const final;
53 };
54 } // namespace modm
55 
56 #include "monochrome_graphic_display_horizontal_impl.hpp"
57 
58 #endif // MODM_MONOCHROME_GRAPHIC_DISPLAY_HORIZONTAL_HPP
void clearPixel(int16_t x, int16_t y) final
void setPixel(int16_t x, int16_t y) final
Definition: monochrome_graphic_display.hpp:40
Definition: monochrome_graphic_display_horizontal.hpp:35