Image Component Library (ICL)
PseudoColorConverter.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLCore/src/ICLCore/PseudoColorConverter.h **
10 ** Module : ICLCore **
11 ** Authors: Christof Elbrechter **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 
33 #include <ICLUtils/CompatMacros.h>
34 #include <ICLCore/Color.h>
35 #include <ICLCore/Img.h>
36 
37 namespace icl{
38  namespace core{
39 
41 
46  enum ColorTable{
48  Custom
49  };
50 
52  struct ICLCore_API Stop{
53  Stop(float relPos=0, const Color &color=Color(0,0,0)):
54  relPos(relPos),color(color){}
55  float relPos;
57  };
58 
60 
61  PseudoColorConverter(int maxValue=255);
62 
64 
65  PseudoColorConverter(const std::vector<Stop> &stops, int maxValue=255) ;
66 
68 
80  void setColorTable(ColorTable t, const std::vector<Stop> &stops=std::vector<Stop>(), int maxValue=255)
81  ;
82 
84  void apply(const ImgBase *src, ImgBase **dst) ;
85 
87  void apply(const Img8u &src, Img8u &dst);
88 
90  const Img8u &apply(const Img8u &src);
91 
93  void save(const std::string &filename);
94 
96  void load(const std::string &filename);
97 
98  private:
99 
101  struct Data;
102 
104  Data *m_data;
105  };
106 
107  } // namespace core
108 }
109 
ICLQt_API void save(const core::ImgBase &image, const std::string &filename)
write an image to HD
undocument this line if you encounter any issues!
Definition: Any.h:37
math::FixedColVector< icl8u, 3 > Color
Default color type of the ICL.
Definition: Color.h:42
ColorTable
mode internally used
Definition: PseudoColorConverter.h:46
ICLQt_API core::Img< T > load(const std::string &filename)
load an image file read file (affinity for floats)
default mode using default gradient
Definition: PseudoColorConverter.h:47
Utility class for speudocolor conversion.
Definition: PseudoColorConverter.h:44
Data * m_data
Internally used data pointer.
Definition: PseudoColorConverter.h:101
Color color
color
Definition: PseudoColorConverter.h:56
ICLQt_API void color(float r, float g=-1, float b=-1, float alpha=255)
sets the current color to given r,g,b,alpha value
Stop(float relPos=0, const Color &color=Color(0, 0, 0))
Definition: PseudoColorConverter.h:53
float relPos
relative pos [0,1]
Definition: PseudoColorConverter.h:55
ImgBase is the Image-Interface class that provides save access to underlying Img-template .
Definition: ImgBase.h:131
This is for creation of color gradients.
Definition: PseudoColorConverter.h:52
#define ICLCore_API
Definition: CompatMacros.h:174