Image Component Library (ICL)
LUTOp.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 : ICLFilter/src/ICLFilter/LUTOp.h **
10 ** Module : ICLFilter **
11 ** Authors: Christof Elbrechter, Andre Justus **
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 <ICLUtils/Uncopyable.h>
35 #include <ICLCore/Img.h>
36 #include <ICLFilter/UnaryOp.h>
37 #include <vector>
38 
39 namespace icl {
40  namespace filter{
41 
43 
69  class ICLFilter_API LUTOp : public UnaryOp, public utils::Uncopyable{
70  public:
72 
73  LUTOp(const std::vector<icl8u> &lut);
74 
76 
77  LUTOp(icl8u quantizationLevels=255);
78 
80  virtual ~LUTOp(){}
81 
83 
86  virtual void apply(const core::ImgBase *src, core::ImgBase **dst);
87 
89  using UnaryOp::apply;
90 
92 
96  static void simple(const core::Img8u *src, core::Img8u *dst, const std::vector<icl8u>& lut);
97 
99 
103  static void reduceBits(const core::Img8u *src, core::Img8u *dst, icl8u levels);
104 
106 
107  void setLUT(const std::vector<icl8u> &lut);
108 
110 
111  void setQuantizationLevels(int levels);
112 
114  icl8u getQuantizationLevels() const;
115 
117  const std::vector<icl8u> &getLUT() const;
118 
120  bool isLUTSet() const;
121 
123  bool isLevelsSet() const;
124 
125  private:
127  bool m_bLutSet;
128  std::vector<icl8u> m_vecLUT;
131 
132  };
133  } // namespace filter
134 } // namespace icl
135 
undocument this line if you encounter any issues!
Definition: Any.h:37
Class interface for un-copyable classes.
Definition: Uncopyable.h:64
Ipp8u icl8u
8Bit unsigned integer type for the ICL
Definition: BasicTypes.h:64
std::vector< icl8u > m_vecLUT
Definition: LUTOp.h:128
class for applying table lookup transformation to Img8u images
Definition: LUTOp.h:69
ICLQt_API ImgQ levels(const ImgQ &image, icl8u levels)
reduces an images quantisation levels
bool m_bLevelsSet
Definition: LUTOp.h:126
virtual ~LUTOp()
destructor
Definition: LUTOp.h:80
Abstract Base class for Unary Operators.
Definition: UnaryOp.h:51
ICLQt_API core::Img< T > filter(const core::Img< T > &image, const std::string &filter)
applies a filter operation on the source image (affinity for float)
core::Img8u * m_poBuffer
Definition: LUTOp.h:130
icl8u m_ucQuantizationLevels
Definition: LUTOp.h:129
bool m_bLutSet
Definition: LUTOp.h:127
#define ICLFilter_API
Definition: CompatMacros.h:175
virtual void apply(const core::ImgBase *operand1, core::ImgBase **dst)=0
pure virtual apply function, that must be implemented in all derived classes
ImgBase is the Image-Interface class that provides save access to underlying Img-template .
Definition: ImgBase.h:131