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

idmatric.h

Go to the documentation of this file.
00001 /************************************************************************* 00002 * $Id: idmatric.h,v 1.1 2005/09/09 08:22:37 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 __IDMATRIC_H__ 00037 #define __IDMATRIC_H__ 00038 00039 #include "idima.h" 00040 #include "idsig.h" 00041 #include "idpoint.h" 00042 00043 /************************************************************************* 00044 * Description : Declarations diverses permettant d'utiliser les types 00045 * MATRIX VECTOR 00046 * 00047 * 00048 **************************************************************************/ 00049 00050 typedef void ** PPMATRICE ; 00051 typedef char ** PPMATRICE_CHAR ; 00052 typedef unsigned char ** PPMATRICE_UCHAR ; 00053 typedef float ** PPMATRICE_FLOAT ; 00054 typedef double ** PPMATRICE_DOUBLE ; 00055 typedef COMPLEX ** PPMATRICE_COMPLEX ; 00056 typedef RGB ** PPMATRICE_RGB ; 00057 typedef RGBA ** PPMATRICE_RGBA ; /*CG */ 00058 typedef short ** PPMATRICE_SHORT ; 00059 typedef unsigned short ** PPMATRICE_USHORT ; 00060 typedef long ** PPMATRICE_LONG ; 00061 typedef unsigned long ** PPMATRICE_ULONG ; 00062 typedef COMPLEX_DOUBLE ** PPMATRICE_COMPLEX_DOUBLE ; 00063 typedef COMPLEX_FLOAT ** PPMATRICE_COMPLEX_FLOAT ; 00064 typedef COMPLEX_CHAR ** PPMATRICE_COMPLEX_CHAR ; 00065 typedef COMPLEX_UCHAR ** PPMATRICE_COMPLEX_UCHAR ; 00066 typedef COMPLEX_SHORT ** PPMATRICE_COMPLEX_SHORT ; 00067 typedef COMPLEX_USHORT ** PPMATRICE_COMPLEX_USHORT ; 00068 typedef COMPLEX_LONG ** PPMATRICEE_COMPLEX_LONG ; 00069 typedef COMPLEX_ULONG ** PPMATRICE_COMPLEX_ULONG ; 00070 00071 typedef void ** PPMATRIX; 00072 typedef char ** PPMATRIX_CHAR ; 00073 typedef unsigned char ** PPMATRIX_UCHAR ; 00074 typedef float ** PPMATRIX_FLOAT ; 00075 typedef double ** PPMATRIX_DOUBLE ; 00076 typedef COMPLEX ** PPMATRIXE_COMPLEX ; 00077 typedef RGB ** PPMATRIX_RGB ; 00078 typedef RGBA ** PPMATRIX_RGBA ; 00079 typedef short ** PPMATRIX_SHORT ; 00080 typedef unsigned short ** PPMATRIX_USHORT ; 00081 typedef long ** PPMATRIX_LONG ; 00082 typedef unsigned long ** PPMATRIX_ULONG ; 00083 typedef COMPLEX_DOUBLE ** PPMATRIX_COMPLEX_DOUBLE ; 00084 typedef COMPLEX_FLOAT ** PPMATRIX_COMPLEX_FLOAT ; 00085 typedef COMPLEX_CHAR ** PPMATRIX_COMPLEX_CHAR ; 00086 typedef COMPLEX_UCHAR ** PPMATRIX_COMPLEX_UCHAR ; 00087 typedef COMPLEX_SHORT ** PPMATRIX_COMPLEX_SHORT ; 00088 typedef COMPLEX_USHORT ** PPMATRIX_COMPLEX_USHORT ; 00089 typedef COMPLEX_LONG ** PPMATRIXE_COMPLEX_LONG ; 00090 typedef COMPLEX_ULONG ** PPMATRIX_COMPLEX_ULONG ; 00091 00092 00093 #define MAT_CHAR (MAT | TY_CHAR) 00094 #define MAT_UCHAR (MAT | TY_UCHAR) 00095 #define MAT_SHORT (MAT | TY_SHORT) 00096 #define MAT_USHORT (MAT | TY_USHORT) 00097 #define MAT_LONG (MAT | TY_LONG) 00098 #define MAT_ULONG (MAT | TY_ULONG) 00099 #define MAT_FLOAT (MAT | TY_FLOAT) 00100 #define MAT_DOUBLE (MAT | TY_DOUBLE) 00101 #define MAT_COMPLEX (MAT | TY_COMPLEX) 00102 #define MAT_COMPLEX_DOUBLE (MAT | TY_COMPLEX_DOUBLE) 00103 #define MAT_COMPLEX_FLOAT (MAT | TY_COMPLEX_FLOAT ) 00104 #define MAT_COMPLEX_CHAR (MAT | TY_COMPLEX_CHAR ) 00105 #define MAT_COMPLEX_UCHAR (MAT | TY_COMPLEX_UCHAR ) 00106 #define MAT_COMPLEX_SHORT (MAT | TY_COMPLEX_SHORT ) 00107 #define MAT_COMPLEX_USHORT (MAT | TY_COMPLEX_USHORT) 00108 #define MAT_COMPLEX_LONG (MAT | TY_COMPLEX_LONG ) 00109 #define MAT_COMPLEX_ULONG (MAT | TY_COMPLEX_ULONG ) 00110 #define MAT_BIT (MAT | TY_BIT ) 00111 #define MAT_POINTER (MAT | TY_POINTER) 00112 00113 00114 typedef void * PVECTOR ; 00115 typedef char * PVECTOR_CHAR ; 00116 typedef unsigned char * PVECTOR_UCHAR ; 00117 typedef float * PVECTOR_FLOAT ; 00118 typedef double * PVECTOR_DOUBLE ; 00119 typedef COMPLEX * PVECTOR_COMPLEX ; 00120 typedef short * PVECTOR_SHORT ; 00121 typedef unsigned short * PVECTOR_USHORT ; 00122 typedef long * PVECTOR_LONG ; 00123 typedef unsigned long * PVECTOR_ULONG ; 00124 typedef COMPLEX_DOUBLE * PVECTOR_COMPLEX_DOUBLE ; 00125 typedef COMPLEX_FLOAT * PVECTOR_COMPLEX_FLOAT ; 00126 typedef COMPLEX_CHAR * PVECTOR_COMPLEX_CHAR ; 00127 typedef COMPLEX_UCHAR * PVECTOR_COMPLEX_UCHAR ; 00128 typedef COMPLEX_SHORT * PVECTOR_COMPLEX_SHORT ; 00129 typedef COMPLEX_USHORT * PVECTOR_COMPLEX_USHORT ; 00130 typedef COMPLEX_LONG * PVECTOR_COMPLEX_LONG ; 00131 typedef COMPLEX_ULONG * PVECTOR_COMPLEX_ULONG ; 00132 typedef void ** PVECTOR_POINTER ; 00133 00134 00135 typedef void * PVECTEUR ; 00136 typedef char * PVECTEUR_CHAR ; 00137 typedef unsigned char * PVECTEUR_UCHAR ; 00138 typedef float * PVECTEUR_FLOAT ; 00139 typedef double * PVECTEUR_DOUBLE ; 00140 typedef COMPLEX * PVECTEUR_COMPLEX ; 00141 typedef short * PVECTEUR_SHORT ; 00142 typedef unsigned short * PVECTEUR_USHORT ; 00143 typedef long * PVECTEUR_LONG ; 00144 typedef unsigned long * PVECTEUR_ULONG ; 00145 typedef COMPLEX_DOUBLE * PVECTEUR_COMPLEX_DOUBLE ; 00146 typedef COMPLEX_FLOAT * PVECTEUR_COMPLEX_FLOAT ; 00147 typedef COMPLEX_CHAR * PVECTEUR_COMPLEX_CHAR ; 00148 typedef COMPLEX_UCHAR * PVECTEUR_COMPLEX_UCHAR ; 00149 typedef COMPLEX_SHORT * PVECTEUR_COMPLEX_SHORT ; 00150 typedef COMPLEX_USHORT * PVECTEUR_COMPLEX_USHORT ; 00151 typedef COMPLEX_LONG * PVECTEUR_COMPLEX_LONG ; 00152 typedef COMPLEX_ULONG * PVECTEUR_COMPLEX_ULONG ; 00153 typedef void ** PVECTEUR_POINTER ; 00154 00155 #define VECT_CHAR (SIG | TY_CHAR) 00156 #define VECT_UCHAR (SIG | TY_UCHAR) 00157 #define VECT_SHORT (SIG | TY_SHORT) 00158 #define VECT_USHORT (SIG | TY_USHORT) 00159 #define VECT_LONG (SIG | TY_LONG) 00160 #define VECT_ULONG (SIG | TY_ULONG) 00161 #define VECT_FLOAT (SIG | TY_FLOAT) 00162 #define VECT_DOUBLE (SIG | TY_DOUBLE) 00163 #define VECT_COMPLEX (SIG | TY_COMPLEX) 00164 #define VECT_COMPLEX_DOUBLE (SIG | TY_COMPLEX_DOUBLE) 00165 #define VECT_COMPLEX_FLOAT (SIG | TY_COMPLEX_FLOAT ) 00166 #define VECTG_COMPLEX_CHAR (SIG | TY_COMPLEX_CHAR ) 00167 #define VECT_COMPLEX_UCHAR (SIG | TY_COMPLEX_UCHAR ) 00168 #define VECT_COMPLEX_SHORT (SIG | TY_COMPLEX_SHORT ) 00169 #define VECT_COMPLEX_USHORT (SIG | TY_COMPLEX_USHORT) 00170 #define VECT_COMPLEX_LONG (SIG | TY_COMPLEX_LONG ) 00171 #define VECT_COMPLEX_ULONG (SIG | TY_COMPLEX_ULONG ) 00172 #define VECT_POINTER (SIG | TY_POINTER) 00173 00174 00175 00176 00177 #ifndef SWIG 00178 #define IdMatDimX(a) IdImaDimX((a) ) 00179 #define IdMatDimY(a) IdImaDimY((a) ) 00180 #define IdMatUsedNbX(image_) ( _IdImaPrivate(image_)->UsedNbX) 00181 #define IdMatUsedNbY(image_) ( _IdImaPrivate(image_)->UsedNbY) 00182 #define IdMatGetUsedNbX(imag_) ( _IdImaPrivate(imag_)->UsedNbX) 00183 #define IdMatSetUsedNbX(imag_,nb) ( _IdImaPrivate(imag_)->UsedNbX=(nb) ) 00184 #define IdMatGetUsedNbY(imag_) ( _IdImaPrivate(imag_)->UsedNbY) 00185 #define IdMatSetUsedNbY(imag_,nb) ( _IdImaPrivate(imag_)->UsedNbY=(nb) ) 00186 #define IdMatType(image_) ( _IdImaPrivate(image_)->Type) 00187 #define IdMatAlloc(a,b,c) IdImaAlloc( (a),(b),(c) ) 00188 #define IdVectAlloc(a,b) IdSigAlloc( (a),(b) ) 00189 #define IdMatFree(a) IdImaFree( (a) ) 00190 #define IdVectFree(a) IdSigFree( (a) ) 00191 #else 00192 int IdMatDimX(PPMATRICE); 00193 int IdMatDimY(PPMATRICE); 00194 int IdMatUsedNbX(PPMATRICE); 00195 int IdMatUsedNbY(PPMATRICE); 00196 int IdMatGetUsedNbX(PPMATRICE); 00197 int IdMatGetUsedNbY(PPMATRICE); 00198 int IdMatSetUsedNbX(PPMATRICE,int); 00199 int IdMatSetUsedNbY(PPMATRICE,int); 00200 int IdMatType(PPMATRICE); 00201 PPMATRICE IdMatAlloc(int,int,int); 00202 PVECTEUR IdVectAlloc(int,int); 00203 void IdMatFree(PPMATRICE); 00204 void IdVectFree(PVECTEUR); 00205 #endif 00206 00207 00208 void IdMatLubksb (PPMATRICE_DOUBLE,PVECTOR_LONG,PVECTOR_DOUBLE); 00209 int IdMatLudcmp (PPMATRICE_DOUBLE,PVECTOR_LONG,double *); 00210 int IdMatInv (PPMATRICE_FLOAT,PPMATRICE_FLOAT *); 00211 int IdMatInvd (PPMATRICE_FLOAT,PPMATRICE_FLOAT *,float *); 00212 int IdMatProd (PPMATRICE_FLOAT,PPMATRICE_FLOAT,PPMATRICE_FLOAT *); 00213 int IdMatTransp (PPMATRICE_FLOAT,PPMATRICE_FLOAT *); 00214 int IdMatJacobi (PPMATRICE_DOUBLE, PVECTOR_DOUBLE, PPMATRICE_DOUBLE, int *); 00215 00216 void IdMatAffMat (PPMATRICE_FLOAT); 00217 void IdVectAffVect (PVECTOR_FLOAT); 00218 int IdMatVectProduct (PPMATRICE_FLOAT,PVECTOR_FLOAT,PVECTOR_FLOAT); 00219 int IdMatTranspose (PPMATRICE_FLOAT,PPMATRICE_FLOAT); 00220 double IdVectScalarProduct (PVECTOR_FLOAT,PVECTOR_FLOAT); 00221 int IdVectCrossProduct (PVECTOR_FLOAT,PVECTOR_FLOAT,PVECTOR_FLOAT); 00222 int IdMatProduct (PPMATRICE_FLOAT, PPMATRICE_FLOAT, PPMATRICE_FLOAT); 00223 double IdVectNorm (PVECTOR_FLOAT); 00224 int IdVectScalarDiv (PVECTOR_FLOAT,double,PVECTOR_FLOAT); 00225 int IdVectNormalize (PVECTOR_FLOAT,PVECTOR_FLOAT); 00226 int IdVectEq (PVECTOR_FLOAT,PVECTOR_FLOAT); 00227 int IdMatEq (PPMATRICE_FLOAT,PPMATRICE_FLOAT); 00228 int IdMatUnit (PPMATRICE_FLOAT); 00229 00230 00231 PPMATRICE_FLOAT IdMatMatricePassage (IDPOINT,IDPOINT,IDPOINT); 00232 void IdMatPassageImageReelle (IDPOINT, PIDPOINT, PPMATRICE_FLOAT); 00233 void IdMatPassageReelleImage (PIDPOINT, IDPOINT, PPMATRICE_FLOAT); 00234 void IdVectTranslatePoint (PIDPOINT, PVECTOR_FLOAT); 00235 void IdVectTranslatePointInv (PIDPOINT, PVECTOR_FLOAT); 00236 void IdMatCreatMatTranslation (PPMATRICE_FLOAT, PVECTOR_FLOAT); 00237 void IdMatCreatMatRotation (PPMATRICE_FLOAT, PVECTOR_FLOAT, 00238 PVECTOR_FLOAT, PVECTOR_FLOAT); 00239 void IdMatCreatMatScaling (PPMATRICE_FLOAT, double, double, double); 00240 void IdVectVectToHomogene (PVECTOR_FLOAT, PVECTOR_FLOAT); 00241 void IdVectHomogeneToVect (PVECTOR_FLOAT, PVECTOR_FLOAT); 00242 00243 PVECTOR_COMPLEX IdCalcRacinesPoly2 (double, double, double); 00244 PVECTOR_COMPLEX IdCalcRacinesPoly3 (double, double, double, double); 00245 00246 int IdMatEstimKalman (PVECTOR_FLOAT, PPMATRICE_FLOAT, PVECTOR_FLOAT, 00247 PPMATRICE_FLOAT, PPMATRICE_FLOAT, PVECTOR_FLOAT, 00248 PPMATRICE_FLOAT); 00249 int IdMatPrediKalman (PVECTOR_FLOAT, PPMATRICE_FLOAT, PPMATRICE_FLOAT, 00250 PPMATRICE_FLOAT, PVECTOR_FLOAT, PPMATRICE_FLOAT); 00251 int IdMatEstimKalmanEtendu (PPMATRICE_FLOAT, PPMATRICE_FLOAT, PPMATRICE_FLOAT, 00252 PPMATRICE_FLOAT, PPMATRICE_FLOAT); 00253 int IdMatPrediKalmanEtendu (PPMATRICE_FLOAT, PPMATRICE_FLOAT, PPMATRICE_FLOAT, 00254 PPMATRICE_FLOAT); 00255 00256 00257 /* FUNCTION DESCRIPTION **************************************************** 00258 00259 IdMatAlloc (macro) 00260 00261 RESUME: Allocation memoire d'un objet libido de type PPMATRICE 00262 00263 DESCRIPTION: Allocation memoire d'un objet libido de type PPMATRICE. 00264 (Meme fonctionnement que IdImaAlloc) 00265 00266 SYNTAXE: PPMATRICE matrice = IdMatAlloc ( int taille_x, int taille_y, int typeMat); 00267 00268 RETOUR: type : PPMATRICE 00269 role : pointeur sur l'objet et les donnees images 00270 00271 PARAMETRES : nom : taille_x 00272 type : int 00273 role : taille en x (nb colonnes) de la matrice a creer 00274 00275 nom : taille_y 00276 type : int 00277 role : taille en y (nb de lignes) de la matrice a creer 00278 00279 nom : type 00280 type : int 00281 role : type de la matrice a creer (MAT_xxx ex: MAT_UCHAR) 00282 00283 FICHIER: idmatric.c 00284 00285 ********************************************************* END DESCRIPTION */ 00286 00287 00288 /* FUNCTION DESCRIPTION ************************************************** 00289 00290 IdMatDimX (macro) 00291 00292 RESUME: Donne la taille en X d'une matrice. 00293 00294 DESCRIPTION: Donne la taille en X d'une matrice. 00295 00296 SYNTAXE: int dimx = IdMatDimX (PPMATRICE matrice); 00297 00298 RETOUR: type : int 00299 role : taille en x de la matrice 00300 00301 PARAMETRES: nom : image 00302 type : objet matrice Libido 00303 role : Image LibIDO a scruter. 00304 00305 EXEMPLE: 00306 00307 ******************************************************** END DESCRIPTION */ 00308 00309 /* FUNCTION DESCRIPTION ************************************************** 00310 00311 IdMatDimY (macro) 00312 00313 RESUME: Donne la taille en Y d'une matrice. 00314 00315 DESCRIPTION: Donne la taille en Y d'une matrice. 00316 00317 SYNTAXE: int dimy = IdMatDimY (PPMATRICE matrice); 00318 00319 RETOUR: type : int 00320 role : taille en y de l'matrice 00321 00322 PARAMETRES: nom : matrice 00323 type : objet matrice Libido 00324 role : matrice LibIDO a scruter. 00325 00326 EXEMPLE: 00327 00328 ******************************************************** END DESCRIPTION */ 00329 00330 /* FUNCTION DESCRIPTION ************************************************** 00331 00332 IdMatType (macro) 00333 00334 RESUME: Donne le type d'une matrice LibIDO. 00335 00336 DESCRIPTION: Donne le type d'une matrice LibIDO. 00337 00338 SYNTAXE: int typ_im = IdMatType (PPMATRICE matrice); 00339 00340 RETOUR: type : int 00341 role : Type de la matrice LibIDO. #defini par le tableau suivant : 00342 00343 00344 #define MAT_CHAR (MAT | TY_CHAR) 00345 #define MAT_UCHAR (MAT | TY_UCHAR) 00346 #define MAT_SHORT (MAT | TY_SHORT) 00347 #define MAT_USHORT (MAT | TY_USHORT) 00348 #define MAT_LONG (MAT | TY_LONG) 00349 #define MAT_FLOAT (MAT | TY_FLOAT) 00350 #define MAT_DOUBLE (MAT | TY_DOUBLE) 00351 #define MAT_COMPLEX (MAT | TY_COMPLEX) 00352 #define MAT_COMPLEX_DOUBLE (MAT | TY_COMPLEX_DOUBLE) 00353 #define MAT_COMPLEX_FLOAT (MAT | TY_COMPLEX_FLOAT ) 00354 #define MAT_COMPLEX_CHAR (MAT | TY_COMPLEX_CHAR ) 00355 #define MAT_COMPLEX_UCHAR (MAT | TY_COMPLEX_UCHAR ) 00356 #define MAT_COMPLEX_SHORT (MAT | TY_COMPLEX_SHORT ) 00357 #define MAT_COMPLEX_USHORT (MAT | TY_COMPLEX_USHORT) 00358 #define MAT_COMPLEX_LONG (MAT | TY_COMPLEX_LONG ) 00359 #define MAT_BIT (MAT | TY_BIT ) 00360 00361 00362 PARAMETRES: nom : im 00363 type : Objet matrice LibIDO 00364 role : Image matrice a scruter 00365 00366 EXEMPLE: 00367 00368 ******************************************************** END DESCRIPTION */ 00369 00370 #endif

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