Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ConvertBayerPattern.hh
1 /*
2 This file is part of the BIAS library (Basic ImageAlgorithmS).
3 
4 Copyright (C) 2003-2009 (see file CONTACT for details)
5  Multimediale Systeme der Informationsverarbeitung
6  Institut fuer Informatik
7  Christian-Albrechts-Universitaet Kiel
8 
9 
10 BIAS is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14 
15 BIAS is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU Lesser General Public License for more details.
19 
20 You should have received a copy of the GNU Lesser General Public License
21 along with BIAS; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24 
25 #ifndef __ConvertBayerPattern_hh__
26 #define __ConvertBayerPattern_hh__
27 
28 #include <bias_config.h>
29 
30 #include <iostream>
31 
32 #include <Base/Debug/Debug.hh>
33 #include <Base/Debug/Error.hh>
34 
35 #include <Base/Math/Matrix.hh>
36 #include <Base/Math/Vector.hh>
37 #include <Base/Image/Image.hh>
38 #include <Base/Image/ImageConvert.hh>
39 
40 //#if !defined(WIN32) && !defined(BIAS_HAVE_DC1394)
41 //# error You need DC1394 for BIAS ConvertBayerPattern. Please recompile BIAS with USE_DC1394.
42 //#endif
43 
44 #include <dc1394/dc1394.h>
45 #include <dc1394/conversions.h>
46 
47 
48 
49 namespace BIAS {
50 
51  /** @class ConvertBayerPattern
52  @brief Wrapper class to dc1394 bayer conversion class
53 
54  @author bangerer 03/2009
55  */
56  template <class StorageType>
57 class BIASImage_EXPORT ConvertBayerPattern
58  : public Debug {
59 
60  public:
63 
64  /**
65  * @brief converts image with bayerpattern to rgb. there are several
66  * methods for conversion.
67  * @param src source image with bayer pattern
68  * @param dst destination image in rgb
69  * @param method the demosaic method that should be used
70  * @param bayer_pattern this parameter is optional. bayer pattern of the source image
71  */
72  int Convert(Image<StorageType>& src, Image<StorageType>& dst,
75 
76  private:
77  dc1394bayer_method_t SelectMethod_(BayerDemosaicMethod method);
78 
79  dc1394color_filter_t SelectFilter_(ImageBase::EColorModel bayer_pattern);
80  }; // class
81 
82 } // namespace
83 
84 #endif
85 
86 //#include <Base/Common/BIASpragmaEnd.hh>
EColorModel
These are the most often used color models.
Definition: ImageBase.hh:127
Wrapper class to dc1394 bayer conversion class.
BayerDemosaicMethod
methods for conversion from bayer to rgb
Definition: ImageConvert.hh:70
The image template class for specific storage types.
Definition: Image.hh:78
invalid (not set) image format
Definition: ImageBase.hh:129