Mamba C API reference

Version 2.0

MB_Common.h
Go to the documentation of this file.
1 
2 /*
3  * Copyright (c) <2009>, <Nicolas BEUCHER and ARMINES for the Centre de
4  * Morphologie Mathématique(CMM), common research center to ARMINES and MINES
5  * Paristech>
6  *
7  * Permission is hereby granted, free of charge, to any person
8  * obtaining a copy of this software and associated documentation files
9  * (the "Software"), to deal in the Software without restriction, including
10  * without limitation the rights to use, copy, modify, merge, publish,
11  * distribute, sublicense, and/or sell copies of the Software, and to permit
12  * persons to whom the Software is furnished to do so, subject to the following
13  * conditions: The above copyright notice and this permission notice shall be
14  * included in all copies or substantial portions of the Software.
15  *
16  * Except as contained in this notice, the names of the above copyright
17  * holders shall not be used in advertising or otherwise to promote the sale,
18  * use or other dealings in this Software without their prior written
19  * authorization.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27  * THE SOFTWARE.
28  */
29 #ifndef __MB_Common_H
30 #define __MB_Common_H
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /****************************************/
37 /* Includes */
38 /****************************************/
39 #include <stdint.h>
40 
41 /****************************************/
42 /* Defines */
43 /****************************************/
44 
45 #if defined(WIN32) || defined(_WIN32)
46 #undef __WIN32__
47 #define __WIN32__ 1
48 #endif
49 
50 #ifndef MB_API_ENTRY
51 # if defined(__WIN32__) && defined(MB_BUILD)
52 # define MB_API_ENTRY __declspec(dllexport)
53 # else
54 # define MB_API_ENTRY
55 # endif
56 #endif
57 
58 #ifndef MB_API_CALL
59 # if defined(__WIN32__) && !defined(__GNUC__)
60 # define MB_API_CALL __cdecl
61 # else
62 # define MB_API_CALL
63 # endif
64 #endif
65 
67 #define MB_ROUND_W 64
68 
69 #define MB_ROUND_H 2
70 
82 #define MB_MAX_IMAGE_SIZE ((Uint64)4294967296)
83 
84 /****************************************/
85 /* Structures and Typedef */
86 /****************************************/
87 
89 typedef uint8_t Uint8;
91 typedef uint16_t Uint16;
93 typedef uint32_t Uint32;
95 typedef uint64_t Uint64;
97 typedef int8_t Sint8;
99 typedef int16_t Sint16;
101 typedef int32_t Sint32;
103 typedef int64_t Sint64;
104 
106 typedef uint8_t PIX8;
108 typedef PIX8 *PLINE;
109 
111 typedef uint32_t PIX32;
113 typedef PIX32 *PLINE32;
114 
116 typedef struct {
118  Uint32 width;
120  Uint32 height;
122  Uint32 depth;
124  PLINE *plines;
126  PIX8 *pixels;
127 } MB_Image;
128 
130 typedef struct {
134  Uint32 length;
135 } MB3D_Image;
136 
138 enum MB_grid_t {
143 };
144 
151 };
152 
163 };
164 
167  MB_NEIGHBOR_0 = 0x0001,
168  MB_NEIGHBOR_1 = 0x0002,
169  MB_NEIGHBOR_2 = 0x0004,
170  MB_NEIGHBOR_3 = 0x0008,
171  MB_NEIGHBOR_4 = 0x0010,
172  MB_NEIGHBOR_5 = 0x0020,
173  MB_NEIGHBOR_6 = 0x0040,
174  MB_NEIGHBOR_7 = 0x0080,
175  MB_NEIGHBOR_8 = 0x0100,
176  MB_NEIGHBOR_ALL_HEXAGONAL = 0x07f,
177  MB_NEIGHBOR_ALL_SQUARE = 0x01ff
178 };
179 
180 #ifdef __cplusplus
181 }
182 #endif
183 
184 #endif /* __MB_Common_H */
185 
uint16_t Uint16
Definition: MB_Common.h:91
Definition: MB_Common.h:160
PIX8 * PLINE
Definition: MB_Common.h:108
uint8_t PIX8
Definition: MB_Common.h:106
MB_Image ** seq
Definition: MB_Common.h:132
uint64_t Uint64
Definition: MB_Common.h:95
uint32_t Uint32
Definition: MB_Common.h:93
Definition: MB_Common.h:150
Uint32 depth
Definition: MB_Common.h:122
Definition: MB_Common.h:140
Definition: MB_Common.h:130
int32_t Sint32
Definition: MB_Common.h:101
Uint32 length
Definition: MB_Common.h:134
Definition: MB_Common.h:116
Uint32 width
Definition: MB_Common.h:118
MB_edgemode_t
Definition: MB_Common.h:146
PIX32 * PLINE32
Definition: MB_Common.h:113
MB3D_grid_t
Definition: MB_Common.h:156
uint32_t PIX32
Definition: MB_Common.h:111
Definition: MB_Common.h:162
MB_Neighbors_code_t
Definition: MB_Common.h:166
Definition: MB_Common.h:158
MB_grid_t
Definition: MB_Common.h:138
int8_t Sint8
Definition: MB_Common.h:97
uint8_t Uint8
Definition: MB_Common.h:89
Definition: MB_Common.h:142
PIX8 * pixels
Definition: MB_Common.h:126
PLINE * plines
Definition: MB_Common.h:124
Definition: MB_Common.h:148
int64_t Sint64
Definition: MB_Common.h:103
int16_t Sint16
Definition: MB_Common.h:99
Uint32 height
Definition: MB_Common.h:120