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

idcnt-calc.h

Go to the documentation of this file.
00001 /************************************************************************* 00002 * $Id: idcnt-calc.h,v 1.1 2005/09/09 08:22:26 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 /* 00037 * Description : CoNTour object (bi dimensional) 00038 */ 00039 #ifndef __IDCNT_CALC_H__ 00040 #define __IDCNT_CALC_H__ 00041 00042 #include "idgen.h" 00043 #include "idima.h" 00044 00045 00046 #ifndef SWIG 00047 #define OUTPUT 00048 #endif 00049 00050 PCONTOUR_USHORT IdSigBsplineInterpCompCtrlPts (PCONTOUR_USHORT); 00052 PCONTOUR IdCntReadAscFileWithOffset (char *,int,int,int,int); 00053 int IdCntReadAscFileToCntWithOffset (char *,PCONTOUR,int,int); 00054 int IdCntGetAscFileLength (char *,int,int); 00055 int IdCntWriteAsciiFile (char *,PCONTOUR); 00057 PCONTOUR IdCntReadRawFile (char *, int, int); 00058 int IdCntReadRawFileToCnt (char *, PCONTOUR); 00059 PCONTOUR IdCntReadRawFileWithOffset (char *, int, int, int); 00060 int IdCntReadRawFileToCntWithOffset (char *, PCONTOUR, int); 00062 int IdCntGetRawFileLength (char *, int); 00063 int IdCntWriteRawFile (char *,PCONTOUR); 00064 int IdCntDelPoint (PCONTOUR, int); 00065 int IdCntDelPoints (PCONTOUR, int, int); 00066 PCONTOUR IdCntVecteurToContour (void *, int, int, int ); 00067 PCONTOUR IdCntModifLongueur (PCONTOUR,int); 00068 void IdCntRectEnglob (PCONTOUR_USHORT, int * OUTPUT, 00069 int * OUTPUT, int * OUTPUT, int * OUTPUT); 00070 int IdCntMoveContour (PCONTOUR_USHORT, int , int); 00071 void IdCntCentreGravite (PCONTOUR_USHORT contour, int * OUTPUT, 00072 int * OUTPUT); 00073 int IdCntFillPolygon (PCONTOUR_USHORT, PPIMAGE_UCHAR, int); 00074 int IdCntFillPolygonXXX (PCONTOUR_USHORT, PPIMAGE_UCHAR, int); 00075 int IdCntFillExtPolygon (PCONTOUR_USHORT, PPIMAGE_UCHAR, int); 00076 PCONTOUR_USHORT 00077 IdCntPointsOfSegment (int, int, int, int); 00078 double IdCntSurfacePoly (PCONTOUR_USHORT); 00079 PCONTOUR_USHORT 00080 IdCntSignalToCntImage (PSIGNAL,int,int,int,int,int, 00081 double,double); 00082 void IdCntCentreGraviteG (PCONTOUR, double * OUTPUT, 00083 double * OUTPUT); 00084 double IdCntCalculAireG (PCONTOUR); 00085 double IdCntGetXG (PCONTOUR, int); 00086 double IdCntGetYG (PCONTOUR, int); 00087 int IdCntRotateContour (PCONTOUR_USHORT, int, int, double); 00088 int IdCntRotateContourDouble (PCONTOUR_DOUBLE, int, int, double); 00089 int IdCntZoomContourDouble (PCONTOUR_DOUBLE, int, int, double); 00090 PCONTOUR IdCntConcat (PCONTOUR, PCONTOUR); 00091 PCONTOUR_USHORT IdCntReadContour (char *); 00092 //CLEANME void IdCntSwap (PCONTOUR,int); 00093 00094 int IdImaFillContour(PPIMAGE_UCHAR im, int nivGris); 00095 00096 00098 00099 #ifndef SWIG 00100 #define IdCntAppendPointsOfSegment(cntSource, x, y) \ 00101 IdCntAddPointsOfSegment ((cntSource), \ 00102 IdCntGetX(cntSource,IdCntGetUsedNbX(cntSource)-1), \ 00103 IdCntGetY(cntSource,IdCntGetUsedNbX(cntSource)-1),(x),(y)); 00104 #endif 00105 #ifdef SWIG 00106 int IdCntAppendPointsOfSegment(PCONTOUR_USHORT, int, int); 00107 #endif 00108 00109 #ifndef SWIG 00110 #define IdCntAllocLikeContour(cn) ((!(cn)) ? 0 \ 00111 : IdCntAlloc ( IdCntDimX(cn),IdCntType(cn) )) 00112 #else 00113 PCONTOUR IdCntAllocLikeContour(PCONTOUR); 00114 #endif 00115 00117 00118 #ifndef SWIG 00119 #define IdCntReadAscFile(a,b,c) \ 00120 IdCntReadAscFileWithOffset((a), (b), (c), 0, 0) 00121 #define IdCntReadAscFileToCnt(a,b) \ 00122 IdCntReadAscFileToCntWithOffset((a), (b), 0, 0) 00123 #else 00124 int IdCntReadAscFile(char *,int,int); 00125 int IdCntReadAscFileToCnt(char *,PCONTOUR); 00126 #endif 00127 00128 00129 int IdCntDrawPolyLine (PCONTOUR_USHORT,PPIMAGE_UCHAR,int,int); 00130 int IdCntDrawPolygon (PCONTOUR_USHORT,PPIMAGE_UCHAR,int,int); 00131 int IdCntDrawPolyLineOffset (PCONTOUR_USHORT,int,int,PPIMAGE_UCHAR,int,int); 00132 int IdCntDrawPolygonOffset (PCONTOUR_USHORT,int,int,PPIMAGE_UCHAR,int,int); 00133 00134 #ifndef SWIG 00135 #define IdCntAddPointsOfSegment(contour_,a,b,c,d) \ 00136 _IdCntAddPointsOfSegment(&(contour_),(a),(b),(c),(d)) 00137 #else 00138 int IdCntAddPointsOfSegment(PCONTOUR_USHORT, int, int, int, int); 00139 #endif 00140 00141 #ifndef SWIG 00142 #define IdCntInsertPointsOfSegment(contour_,a,b,c) \ 00143 _IdCntInsertPointsOfSegment(&(contour_),(a),(b),(c)) 00144 #else 00145 int IdCntInsertPointsOfSegment(PCONTOUR_USHORT, int, int, int); 00146 #endif 00147 00148 #ifndef SWIG 00149 #define IdCntConnexPts(contour_,a) _IdCntConnexPts(&(contour_),(a)) 00150 #else 00151 int IdCntConnexPts(PCONTOUR_USHORT, int); 00152 #endif 00153 00154 #ifndef SWIG 00155 #define IdCntClean(contour_) _IdCntClean(&(contour_)) 00156 #else 00157 int IdCntClean (PCONTOUR_USHORT); 00158 #endif 00159 00160 #ifndef SWIG 00161 #define IdCntCleanFromStart(contour_, i) _IdCntCleanFromStart(&(contour_), (i)) 00162 #else 00163 int IdCntCleanFromStart(PCONTOUR_USHORT, int); 00164 #endif 00165 00166 #ifndef SWIG 00167 #define IdCntAddPointG(contour,valx,valy) \ 00168 _IdCntAddPointG((PCONTOUR*)&(contour), (valx),(valy)) 00169 #else 00170 int IdCntAddPointG(PCONTOUR, double, double); 00171 #endif 00172 00173 00174 00175 // FUNCTION DESCRIPTION ************************************************** 00176 // 00177 // IdCntNbPts (macro) 00178 // 00179 // RESUME: donne le points d'un CONTOUR (identique a IdCntDimX ...) 00180 // 00181 // DESCRIPTION: donne le points d'un CONTOUR (identique a IdCntDimX ...) 00182 // (celui precise lors de l'allocation ou de la modif de longueur) 00183 // 00184 // SYNTAXE: int nbrPts = IdCntNbPts (PCONTOUR cnt1); 00185 // 00186 // PARAMETRES: nom : cnt1 00187 // type : PCONTOUR 00188 // role : Pointeur vers le contour source 00189 // 00190 // FICHIER: idcnt.h 00191 // 00192 // EXEMPLE: 00193 // 00194 // ******************************************************** END DESCRIPTION 00195 // 00196 // FUNCTION DESCRIPTION ************************************************** 00197 // 00198 // IdCntType (macro) 00199 // 00200 // RESUME: Donne le type d'un contour LibIDO. 00201 // 00202 // DESCRIPTION: Donne le type d'un contour LibIDO. 00203 // 00204 // SYNTAXE: int typ_cn = IdCntType (PCONTOUR cn); 00205 // 00206 // RETOUR: type : int 00207 // role : Type du contour Libido. #defini par le tableau suivant : 00208 // 00209 // #define CNT_CHAR (CNT | TY_CHAR) 00210 // #define CNT_UCHAR (CNT | TY_UCHAR) 00211 // #define CNT_SHORT (CNT | TY_SHORT) 00212 // #define CNT_USHORT (CNT | TY_USHORT) 00213 // #define CNT_LONG (CNT | TY_LONG) 00214 // #define CNT_FLOAT (CNT | TY_FLOAT) 00215 // #define CNT_DOUBLE (CNT | TY_DOUBLE) 00216 // 00217 // PARAMETRES: nom : im 00218 // type : Objet contour LibIDO 00219 // role : contour LibIDO a scruter 00220 // 00221 // FICHIER: idcnt.h 00222 // 00223 // EXEMPLE: 00224 // 00225 // ******************************************************** END DESCRIPTION 00226 // 00227 // FUNCTION DESCRIPTION ************************************************** 00228 // 00229 // IdCntGetUsedNbPts (macro) 00230 // 00231 // RESUME: donne le nb de points UTILISES d'un CONTOUR 00232 // 00233 // DESCRIPTION: donne le nb de points UTILISES d'un CONTOUR 00234 // 00235 // SYNTAXE: int nbPtsUtilises = IdCntGetUsedNbPts (PCONTOUR cnt); 00236 // 00237 // PARAMETRES: nom : ima 00238 // type : PCONTOUR 00239 // role : Pointeur vers le contour source 00240 // 00241 // FICHIER: idcnt.h 00242 // 00243 // EXEMPLE: 00244 // 00245 // ******************************************************** END DESCRIPTION 00246 // 00247 // FUNCTION DESCRIPTION ************************************************** 00248 // 00249 // IdCntSetY (macro) 00250 // 00251 // RESUME: Positionne la valeur de la coord. Y d'un point d'un contour 00252 // 00253 // DESCRIPTION: Positionne la valeur de la coord. Y d'un point d'un contour. 00254 // Le point DOIT deja exister. 00255 // 00256 // SYNTAXE: void IdCntSetY(PCONTOUR cnt, int numPoint, nombre coordY); 00257 // 00258 // RETOUR: type : rien 00259 // role : 00260 // 00261 // PARAMETRES: 00262 // nom : cnt 00263 // type : PCONTOUR 00264 // role : contour d'origine. 00265 // 00266 // nom : i 00267 // type : entier 00268 // role : numero du point a modifier 00269 // 00270 // nom : val 00271 // type : entier, ou double, ou ... 00272 // role : coordonne Y du point a modifier 00273 // 00274 // FICHIER: idcnt.h 00275 // 00276 // EXEMPLE: 00277 // ******************************************************** END DESCRIPTION 00278 // 00279 // FUNCTION DESCRIPTION ************************************************** 00280 // 00281 // IdCntSetX (macro) 00282 // 00283 // RESUME: Positionne la valeur de la coord. X d'un point d'un contour 00284 // 00285 // DESCRIPTION: Positionne la valeur de la coordonnee X d'un point d'un contour. 00286 // Le point DOIT deja exister. 00287 // 00288 // SYNTAXE: void IdCntSetX(PCONTOUR cnt, int numPoint , nombre coordX); 00289 // 00290 // RETOUR: type : rien 00291 // role : 00292 // 00293 // PARAMETRES: 00294 // nom : cnt 00295 // type : PCONTOUR 00296 // role : contour d'origine. 00297 // 00298 // nom : i 00299 // type : entier 00300 // role : numero du point a modifier 00301 // 00302 // nom : val 00303 // type : entier, ou double, ou ... 00304 // role : coordonne X du point a modifier 00305 // 00306 // FICHIER: idcnt.h 00307 // 00308 // EXEMPLE: 00309 // ******************************************************** END DESCRIPTION 00310 // 00311 // FUNCTION DESCRIPTION ************************************************** 00312 // 00313 // IdCntGetX (macro) 00314 // 00315 // RESUME: Recupere la valeur de la coord. X d'un point d'un contour 00316 // 00317 // DESCRIPTION: Recupere la valeur de la coordonnee X d'un point d'un contour. 00318 // Le point DOIT deja exister. 00319 // 00320 // SYNTAXE: nombre valCoordX = IdCntGetX(PCONTOUR cnt,int numPoint); 00321 // 00322 // RETOUR: type : entier, ou double, ou ... 00323 // role : 00324 // 00325 // PARAMETRES: 00326 // nom : cnt 00327 // type : PCONTOUR 00328 // role : contour d'origine. 00329 // 00330 // nom : i 00331 // type : entier 00332 // role : numero du point dont on veut la coordonnee X 00333 // 00334 // FICHIER: idcnt.h 00335 // 00336 // EXEMPLE: 00337 // 00338 // ******************************************************** END DESCRIPTION 00339 // 00340 // FUNCTION DESCRIPTION ************************************************** 00341 // 00342 // IdCntGetY (macro) 00343 // 00344 // RESUME: Recupere la valeur de la coord. Y d'un point d'un contour 00345 // 00346 // DESCRIPTION: Recupere la valeur de la coordonnee Y d'un point d'un contour. 00347 // Le point DOIT deja exister. 00348 // 00349 // SYNTAXE: nombre valCoordy = IdCntGetY(PCONTOUR cnt,int numPoint); 00350 // 00351 // RETOUR: type : entier, ou double, ou ... 00352 // role : 00353 // 00354 // PARAMETRES: 00355 // nom : cnt 00356 // type : PCONTOUR 00357 // role : contour d'origine. 00358 // 00359 // nom : i 00360 // type : entier 00361 // role : numero du point dont on veut la coordonnee y 00362 // 00363 // FICHIER: idcnt.h 00364 // 00365 // EXEMPLE: 00366 // 00367 // ******************************************************** END DESCRIPTION 00368 // 00369 // FUNCTION DESCRIPTION ************************************************** 00370 // 00371 // IdCntModifyPoint (macro) 00372 // 00373 // RESUME: Modifie la valeur des coord. X Y d'1 point d'un contour 00374 // 00375 // DESCRIPTION: Positionne la valeur des coord. X Y d'un point d'un contour. 00376 // Le point DOIT deja exister (aucun controle !!!). 00377 // 00378 // SYNTAXE: void IdCntSetY(PCONTOUR cnt, int numPoint, nombre coordX, nombre coordY); 00379 // 00380 // RETOUR: type : rien 00381 // role : 00382 // 00383 // PARAMETRES: 00384 // nom : cnt 00385 // type : PCONTOUR 00386 // role : contour d'origine. 00387 // 00388 // nom : i 00389 // type : entier 00390 // role : numero du point a modifier 00391 // 00392 // nom : coordX, coordY 00393 // type : entier, ou double, ou ... 00394 // role : coordonne Y du point a modifier 00395 // 00396 // FICHIER: idcnt.h 00397 // 00398 // EXEMPLE: 00399 // ******************************************************** END DESCRIPTION 00400 // 00401 // FUNCTION DESCRIPTION ************************************************** 00402 // 00403 // IdCntAllocLikeContour (macro) 00404 // 00405 // RESUME: Alloc. d'1 contour de memes taille et type qu'1 autre 00406 // 00407 // DESCRIPTION: Allocation d'un contour de memes taille et meme type 00408 // qu'un autre. 00409 // 00410 // SYNTAXE: PCONTOUR cnt2 = IdCntAllocLikeContour (PCONTOUR cnt1 ); 00411 // 00412 // RETOUR: type : PCONTOUR 00413 // role : Pointeur vers le contour alloue (a convertir en un type 00414 // valide : PCONTOUR_UCHAR par exemple ). 00415 // 00416 // PARAMETRES: nom : contour1 00417 // type : PCONTOUR, ou PCONTOUR_??? 00418 // role : Pointeur vers le contour 'modele'. 00419 // 00420 // FICHIER: idcnt.h 00421 // 00422 // ******************************************************** END DESCRIPTION 00423 // 00424 // FUNCTION DESCRIPTION ************************************************** 00425 // 00426 // IdCntSameSizeAndType (macro) 00427 // 00428 // RESUME: Comparaison du type et de la taille de deux contours. 00429 // 00430 // DESCRIPTION: Comparaison du type et de la taille de deux contours. 00431 // 00432 // SYNTAXE: int retCode = IdCntSameSizeAndType(PCONTOUR cnt1, PCONTOUR cnt2 ); 00433 // 00434 // RETOUR: type : int 00435 // role : Vrai si les deux contours EXISTENT et ont la meme taille et 00436 // le meme type. 00437 // 00438 // PARAMETRES: nom : cnt1, cnt2 00439 // type : PCONTOUR, ou PCONTOUR_??? 00440 // role : Pointeurs vers les contours a comparer. 00441 // 00442 // FICHIER : idcnt.h 00443 // 00444 // ******************************************************** END DESCRIPTION 00445 // 00446 // FUNCTION DESCRIPTION ************************************************** 00447 // 00448 // IdCntSameSize (macro) 00449 // 00450 // RESUME: Comparaison de la taille de deux contours. 00451 // 00452 // DESCRIPTION: Comparaison de la taille de deux contours. 00453 // 00454 // SYNTAXE: int retCode = IdCntSameSize(PCONTOUR cnt1, PCONTOUR cnt2 ); 00455 // 00456 // RETOUR: type : int 00457 // role : Vrai si les deux contours EXISTEMNT et ont la meme taille 00458 // 00459 // PARAMETRES: nom : cnt1, cnt2 00460 // type : PCONTOUR, ou PCONTOUR_??? 00461 // role : Pointeurs vers les contours a comparer. 00462 // 00463 // FICHIER : idcnt.h 00464 // 00465 // ******************************************************** END DESCRIPTION 00466 // 00467 // FUNCTION DESCRIPTION ************************************************** 00468 // 00469 // IdCntSameType (macro) 00470 // 00471 // RESUME: Comparaison du type de deux contours. 00472 // 00473 // DESCRIPTION: Comparaison du type de deux contours. 00474 // 00475 // SYNTAXE: int retCode = IdCntSameType(PCONTOUR cnt1, PCONTOUR cnt2 ); 00476 // 00477 // RETOUR: type : int 00478 // role : Vrai si les deux contours EXISTENT et ont le meme type. 00479 // 00480 // PARAMETRES: nom : cnt1, cnt2 00481 // type : PCONTOUR, ou PCONTOUR_??? 00482 // role : Pointeurs vers les contours a comparer. 00483 // 00484 // FICHIER : idcnt.h 00485 // 00486 // ******************************************************** END DESCRIPTION 00487 00488 00489 #endif

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