iColorO.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
18 #ifndef ICOLORO_H
19 #define ICOLORO_H
20 
21 #include <colorUtils.h>
22 #include <boost/signals2.hpp>
23 
24 class IColorO
25 {
26 public:
27  IColorO() : _initialized(false), _invertMask(0), _num_leds(1){;}
28  virtual ~IColorO(){;}
29 
30  virtual bool init() = 0;
31  virtual void setColor(color::rgba color) = 0;
32  virtual void setColorMulti(std::vector<color::rgba> &colors) = 0;
33 
34  void setMask(int mask){ _invertMask = mask; }
35  void setNumLeds(size_t num_leds){ _num_leds = num_leds; }
36  int getNumLeds(){ return _num_leds; }
37 
38  boost::signals2::signal<void (color::rgba color)>* signalColorSet(){ return &m_sigColorSet; }
39  boost::signals2::signal<void (std::vector<color::rgba> colors) >* signalColorsSet(){ return &m_sigColorsSet; }
40 
41 protected:
44  int _num_leds;
45  boost::signals2::signal<void (color::rgba color)> m_sigColorSet;
46  boost::signals2::signal<void (std::vector<color::rgba> colors) > m_sigColorsSet;
47 };
48 
49 #endif
void setNumLeds(size_t num_leds)
Definition: iColorO.h:35
virtual bool init()=0
int getNumLeds()
Definition: iColorO.h:36
boost::signals2::signal< void(color::rgba color)> * signalColorSet()
Definition: iColorO.h:38
void setMask(int mask)
Definition: iColorO.h:34
boost::signals2::signal< void(std::vector< color::rgba > colors) > * signalColorsSet()
Definition: iColorO.h:39
virtual ~IColorO()
Definition: iColorO.h:28
int _num_leds
Definition: iColorO.h:44
boost::signals2::signal< void(color::rgba color)> m_sigColorSet
Definition: iColorO.h:45
virtual void setColorMulti(std::vector< color::rgba > &colors)=0
virtual void setColor(color::rgba color)=0
int _invertMask
Definition: iColorO.h:43
bool _initialized
Definition: iColorO.h:42
boost::signals2::signal< void(std::vector< color::rgba > colors) > m_sigColorsSet
Definition: iColorO.h:46
IColorO()
Definition: iColorO.h:27


cob_light
Author(s): Benjamin Maidel
autogenerated on Wed Apr 7 2021 02:11:39