CVBpy 15.0
Loading...
Searching...
No Matches
CVTypes.h
1// ---------------------------------------------------------------------------
2// Common Vision Blox - (C) STEMMER IMAGING
3// ---------------------------------------------------------------------------
4// This software is supplied under the terms of a license agreement or
5// nondisclosure agreement with STEMMER IMAGING and may not be copied or
6// disclosed except in accordance with the terms of that agreement.
7// ---------------------------------------------------------------------------
8
9#pragma once
10
11#include <stddef.h>
12
13// Platform-specific Adjustments
14// ---------------------------------------------------------------------------
15
16// role-based definition of customized data types
17// (helps ensure cross-platform portability without breaking backward-
18// compatibility on Win32. to increase portability of your code we recommend
19// to use these types in your code where applicable)
20// reminder: _WIN32 is also defined for 64 bit windows
21#if defined _WIN32
22# include <windows.h>
23 typedef BOOL cvbbool_t; // 32 bit "bool" on windows
24 typedef long cvbdatatype_t; // bitfield with 32 bits for image data type
25 typedef long cvbdensity_t; // scanning density
26 typedef long cvbdim_t; // width, height or z-depth specification
27 typedef long cvblicres_t; // result of license query
28 typedef long cvbres_t; // HRESULT-like 32 bit value (<0 = error)
29 typedef long cvbval_t; // general purpose value type
30 typedef __int64 cvbint64_t; // value type with assured 64 bit size
31 typedef unsigned __int64 cvbuint64_t; // value type with assured 64 bit size
32 typedef long cvbint32_t; // value type with assured 32 bit size
33 typedef DWORD cvbuint32_t; // value type with assured 32 bit size
34 typedef short cvbint16_t; // value type with assured 16 bit size
35 typedef WORD cvbuint16_t; // value type with assured 16 bit size
36 typedef signed char cvbint8_t; // value type with assured 8 bit size
37 typedef BYTE cvbuint8_t; // value type with assured 8 bit size
38 typedef GUID cvbguid_t;
39#elif defined __linux__ || defined __APPLE__
40 #include <stdint.h>
41 typedef bool cvbbool_t;
42 typedef int32_t cvbdatatype_t;
43 typedef int32_t cvbdensity_t;
44 typedef int32_t cvbdim_t;
45 typedef int32_t cvbres_t;
46 typedef int32_t cvblicres_t; // result of license query
47 typedef int32_t cvbval_t;
48 typedef int64_t cvbint64_t; // value type with assured 64 bit size
49 typedef uint64_t cvbuint64_t; // value type with assured 64 bit size
50 typedef int32_t cvbint32_t; // value type with assured 32 bit size
51 typedef uint32_t cvbuint32_t; // value type with assured 32 bit size
52 typedef int16_t cvbint16_t; // value type with assured 16 bit size
53 typedef uint16_t cvbuint16_t; // value type with assured 16 bit size
54 typedef int8_t cvbint8_t; // value type with assured 8 bit size
55 typedef uint8_t cvbuint8_t; // value type with assured 8 bit size
56 #pragma pack(push, 1)
57 struct cvbguid_t
58 {
59 uint32_t Data1;
60 uint16_t Data2;
61 uint16_t Data3;
62 uint8_t Data4[8];
63 };
64 #pragma pack(pop)
65#else
66 #error CVB: Unsupported platform and/or compiler!
67#endif
68
69// macro for import definition
70// (ensures proper calling convention on windows platforms)
71#if defined _WIN32
72 #if !defined __cplusplus
73 #error CVB: Compiler must be used in C++ mode!
74 #endif
75 #define IMPORT(t) extern "C" t __stdcall
76#elif defined __linux__ || defined __APPLE__
77 #define IMPORT(t) extern "C" __attribute__((visibility("default"))) t
78 #define __stdcall
79#else
80 #error CVB: Unsupported platform
81#endif
82
83#ifdef _WIN32
84 #ifdef _MSC_VER
85 #define DEPRECATED_CVB_FUNCTION(func) __declspec(deprecated) func
86 #elif defined __BORLANDC__
87 #define DEPRECATED_CVB_FUNCTION(func) func
88 #endif
89#elif defined __linux__ || defined __APPLE__
90 #define DEPRECATED_CVB_FUNCTION(func) func __attribute__((deprecated))
91#endif
92
93// CVB object types
94// ---------------------------------------------------------------------------
95typedef void* IMG; // CVB image object (object supporting IImageVPA)
96typedef void* OBJ; // other CVB-IUnknown-derived objects
97typedef void* PIXELLIST; // pixel list object
98
99// A 2x2 transformation matrix.
100struct TMatrix
101{
102 double A11;
103 double A12;
104 double A21;
105 double A22;
106};
107
108// Defines a coordinate system that describes an affine linear transformation.
109struct TCoordinateMap
110{
111 double OrgX;
112 double OrgY;
113 TMatrix Matrix;
114};
115typedef TCoordinateMap* LPCOORDINATEMAP;
116
117// Represents an individual entry in the VPAT returned by GetImageVPA.
118struct VPAEntry
119{
120 intptr_t XEntry;
121 intptr_t YEntry;
122};
123// an array of VPA entries
124typedef VPAEntry* PVPAT;
125
126// CVB license info
127// ---------------------------------------------------------------------------
128#define LI_NOLICENSE 0 // no ImageManager (IM) license found
129#define LI_COMMONVISIONBLOX 1 // IM licensed through CVB-type dongle
130#define LI_CVC 2 // IM licensed through CVC-type dongle
131#define LI_VISIONBLOX 3 // IM licensed through Visionblox dongle (obsolete!)
132#define LI_MINOS 4 // IM licensed through Minos dongle (obsolete!)
133#define LI_HARDWARE 5 // IM licensed through other hardware (e.g. nodelocked)
134#define LI_FOUNDATION_V1 6 // IM licensed through CVB-type dongle
135 // with ver1 Foundation license
136#define LI_CVB11_IM_LICENSE 7 // IM licensed through CVB License engine
137#define LI_CVB11_FP_LICENSE 8 // Foundation licensed through CVB License engine
138
139// Callback definitions commonly used in CVB
140// ---------------------------------------------------------------------------
141
142typedef cvbbool_t(__stdcall* TFLine)(void* pPrivate, cvbval_t LinesToDo);
143
144typedef cvbbool_t(__stdcall* TFPixelUnary)(void* pPrivate, void* pPixel, cvbdim_t X, cvbdim_t Y);
145
146typedef cvbbool_t(__stdcall* TFPixelBinary)(void* pPrivate, void* pPixel1, void* pPixel2, cvbdim_t X, cvbdim_t Y);
147
148typedef void(__stdcall* TFNonlinear)(void* pPrivate, double& X, double& Y);
149
150typedef cvbbool_t(__stdcall* TFProgress)(void* pPrivate, cvbval_t StepsTotal, cvbval_t StepsDone);
151
152typedef void(__stdcall* PFFINALRELEASE)(void* pBufferBase, void* pPrivate);
153
154// Simple and complex type and constant definitions commonly used in CVB
155// ---------------------------------------------------------------------------
156// histogram array for 8 bit per pixel images
157typedef cvbval_t THistogram[256];
158
159// Double precision rectangle data structure.
160struct TDRect
161{
162 double Left;
163 double Top;
164 double Right;
165 double Bottom;
166};
167
168// Area of interest specified by three points.
169struct TArea
170{
171 double X0;
172 double Y0;
173 double X1;
174 double Y1;
175 double X2;
176 double Y2;
177};
178
182{
185};
186
189enum TDatatype
190{
191 DT_Signed = 0x100,
192 DT_Float = 0x200,
193 DT_Overlay = 0x400,
194 DT_ComplexPacked = 0x800
195};
196
201{
202 RFL_Interleaved = 1,
203 RFL_Planar = 2
204};
205
221enum TColorModel
222{
223 CM_Guess_RGB = -2,
224 CM_Guess_Mono = -1,
225 CM_Unknown = 0,
226 CM_Mono = 1,
227 CM_RGB = 2,
228 CM_YUV = 3,
229 CM_HSI = 4,
230 CM_YCbCr = 5,
231 CM_LUV = 6,
232 CM_Lab = 7,
233 CM_HLS = 8,
234 CM_YCC = 9,
235 CM_HSV = 10,
236 CM_XYZ = 11
237};
238
241enum TSubPixelMode
242{
243 SP_None = 0,
246 SP_Gauss = 3
247};
248
252enum TPanoramaMode
253{
254 PM_Horizontal = 0,
255 PM_Vertical = 1
256};
257
261enum TVPATRotation
262{
263 VPATROT_Unknown = -1,
264 VPATROT_0 = 0,
265 VPATROT_90 = 1,
266 VPATROT_180 = 2,
267 VPATROT_270 = 3
268};
269
274{
275 DSM_Global = 0,
276 DSM_ViewPort = 1,
278};
279
283{
284 AAM_Off = 0
285};
286
290enum TDrawMode
291{
292 DM_Set = 0,
293 DM_AND = 1,
294 DM_OR = 2
295};
296
298struct CVIPointD
299{
300 double X;
301 double Y;
302};
TDrawMode
TDrawAntiAliasMode
DM_Set
DM_OR
DM_AND
AAM_Off
TPanoramaMode
TDisplayScaleMode
TDatatype
TColorModel
void(* PFFINALRELEASE)(void *pBufferBase, void *pPrivate)
long cvbdatatype_t
TVPATRotation
TRawFileLayout
void * IMG
PM_Vertical
PM_Horizontal
DSM_ViewPort
DSM_Global
DSM_WrapAround
DT_Signed
DT_Overlay
DT_Float
DT_ComplexPacked
CM_Lab
CM_Mono
CM_HSI
CM_RGB
CM_Guess_Mono
CM_LUV
CM_YCbCr
CM_Guess_RGB
CM_HSV
CM_YCC
CM_XYZ
CM_YUV
CM_HLS
CM_Unknown
VPATROT_Unknown
VPATROT_180
VPATROT_270
VPATROT_0
VPATROT_90
RFL_Interleaved
RFL_Planar
cvbbool_t(* TFPixelUnary)(void *pPrivate, void *pPixel, cvbdim_t X, cvbdim_t Y)
TNormalizeMode
cvbval_t THistogram[256]
cvbbool_t(* TFProgress)(void *pPrivate, cvbval_t StepsTotal, cvbval_t StepsDone)
cvbbool_t(* TFLine)(void *pPrivate, cvbval_t LinesToDo)
cvbbool_t(* TFPixelBinary)(void *pPrivate, void *pPixel1, void *pPixel2, cvbdim_t X, cvbdim_t Y)
TSubPixelMode
void(* TFNonlinear)(void *pPrivate, double &X, double &Y)
Normalize_MeanVariance
Normalize_MinMax
SP_Gauss
SP_Parabolic_Accurate
SP_Parabolic_Fast
void * OBJ
void * PIXELLIST
VPAEntry * PVPAT
double Y
Definition CVTypes.h:301
double X
Definition CVTypes.h:300
double X1
Definition CVTypes.h:173
double Y1
Definition CVTypes.h:174
double X2
Definition CVTypes.h:175
double Y0
Definition CVTypes.h:172
double X0
Definition CVTypes.h:171
double Y2
Definition CVTypes.h:176
double OrgY
Definition CVTypes.h:112
double OrgX
Definition CVTypes.h:111
TMatrix Matrix
Definition CVTypes.h:113
double Top
Definition CVTypes.h:163
double Bottom
Definition CVTypes.h:165
double Left
Definition CVTypes.h:162
double Right
Definition CVTypes.h:164
double A11
Definition CVTypes.h:102
double A21
Definition CVTypes.h:104
double A12
Definition CVTypes.h:103
double A22
Definition CVTypes.h:105
intptr_t YEntry
Definition CVTypes.h:121
intptr_t XEntry
Definition CVTypes.h:120