| MikroCAD SDK Library

- Home
- All Types
- Files

All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
MC3DDataExport.h
Go to the documentation of this file.
1 /**
2 * @file MC3DDataExport.h
3 * @brief Function prototypes for data export functions
4 *
5 * @author LMI Technologies
6 */
7
8 #ifndef _MC3DDataExport_h
9 #define _MC3DDataExport_h
10
11 #if defined(WIN32) || defined(WIN64)
12 # include <windows.h>
13 #endif
14
15 #include "MC3DDefs.h"
16
17 #if defined(WIN32) || defined(WIN64)
18 # define MC3D_EXPORT __declspec(dllexport)
19 #else
20 # define MC3D_EXPORT
21 #endif
22
23 #ifdef __cplusplus
24 extern "C"
25 {
26 #endif
27
28 /**
29 Scale short array to byte array.
30 Invalid values are becoming byInvalidValue (default 0), valid based on scale are between 1 and 255
31
32 @param pnData Input data array
33 @param pbValid Input valid array
34 @param pbyData Output data array
35 @param nSizeX Size in X
36 @param nSizeY Size in Y
37 @param nFactor Scaling factor used for scaling
38 @param nOfs Offset used for scaling
39 @param byInvalidValue Value for invalid points
40 @return Success (true) or failure
41 */
42 MC3D_EXPORT bool __cdecl MC3D_ShortArrayToByteArrayRel(
43 short *pnData,
44 bool *pbValid,
45 unsigned char *pbyData,
46 short nSizeX,
47 short nSizeY,
48 int& nFactor,
49 int& nOfs,
50 unsigned char byInvalidValue = 0);
51
52 /**
53 Scale short array to byte array based on given minimum and maximum
54 Invalid values are becoming byInvalidValue (default 0), valid based on scale are between 1 and 255
55
56 @param pnData Input data array
57 @param pbValid Input valid array
58 @param pbyData Output data array
59 @param nSizeX Size in X
60 @param nSizeY Size in Y
61 @param nMinimum Minimum used for scaling
62 @param nMaximum Maximum used for scaling
63 @param byInvalidValue Value for invalid points
64 @return Success (true) or failure
65 */
66 MC3D_EXPORT bool __cdecl MC3D_ShortArrayToByteArray(
67 short *pnData,
68 bool *pbValid,
69 unsigned char *pbyData,
70 short nSizeX,
71 short nSizeY,
72 short nMinimum,
73 short nMaximum,
74 unsigned char byInvalidValue = 0);
75
76 /**
77 Shrinks a short array by an given factor
78
79 @param pnOut Output data array
80 @param pnIn Input data array
81 @param pbValidOut Output valid array
82 @param pbValidIn Input valid array
83 @param nSizeX Size in X
84 @param nSizeY Size in Y
85 @param nShrinkFactor Shrink factor
86 @return Success (true) or failure
87 */
88 MC3D_EXPORT bool __cdecl MC3D_ShrinkDataArrayShort(
89 short *pnOut,
90 short *pnIn,
91 bool *pbValidOut,
92 bool *pbValidIn,
93 short nSizeX,
94 short nSizeY,
95 short nShrinkFactor);
96
97
98 /**
99 Shrinks a byte array by an given factor
100
101 @param pbyOut Output data array
102 @param pbyIn Input data array
103 @param pbValidOut Output valid array
104 @param pbValidIn Input valid array
105 @param nSizeX Size in X
106 @param nSizeY Size in Y
107 @param nShrinkFactor Shrink factor
108 @return Success (true) or failure
109 */
110 MC3D_EXPORT bool __cdecl MC3D_ShrinkDataArrayByte(
111 unsigned char *pbyOut,
112 unsigned char *pbyIn,
113 bool *pbValidOut,
114 bool *pbValidIn,
115 short nSizeX,
116 short nSizeY,
117 short nShrinkFactor);
118
119 /**
120 Does a range analysis off an array of long
121
122 @param plData Input data array
123 @param pnRanges Output, number of ranges
124 @param nSizeX Size in X
125 @param nSizeY Size in Y
126 @param lLowerLimit Lower limit
127 @param lUpperLimit Upper limit
128 @param EvalMode Evaluation mode, see eRangeAnalysisEvalMode
129 @return Number of ranges or negative in case of an error
130 */
131 MC3D_EXPORT int __cdecl MC3D_RangeAnalysisLong(
132 long *plData,
133 int *pnRanges,
134 short nSizeX,
135 short nSizeY,
136 long lLowerLimit,
137 int lUpperLimit,
138 eRangeAnalysisEvalMode EvalMode);
139
140 /**
141 Does a range analysis of an array of short
142
143 @param pnData Input data array
144 @param pnRanges Output, number of ranges
145 @param nSizeX Size in X
146 @param nSizeY Size in Y
147 @param nLowerLimit Lower limit
148 @param nUpperLimit Upper limit
149 @param EvalMode Evaluation mode, see eRangeAnalysisEvalMode
150 @return Number of ranges or negative in case of an error
151 */
152 MC3D_EXPORT int __cdecl MC3D_RangeAnalysisShort(
153 short *pnData,
154 int *pnRanges,
155 short nSizeX,
156 short nSizeY,
157 short nLowerLimit,
158 short nUpperLimit,
159 eRangeAnalysisEvalMode EvalMode);
160
161 /**
162 Does a range analysis of an array of float
163
164 @param pfData Input data array
165 @param pnRanges Output, number of ranges
166 @param nSizeX Size in X
167 @param nSizeY Size in Y
168 @param fLowerLimit Lower limit
169 @param fUpperLimit Upper limit
170 @param EvalMode Evaluation mode, see eRangeAnalysisEvalMode
171 @return Number of ranges or negative in case of an error
172 */
173 MC3D_EXPORT int __cdecl MC3D_RangeAnalysisFloat(
174 float *pfData,
175 int *pnRanges,
176 short nSizeX,
177 short nSizeY,
178 float fLowerLimit,
179 float fUpperLimit,
180 eRangeAnalysisEvalMode EvalMode);
181
182 /**
183 Does a range analysis of an array of double
184
185 @param pdData Input data array
186 @param pnRanges Output, number of ranges
187 @param nSizeX Size in X
188 @param nSizeY Size in Y
189 @param dLowerLimit Lower limit
190 @param dUpperLimit Upper limit
191 @param EvalMode Evaluation mode, see eRangeAnalysisEvalMode
192 @return Number of ranges or negative in case of an error
193 */
194 MC3D_EXPORT int __cdecl MC3D_RangeAnalysisDouble(
195 double *pdData,
196 int *pnRanges,
197 short nSizeX,
198 short nSizeY,
199 double dLowerLimit,
200 double dUpperLimit,
201 eRangeAnalysisEvalMode EvalMode);
202
203 /**
204 Calculates the inverse of a double matrix
205
206 @param pdMatrix Input matrix
207 @param pdInvMatrix Output inverted matrix
208 @param nSize Number of rows and columns
209 @return Success (true) or failure
210 */
211 MC3D_EXPORT bool __cdecl MC3D_InverseMatrix(
212 double *pdMatrix,
213 double *pdInvMatrix,
214 int nSize);
215
216 /**
217 Calculates the inverse of a float matrix
218
219 @param pfMatrix Input matrix
220 @param pfInvMatrix Output inverted matrix
221 @param nSize Number of rows and columns
222 @return Success (true) or failure
223 */
224 MC3D_EXPORT bool __cdecl MC3D_InverseMatrixFloat(
225 float *pfMatrix,
226 float *pfInvMatrix,
227 int nSize);
228
229 /**
230 Calculates a sinus and cosine table, used for FFT
231
232 @param pdCosTab Output cosine table
233 @param pdSinTab Output sinus table
234 @param lSize Size of table
235 @param bSinNegative Is sin negative (inverted at x axis)
236 @return Success (true) or failure
237 */
238 MC3D_EXPORT bool __cdecl MC3D_CreateSinusCosinusTable(
239 double *pdCosTab,
240 double *pdSinTab,
241 long lSize,
242 bool bSinNegative);
243
244 /**
245 Fast Fourier transformation
246
247 @param pdCosValue Output cosine values
248 @param pdSinValue Output sinus values
249 @param pdCosTab Input cosine table
250 @param pdSinTab Input sinus table
251 @param lSize Size of table
252 @return Success (true) or failure
253 */
254 MC3D_EXPORT bool __cdecl MC3D_FastFourierTrafo(
255 double *pdCosValue,
256 double *pdSinValue,
257 double *pdCosTab,
258 double *pdSinTab,
259 long lSize);
260
261 /**
262 Fast Fourier transformation in a plane
263
264 @param pfRealVal Real values
265 @param pfImagVal Imaginary values
266 @param nSizeX Size in X
267 @param nSizeY Size in Y
268 @param Direction Filter direction
269 @param bBackTrafo True if back transformation, otherwise false
270 @return Success (true) or failure
271 */
272 MC3D_EXPORT bool __cdecl MC3D_FastFourierTrafo2D(
273 float *pfRealVal,
274 float *pfImagVal,
275 short nSizeX,
276 short nSizeY,
277 eMC3DFilterDirection Direction,
278 bool bBackTrafo);
279
280 #ifdef __cplusplus
281 }
282 #endif
283
284 #endif // _MC3DDataExport_h
MC3D_ShortArrayToByteArray
MC3D_EXPORT bool __cdecl MC3D_ShortArrayToByteArray(short *pnData, bool *pbValid, unsigned char *pbyData, short nSizeX, short nSizeY, short nMinimum, short nMaximum, unsigned char byInvalidValue=0)
Scale short array to byte array based on given minimum and maximum Invalid values are becoming byInva...
MC3D_RangeAnalysisLong
MC3D_EXPORT int __cdecl MC3D_RangeAnalysisLong(long *plData, int *pnRanges, short nSizeX, short nSizeY, long lLowerLimit, int lUpperLimit, eRangeAnalysisEvalMode EvalMode)
Does a range analysis off an array of long.
MC3D_ShortArrayToByteArrayRel
MC3D_EXPORT bool __cdecl MC3D_ShortArrayToByteArrayRel(short *pnData, bool *pbValid, unsigned char *pbyData, short nSizeX, short nSizeY, int &nFactor, int &nOfs, unsigned char byInvalidValue=0)
Scale short array to byte array.
MC3D_FastFourierTrafo2D
MC3D_EXPORT bool __cdecl MC3D_FastFourierTrafo2D(float *pfRealVal, float *pfImagVal, short nSizeX, short nSizeY, eMC3DFilterDirection Direction, bool bBackTrafo)
Fast Fourier transformation in a plane.
MC3D_CreateSinusCosinusTable
MC3D_EXPORT bool __cdecl MC3D_CreateSinusCosinusTable(double *pdCosTab, double *pdSinTab, long lSize, bool bSinNegative)
Calculates a sinus and cosine table, used for FFT.
MC3D_RangeAnalysisShort
MC3D_EXPORT int __cdecl MC3D_RangeAnalysisShort(short *pnData, int *pnRanges, short nSizeX, short nSizeY, short nLowerLimit, short nUpperLimit, eRangeAnalysisEvalMode EvalMode)
Does a range analysis of an array of short.
MC3D_FastFourierTrafo
MC3D_EXPORT bool __cdecl MC3D_FastFourierTrafo(double *pdCosValue, double *pdSinValue, double *pdCosTab, double *pdSinTab, long lSize)
Fast Fourier transformation.
MC3D_InverseMatrixFloat
MC3D_EXPORT bool __cdecl MC3D_InverseMatrixFloat(float *pfMatrix, float *pfInvMatrix, int nSize)
Calculates the inverse of a float matrix.
MC3D_ShrinkDataArrayByte
MC3D_EXPORT bool __cdecl MC3D_ShrinkDataArrayByte(unsigned char *pbyOut, unsigned char *pbyIn, bool *pbValidOut, bool *pbValidIn, short nSizeX, short nSizeY, short nShrinkFactor)
Shrinks a byte array by an given factor.
MC3D_RangeAnalysisDouble
MC3D_EXPORT int __cdecl MC3D_RangeAnalysisDouble(double *pdData, int *pnRanges, short nSizeX, short nSizeY, double dLowerLimit, double dUpperLimit, eRangeAnalysisEvalMode EvalMode)
Does a range analysis of an array of double.
MC3D_RangeAnalysisFloat
MC3D_EXPORT int __cdecl MC3D_RangeAnalysisFloat(float *pfData, int *pnRanges, short nSizeX, short nSizeY, float fLowerLimit, float fUpperLimit, eRangeAnalysisEvalMode EvalMode)
Does a range analysis of an array of float.
eRangeAnalysisEvalMode
eRangeAnalysisEvalMode
Mode for range analysis, how to binarize before doing the range analysis.
Definition: MC3DDefs.h:63
MC3DDefs.h
Common defines for the MikroCAD SDK library.
MC3D_ShrinkDataArrayShort
MC3D_EXPORT bool __cdecl MC3D_ShrinkDataArrayShort(short *pnOut, short *pnIn, bool *pbValidOut, bool *pbValidIn, short nSizeX, short nSizeY, short nShrinkFactor)
Shrinks a short array by an given factor.
eMC3DFilterDirection
eMC3DFilterDirection
The direction of filter.
Definition: MC3DDefs.h:19
MC3D_InverseMatrix
MC3D_EXPORT bool __cdecl MC3D_InverseMatrix(double *pdMatrix, double *pdInvMatrix, int nSize)
Calculates the inverse of a double matrix.