Rpi-hw  0.7.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
pcd8544-inl.hpp
1 /*
2  Title --- display/pcd8544-inl.hpp
3 
4  Copyright (C) 2013 Giacomo Trudu - wicker25[at]gmail[dot]com
5 
6  This file is part of Rpi-hw.
7 
8  Rpi-hw is free software: you can redistribute it and/or modify
9  it under the terms of the GNU Lesser General Public License as published by
10  the Free Software Foundation version 3 of the License.
11 
12  Rpi-hw is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public License
18  along with Rpi-hw. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 
22 #ifndef _RPI_HW_DISPLAY_PCD8544_INL_HPP_
23 #define _RPI_HW_DISPLAY_PCD8544_INL_HPP_
24 
25 namespace rpihw { // Begin main namespace
26 
27 namespace display { // Begin displays namespace
28 
29 inline void
30 pcd8544::setColor( bool color ) {
31 
32  // Set the foreground color
33  setPenColor( { color } );
34 }
35 
36 inline bool
38 
39  // Set the foreground color
40  return getPenColor()[0];
41 }
42 
43 inline void
44 pcd8544::setPixel( int8_t x, int8_t y, bool color ) {
45 
46  // Set the pixel color
47  std::vector< bool > c = { color };
48  drawPixel( x, y, std::begin( c ) );
49 }
50 
51 } // End of displays namespace
52 
53 } // End of main namespace
54 
55 #endif /* _RPI_HW_DISPLAY_PCD8544_INL_HPP_ */
void setColor(bool color)
Sets the foreground color.
Definition: pcd8544-inl.hpp:30
virtual void drawPixel(int8_t x, int8_t y, color_iterator< bool > color)
Sets the color of a pixel.
bool getColor() const
Gets the current foreground color.
Definition: pcd8544-inl.hpp:37
void setPenColor(const std::vector< bool > &color)
Sets the pen color.
void setPixel(int8_t x, int8_t y, bool color)
Sets the color of a pixel.
Definition: pcd8544-inl.hpp:44
const std::vector< bool > & getPenColor() const
Gets the current pen color.