The Fib multimedia system
Fib is a system for storing multimedia data (like images or films).
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
cImageAreaSameColor.h
Go to the documentation of this file.
1 /**
2  * @file cImageAreaSameColor
3  * file name: cImageAreaSameColor.h
4  * @author Betti Oesterholz
5  * @date 23.10.2012
6  * @mail Oesterholz@Fib-development.org
7  *
8  * System: C++
9  *
10  * This header specifies a class to store the data of a same colored area
11  * in an image.
12  *
13  * Copyright (C) @c GPL3 2012 Betti Oesterholz
14  *
15  * This program is free software: you can redistribute it and/or modify
16  * it under the terms of the GNU General Public License (GPL) as
17  * published by the Free Software Foundation, either version 3 of the
18  * License, or any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  * GNU Lesser General Public License for more details.
24  *
25  * This header specifies a class to store the data of a same colored area
26  * in an image.
27  * If you want to convert an image to Fib structures, you have to search
28  * the image for structures, which can be converted to Fib.
29  * If you have a area with one color, you can use this class to represent it.
30  */
31 /*
32 History:
33 23.10.2012 Oesterholz created
34 */
35 
36 
37 #ifndef ___C_IMAGE_ARAE_SAME_COLOR_H__
38 #define ___C_IMAGE_ARAE_SAME_COLOR_H__
39 
40 #include "version.h"
41 
42 #include "cImageStructure.h"
43 
46 
47 #include "cVectorProperty.h"
48 
49 
50 namespace fib{
51 
52 namespace algorithms{
53 
54 namespace nConvertToFib{
55 
56 namespace nImage{
57 
58 namespace nStructureData{
59 
60 
64 protected:
65 
66 
67  /**
68  * The color of the area.
69  * @see getColorOfArea()
70  * @see setColorOfArea()
71  */
73 
74 public:
75 
76  /**
77  * standard constructor
78  *
79  * @param vecInColor the color the area has
80  */
81  cImageAreaSameColor( const cVectorProperty & vecInColor );
82 
83  /**
84  * copy constructor
85  *
86  * @param structureToCopy the image structure to copy
87  */
88  cImageAreaSameColor( const cImageAreaSameColor & structureToCopy );
89 
90 
91  /**
92  * destructor
93  */
94  virtual ~cImageAreaSameColor();
95 
96 
97  /**
98  * @return the name of the image structure (class name without the leading 'c')
99  */
100  virtual string getName() const;
101 
102  /**
103  * @see vecColor
104  * @see setColorOfArea()
105  * @return the color the area has
106  */
108 
109  /**
110  * @see vecColor
111  * @see setColorOfArea()
112  * @return the color the area has
113  */
114  const cVectorProperty & getColorOfAreaConst() const;
115 
116  /**
117  * This method sets the color the area has to the given color.
118  *
119  * @see vecColor
120  * @see getColorOfArea()
121  * @param vecInColor the color the area should have
122  */
123  void setColorOfArea( const cVectorProperty & vecInColor );
124 
125 
126  //methods of iConvertImageStructureToFib
127 
128  /**
129  * This method is for converting data to a Fib object.
130  *
131  * @return a Fib-object which represents the data of this object
132  * Beware: You have to delete the returned Fib object after usage.
133  */
134  virtual cRoot * convertToFib() const;
135 
136  /**
137  * This method is for converting data to a Fib object.
138  *
139  * @param pImageSearchData a pointer to the image search data of found
140  * image parts, which will overwrite tile parts
141  * (the tiles can be bigger, because some parts of them won't be seen)
142  * @param maxValue the maximum possible value in all parameters
143  * the evalued spline/function elements will allways have value
144  * parameters vecFactors[i] with
145  * -1 * maxValue <= vecFactors[i] <= maxValue for 0 <= i < vecFactors.size();
146  * if 0 (standard value) is given, the maximum possible value will
147  * be evalued from the given data (absolute maximum in given data * 256)
148  * @param ulMaxErrorPerPoint the maximal error of a point or
149  * the maximal distance a point can be outside the area and the
150  * search area
151  * @return a Fib-object which represents the data of this object
152  * Beware: You have to delete the returned Fib object after usage.
153  * Also the given root element will contain no domains, you have to
154  * create them if needed (eg. with cRoot::generateNeededDomains() ).
155  */
156  virtual cRoot * convertToFib( const cImageSearchData * pImageSearchData,
157  const double maxValue = 65536.0, const unsigned long ulMaxErrorPerPoint = 0.0 ) const;
158 
159 };//class cImageAreaSameColor
160 
161 
162 };//end namespace nStructureData
163 };//end namespace nImage
164 };//end namespace nConvertToFib
165 };//end namespace algorithms
166 };//end namespace fib
167 
168 
169 #endif //___C_IMAGE_ARAE_SAME_COLOR_H__
170 
171