Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals

idgen.h

Go to the documentation of this file.
00001 /************************************************************************* 00002 * $Id: idgen.h,v 1.1 2005/09/09 08:22:30 bellet Exp $ 00003 ************************************************************************** 00004 This software is governed by the CeCILL license under French law and 00005 abiding by the rules of distribution of free software. You can use, 00006 modify and/ or redistribute the software under the terms of the CeCILL 00007 license as circulated by CEA, CNRS and INRIA at the following URL 00008 "http://www.cecill.info". 00009 00010 As a counterpart to the access to the source code and rights to copy, 00011 modify and redistribute granted by the license, users are provided only 00012 with a limited warranty and the software's author, the holder of the 00013 economic rights, and the successive licensors have only limited 00014 liability. 00015 00016 In this respect, the user's attention is drawn to the risks associated 00017 with loading, using, modifying and/or developing or reproducing the 00018 software by the user in light of its specific status of free software, 00019 that may mean that it is complicated to manipulate, and that also 00020 therefore means that it is reserved for developers and experienced 00021 professionals having in-depth computer knowledge. Users are therefore 00022 encouraged to load and test the software's suitability as regards their 00023 requirements in conditions enabling the security of their systems and/or 00024 data to be ensured and, more generally, to use and operate it in the 00025 same conditions as regards security. 00026 00027 The fact that you are presently reading this means that you have had 00028 knowledge of the CeCILL license and that you accept its terms. 00029 00030 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de 00031 l'Image). All rights reserved. See License.txt for details. 00032 00033 Version 1.0 05/09/2005 00034 *************************************************************************/ 00035 00036 #ifndef __IDGEN_H__ 00037 #define __IDGEN_H__ 00038 00039 /* 00040 * Types for complex number and RGB data structures 00041 */ 00042 00043 typedef struct {double re,im ; } COMPLEX ; 00044 typedef struct {double re,im ; } COMPLEX_DOUBLE ; 00045 typedef struct {float re,im; } COMPLEX_FLOAT ; 00046 typedef struct {char re,im; } COMPLEX_CHAR ; 00047 typedef struct {unsigned char re,im; } COMPLEX_UCHAR ; 00048 typedef struct {short re,im; } COMPLEX_SHORT ; 00049 typedef struct {unsigned short re,im; } COMPLEX_USHORT ; 00050 typedef struct {long re,im; } COMPLEX_LONG ; 00051 typedef struct {unsigned long re,im; } COMPLEX_ULONG ; 00052 00053 typedef struct {unsigned char r,g,b;} RGB; 00054 typedef struct {unsigned char r,g,b,a;} RGBA; 00055 00056 #ifndef SWIG 00057 typedef struct {unsigned char c1,c2,c3;} COLOR; 00058 #endif 00059 00060 typedef struct {double x,y ; } IDXPOINT_DOUBLE ; 00061 typedef struct {float x,y; } IDXPOINT_FLOAT ; 00062 typedef struct {char x,y; } IDXPOINT_CHAR ; 00063 typedef struct {unsigned char x,y; } IDXPOINT_UCHAR ; 00064 typedef struct {short x,y; } IDXPOINT_SHORT ; 00065 typedef struct {unsigned short x,y; } IDXPOINT_USHORT ; 00066 typedef struct {long x,y; } IDXPOINT_LONG ; 00067 typedef struct {unsigned long x,y; } IDXPOINT_ULONG ; 00068 00069 /* JM 00070 Plans of the color image 00071 */ 00072 #define PLAN_1 1 00073 #define PLAN_2 2 00074 #define PLAN_3 3 00075 00076 #define SP_1 1<<(PLAN_1-1) /* Select PLAN_1 */ 00077 #define SP_2 1<<(PLAN_2-1) /* Select PLAN_2 */ 00078 #define SP_3 1<<(PLAN_3-1) /* Select PLAN_3 */ 00079 00080 /* 00081 * Types of IDO objets 00082 */ 00083 00084 #define IDO_TYPE 0x0f 00085 00086 #define IMA 0 /* images 2d */ 00087 00088 #define MAT 0 /* Matrices */ 00089 #define SEQ 1 /* sequences (4D) */ 00090 #define VOL 2 /* volumes 3d */ 00091 #define SIG 3 /* signaux 1d */ 00092 #define PNT 4 /* point 3D */ 00093 #define FAC 5 /* facette 3D */ 00094 #define TRI 6 /* triangulation 3D */ 00095 #define LST 7 /* liste de n'importe quoi IMA..LST */ 00096 #define CNT 8 /* contour */ 00097 #define CNT3D 9 /* contour 3D */ 00098 00099 /* 00100 * Types of the "pixels" 00101 */ 00102 00103 #define TY_SIZE (0x3f << 4) 00104 00105 #define TY_CHAR ( 0<<4) 00106 #define TY_FLOAT ( 1<<4) 00107 #define TY_DOUBLE ( 2<<4) 00108 #define TY_COMPLEX ( 3<<4) 00109 #define TY_RGB ( 4<<4) 00110 #define TY_SHORT ( 5<<4) 00111 #define TY_LONG ( 6<<4) 00112 #define TY_UCHAR ( 7<<4) 00113 #define TY_USHORT ( 8<<4) 00114 00115 #define TY_COMPLEX_DOUBLE ( 9<<4) 00116 #define TY_COMPLEX_FLOAT (10<<4) 00117 #define TY_COMPLEX_CHAR (11<<4) 00118 #define TY_COMPLEX_UCHAR (12<<4) 00119 #define TY_COMPLEX_SHORT (13<<4) 00120 #define TY_COMPLEX_USHORT (14<<4) 00121 #define TY_COMPLEX_LONG (15<<4) 00122 #define TY_BIT (16<<4) 00123 #define TY_IDPOINT (17<<4) 00124 #define TY_FACE (18<<4) 00125 #define TY_POINTER (19<<4) 00126 #define TY_ULONG (20<<4) 00127 #define TY_COMPLEX_ULONG (21<<4) 00128 00129 #define TY_IDXPOINT_CHAR (22<<4) 00130 #define TY_IDXPOINT_UCHAR (23<<4) 00131 #define TY_IDXPOINT_FLOAT (24<<4) 00132 #define TY_IDXPOINT_DOUBLE (25<<4) 00133 #define TY_IDXPOINT_SHORT (26<<4) 00134 #define TY_IDXPOINT_USHORT (27<<4) 00135 #define TY_IDXPOINT_LONG (28<<4) 00136 #define TY_IDXPOINT_ULONG (29<<4) 00137 00138 #define TY_COLOR (30<<4) 00139 #define TY_RGBA (31<<4) 00140 00141 /* 00142 * Size of the pixels (size = TAille in French 00143 */ 00144 00145 #define TA_TY_CHAR sizeof(char) 00146 #define TA_TY_UCHAR sizeof(unsigned char) 00147 #define TA_TY_FLOAT sizeof(float) 00148 #define TA_TY_DOUBLE sizeof(double) 00149 #define TA_TY_COMPLEX (sizeof(COMPLEX)) 00150 #define TA_TY_RGB (sizeof(RGB)) 00151 #define TA_TY_RGBA (sizeof(RGBA)) 00152 #define TA_TY_SHORT (sizeof(short)) 00153 #define TA_TY_USHORT (sizeof(unsigned short)) 00154 #define TA_TY_LONG (sizeof(long)) 00155 #define TA_TY_ULONG (sizeof(unsigned long)) 00156 #define TA_TY_COMPLEX_DOUBLE (sizeof(COMPLEX_DOUBLE )) 00157 #define TA_TY_COMPLEX_FLOAT (sizeof(COMPLEX_FLOAT )) 00158 #define TA_TY_COMPLEX_CHAR (sizeof(COMPLEX_CHAR )) 00159 #define TA_TY_COMPLEX_UCHAR (sizeof(COMPLEX_UCHAR )) 00160 #define TA_TY_COMPLEX_SHORT (sizeof(COMPLEX_SHORT )) 00161 #define TA_TY_COMPLEX_USHORT (sizeof(COMPLEX_USHORT )) 00162 #define TA_TY_COMPLEX_LONG (sizeof(COMPLEX_LONG )) 00163 #define TA_TY_COMPLEX_ULONG (sizeof(COMPLEX_ULONG )) 00164 #define TA_TY_BIT (sizeof(char)) 00165 #define TA_TY_POINTER (sizeof(void *)) 00166 #define TA_TY_IDPOINT (sizeof(IDPOINT)) 00167 #define TA_TY_FACE (sizeof(FACE)) 00168 00169 #define TA_TY_IDXPOINT_CHAR (sizeof(IDXPOINT_CHAR)) 00170 #define TA_TY_IDXPOINT_UCHAR (sizeof(IDXPOINT_UCHAR)) 00171 #define TA_TY_IDXPOINT_FLOAT (sizeof(IDXPOINT_FLOAT)) 00172 #define TA_TY_IDXPOINT_DOUBLE (sizeof(IDXPOINT_DOUBLE)) 00173 #define TA_TY_IDXPOINT_SHORT (sizeof(IDXPOINT_SHORT)) 00174 #define TA_TY_IDXPOINT_USHORT (sizeof(IDXPOINT_USHORT)) 00175 #define TA_TY_IDXPOINT_LONG (sizeof(IDXPOINT_LONG)) 00176 #define TA_TY_IDXPOINT_ULONG (sizeof(IDXPOINT_ULONG)) 00177 00178 #define TA_TY_COLOR (sizeof(COLOR)) 00179 00180 #ifdef SWIG 00181 00182 int IdLibidoTypeObj(void *); 00183 int IdLibidoType(void *); 00184 int IdLibidoDataType(void *); 00185 int IdSizeOfType(void *); 00186 int IdTypeSize(int); 00187 00188 #else 00189 00190 #define IdLibidoTypeObj(obj) ( ( (int*)(obj) )[-1] & IDO_TYPE ) 00191 #define IdLibidoType(obj) ( ( (int*)(obj) )[-1] & IDO_TYPE ) 00192 #define IdLibidoDataType(obj) ( ( (int*)(obj) )[-1] & TY_SIZE ) 00193 00194 #define IdSizeOfType(obj) ( (IdLibidoTypeObj(obj)!=CNT) ? _IdSizeOfType ( IdLibidoDataType(obj) >> 4) \ 00195 : (_IdSizeOfType ( IdLibidoDataType(obj) >> 4)) <<1\ 00196 ) 00197 00198 #define IdTypeSize(ty) ( ((ty & IDO_TYPE)!=CNT) ? _IdSizeOfType ( (ty & TY_SIZE) >> 4) \ 00199 : (_IdSizeOfType ( (ty & TY_SIZE) >> 4)) <<1 \ 00200 ) 00201 #endif 00202 00203 /************************************************************************/ 00204 00205 unsigned short int IdTypeToComplex (int); 00206 unsigned short int IdTypeFromComplex (int); 00207 00208 int IdCalcArrondInt (double); 00209 float IdCalcFloatFromSun (float *); 00210 00211 /************************************************************************/ 00212 /* fonctions "message" */ 00213 00214 int IdSetMessage (void *,char *); 00215 char * IdGetMessage (void *); 00216 00217 /************************************************************************/ 00218 /* fonctions "fichier" */ 00219 00220 int IdSetFileName (void *,char *); 00221 char * IdGetFileName (void *); 00222 00223 00224 /*######################################################################*/ 00225 00226 /* Fonctions internes */ 00227 00228 void **_IdAllocPlan (int, int, int); 00229 void _IdFreePlan (void **, int); 00230 int _IdSizeOfType (int); 00231 00232 /************************************************************************/ 00233 00234 #endif 00235 00236 /* FUNCTION DESCRIPTION ************************************************** 00237 00238 IdLibidoTypeObj (macro) 00239 00240 RESUME: Donne le type d'objet libido considere (IMA,SIG,VOL, ...) 00241 00242 DESCRIPTION: Donne le type d'objet libido considere. 00243 00244 SYNTAXE: int type = IdLibidoTypeObj (void *objet); 00245 00246 RETOUR: type : int 00247 role : La valeur est decrite dans le tableau ci-dessous. 00248 00249 #define IDO_TYPE 0x0f 00250 00251 #define IMA 0 images 2d 00252 #define SEQ 1 sequences (4D) 00253 #define VOL 2 volumes 3d 00254 #define SIG 3 signaux 1d 00255 #define PNT 4 point 3D 00256 #define FAC 5 facette 3D 00257 #define TRI 6 triangulation 3D 00258 #define LST 7 liste de n'importe quoi IMA..LST 00259 #define CNT 8 Contour (x,y) 00260 #define CNT3D 9 Contour 3D (ensemble de IDPOINT) 00261 00262 00263 PARAMETRES: nom : objet 00264 type : objet libido (voir les differents types possibles 00265 dans le tableau ci-dessous) 00266 00267 PPIMA_??? 00268 PPPPSEQ_??? 00269 PPPVOL_??? 00270 PSIG_??? 00271 PPOINT_??? 00272 PFACE_??? 00273 PTRIANGLE_??? 00274 PLIST_??? 00275 00276 ??? pouvant varier de UCHAR a COMPLEX..., 00277 voir IdLibidoDataType. 00278 00279 role : 00280 00281 FICHIER: IDGEN.H 00282 00283 EXEMPLE: 00284 00285 ******************************************************** END DESCRIPTION */ 00286 00287 /* FUNCTION DESCRIPTION ************************************************** 00288 00289 IdLibidoDataType (macro) 00290 00291 RESUME: Type des donnees d'1 objet LibIDO. ex: IdLibidoDataType(pVol1) --> USHORT. 00292 00293 DESCRIPTION: Type des donnees d'1 objet LibIDO. ex: IdLibidoDataType(pVol1) --> USHORT 00294 00295 SYNTAXE: int type = IdLibidoDataType (void *objet); 00296 00297 RETOUR: type : int 00298 acces : O 00299 role : La valeur est decrite dans le tableau ci-dessous : 00300 00301 00302 #define TY_SIZE (0x3f << 4) 00303 00304 #define TY_CHAR ( 0<<4) : char 00305 #define TY_FLOAT ( 1<<4) : float 00306 #define TY_DOUBLE ( 2<<4) : double 00307 #define TY_COMPLEX ( 3<<4) : complex 00308 #define TY_RGB ( 4<<4) : RGB (---- ------- - -----) 00309 #define TY_SHORT ( 5<<4) : short 00310 #define TY_LONG ( 6<<4) : long 00311 #define TY_UCHAR ( 7<<4) : unsigned char 00312 #define TY_USHORT ( 8<<4) : unsigned short 00313 #define TY_COMPLEX_DOUBLE ( 9<<4) : complex double 00314 #define TY_COMPLEX_FLOAT (10<<4) : complex float 00315 #define TY_COMPLEX_CHAR (11<<4) : complex char 00316 #define TY_COMPLEX_UCHAR (12<<4) : complex unsigned char 00317 #define TY_COMPLEX_SHORT (13<<4) : complex short 00318 #define TY_COMPLEX_USHORT (14<<4) : complex unsigned short 00319 #define TY_COMPLEX_LONG (15<<4) : complex long 00320 #define TY_BIT (16<<4) : bit 00321 #define TY_POINT (17<<4) : point (voir idpoint.h : types) 00322 #define TY_FACE (18<<4) : facette (---- idface.h : types) 00323 #define TY_POINTER (19<<4) : pointeur 00324 #define TY_ULONG (20<<4) : unsigned long 00325 #define TY_COMPLEX_ULONG (21<<4) : complex usigned long 00326 00327 PARAMETRES: nom : objet 00328 type : objet libido (voir les differents types possibles 00329 dans le tableau ci-dessous) 00330 00331 PPIMA_??? 00332 PPPPSEQ_??? 00333 PPPVOL_??? 00334 PSIG_??? 00335 PPOINT_??? 00336 PFACE_??? 00337 PTRIANGLE_??? 00338 PLIST_??? 00339 00340 ??? pouvant varier de UCHAR a COMPLEX..., 00341 voir IdLibidoDataType. 00342 00343 role : 00344 00345 FICHIER: IDGEN.H 00346 00347 EXEMPLE: 00348 00349 ******************************************************** END DESCRIPTION */ 00350 00351 /* FUNCTION DESCRIPTION ************************************************** 00352 00353 IdSizeOfType (macro) 00354 00355 RESUME: Taille en octets du type de donnees d'un objet LIBIDO ex: IdSizeOfType(pIma1) -->4 00356 00357 DESCRIPTION: Donne la taille en octets du type de donnees d'un objet 00358 LibIDO. 00359 ex: IdSizeOfType(pIma1) -->4 00360 00361 SYNTAXE: int taille = IdSizeOfType (void* objet); 00362 00363 RETOUR: type : int 00364 role : taille en octets de l'objet LibIDO 00365 00366 PARAMETRES: nom : objet 00367 type : objet libido (voir les differents types possibles 00368 dans le tableau ci-dessous) 00369 00370 PPIMA_??? 00371 PPPPSEQ_??? 00372 PPPVOL_??? 00373 PSIG_??? 00374 PPOINT_??? 00375 PFACE_??? 00376 PTRIANGLE_??? 00377 PLIST_??? 00378 00379 ??? pouvant varier de UCHAR a COMPLEX..., 00380 voir IdLibidoDataType. 00381 00382 role : 00383 00384 FICHIER: IDGEN.H 00385 00386 ******************************************************** END DESCRIPTION */ 00387 00388 /* FUNCTION DESCRIPTION ************************************************** 00389 00390 IdTypeSize (macro) 00391 00392 RESUME: Donne la taille en octets d'un type de donnes possible LibIDO. 00393 00394 DESCRIPTION: Donne la taille en octets d'un type de donnes possible LibIDO. 00395 00396 SYNTAXE: int nbOctets = IdTypeSize (int TYPE_LIBIDO); 00397 00398 RETOUR: type : int 00399 role : taille du type considere 00400 00401 PARAMETRES: nom : TYPE_LIBIDO 00402 type : constante a prendre dans le tableau suivant : 00403 00404 TY_CHAR TY_UCHAR TY_COMPLEX_USHORT TY_COMPLEX_ULONG 00405 TY_FLOAT TY_USHORT TY_COMPLEX_LONG 00406 TY_DOUBLE TY_COMPLEX_DOUBLE TY_BIT 00407 TY_COMPLEX TY_COMPLEX_FLOAT TY_POINT 00408 TY_RGB TY_COMPLEX_CHAR TY_FACE 00409 TY_SHORT TY_COMPLEX_UCHAR TY_POINTER 00410 TY_LONG TY_COMPLEX_SHORT TY_ULONG 00411 00412 role : permet de connaitre la taille d'un type de donnees 00413 (pouvant etre different sur differentes machines) 00414 00415 FICHIER: IDGEN.H 00416 00417 ******************************************************** END DESCRIPTION */

Generated on Wed Oct 19 09:28:33 2005 for SIMRI3D by doxygen 1.3.7