Image Component Library (ICL)
QImageConverter.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 : ICLQt/src/ICLQt/QImageConverter.h **
10 ** Module : ICLQt **
11 ** Authors: Christof Elbrechter, Robert Haschke **
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/Types.h>
35 
36 // forward declared QImage class
37 class QImage;
38 
39 namespace icl{
40  namespace qt{
41 
43 
85  public:
88 
90  QImageConverter(const core::ImgBase *image);
91 
93  QImageConverter(const QImage *qimage);
94 
96 
99  ~QImageConverter();
100 
102 
106  const QImage *getQImage();
107 
109 
113  const core::ImgBase *getImgBase(core::depth d=core::depth8u);
114 
115 
117  template<class T>
118  const core::Img<T> *getImg();
119 
121 
124  void setImage(const core::ImgBase *image);
125 
127 
130  void setQImage(const QImage *qimage);
131 
133 
135  void setUseSpeudoColors(bool use);
136 
137  private:
138 
140  enum State{ given=0,
141  uptodate=1,
142  undefined=2
143  };
144 
146  core::ImgBase *m_apoBuf[5];
147 
149  QImage *m_poQBuf;
150 
152  State m_aeStates[5];
153 
156 
158  bool m_usePC;
159  };
160  } // namespace qt
161 }
162 
undocument this line if you encounter any issues!
Definition: Any.h:37
State
internal used state struct
Definition: QImageConverter.h:140
bool m_usePC
use pseudo colors
Definition: QImageConverter.h:158
class for conversion between QImage and core::ImgBase/Img<T>
Definition: QImageConverter.h:84
Definition: Types.h:61
State m_eQImageState
internal state buffer for the QImage buffer
Definition: QImageConverter.h:155
QImage * m_poQBuf
internal qimage buffer
Definition: QImageConverter.h:149
depth
determines the pixel type of an image (8Bit-int or 32Bit-float)
Definition: Types.h:60
#define ICLQt_API
Definition: CompatMacros.h:178
ImgBase is the Image-Interface class that provides save access to underlying Img-template .
Definition: ImgBase.h:131