openCARP
Doxygen code documentation for the open cardiac electrophysiology simulator openCARP
IGBheader.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // openCARP is an open cardiac electrophysiology simulator.
3 //
4 // Copyright (C) 2020 openCARP project
5 //
6 // This program is licensed under the openCARP Academic Public License (APL)
7 // v1.0: You can use and redistribute it and/or modify it in non-commercial
8 // academic environments under the terms of APL as published by the openCARP
9 // project v1.0, or (at your option) any later version. Commercial use requires
10 // a commercial license (info@opencarp.org).
11 //
12 // This program is distributed without any warranty; see the openCARP APL for
13 // more details.
14 //
15 // You should have received a copy of the openCARP APL along with this program
16 // and can find it online: http://www.opencarp.org/license
17 // ----------------------------------------------------------------------------
18 
28 #ifndef IGBheader_h
29 #define IGBheader_h
30 
31 #include <cstdio>
32 #include <cstdlib>
33 #include <fstream>
34 #include <cstring>
35 #include <cctype>
36 #include <assert.h>
37 #include <float.h>
38 #include <limits.h>
39 
40 #include "short_float.h"
41 
42 namespace opencarp {
43 
44 #define NALLOC 100
45 
46 #define NUL 0
47 #define INCONNU 0
48 
49 #define IGB_BIG_ENDIAN 666666666
50 #define IGB_LITTLE_ENDIAN 777777777
51 #define N_SYSTEMES 2
52 
53 
54 /* ------------------------ TYPES definition ------------------------------ */
55 #define IGB_BYTE 1 /* -- byte ----------------------------------- */
56 #define IGB_CHAR 2 /* -- Char ----------------------------------- */
57 #define IGB_SHORT 3 /* -- short ---------------------------------- */
58 #define IGB_LONG 4 /* -- long ----------------------------------- */
59 #define IGB_FLOAT 5 /* -- float ---------------------------------- */
60 #define IGB_DOUBLE 6 /* -- Double --------------------------------- */
61 #define IGB_COMPLEX 7 /* -- 2 x float (real part, imaginary part) -- */
62 #define IGB_D_COMPLEX 8 /* -- 2 x Double (real part, imaginary part) - */
63 #define IGB_RGBA 9 /* -- 4 x byte (red, green, blue, alpha) ----- */
64 #define IGB_STRUCTURE 10 /* -- Structure ------------------------------ */
65 #define IGB_POINTER 11 /* -- void * --------------------------------- */
66 #define IGB_LIST 12 /* -- List --------------------------------- */
67 #define IGB_INT 13 /* -- integer -------------------------------- */
68 #define IGB_UINT 14 /* -- unsigned integer------------------------ */
69 #define IGB_USHORT 15 /* -- unsigned short integer------------------ */
70 #define IGB_VEC3_f 16 /* -- 3 X float ------------------------------ */
71 #define IGB_VEC3_d 17 /* -- 3 X double ----------------------------- */
72 #define IGB_VEC4_f 18 /* -- 4 X float ------------------------------ */
73 #define IGB_VEC4_d 19 /* -- 4 X double ----------------------------- */
74 #define IGB_HFLOAT 20 /* -- half float ----------------------------- */
75 #define IGB_VEC9_f 21 /* -- 9 X foat ------------------------------- */
76 #define IGB_VEC9_d 22 /* -- 9 X double ----------------------------- */
77 #define IGB_MIN_TYPE 1
78 #define IGB_MAX_TYPE 22
79 
80 #define Byte hByte
81 
82 /* Types de trames */
83 #define MIN_TRAME 0
84 #define IGB_C8 0
85 #define IGB_C4 1
86 #define IGB_HEX 2
87 #define HEXEDGES 3
88 #define HEXBRIDGES 4
89 #define HEXLINES 5
90 #define HEX2 6
91 #define MAX_TRAME 6
92 #define NTRAMES 7
93 
94 
95 /* define for endedness */
96 #define IGB_ENDIAN_VAL -1.24e5
97 #define IGB_LITTLE_END_REP 0,48,242,199
98 
99 // error codes
100 #define ERR_EOF_IN_HEADER 1
101 #define ERR_LINE_TOO_LONG 2
102 #define ERR_UNPRINTABLE_CHAR 3
103 #define ERR_IGB_SYNTAX 4
104 #define ERR_UNDEFINED_X_Y_TYPE 5
105 #define ERR_SIZE_REDEFINED 6
106 #define ERR_SIZE_NOT_DEFINED 7
107 #define WARN_DIM_INCONSISTENT 256
108 
109 #ifndef PrMTYPES
110 #define PrMTYPES
111 /*
112  Definition des types List, bytes, Char, Double, complex d_complex
113  et rgba
114 */
115 typedef struct List
116 {
117  long nitems;
118  char *items;
119 }
121 typedef unsigned char byte;
122 #ifndef __GL_GL_H__
123 typedef unsigned char Byte;
124 typedef char *String;
125 #endif
126 typedef signed char Char;
127 typedef struct S_Complex S_Complex;
128 typedef double Double;
129 typedef struct D_Complex D_Complex;
130 typedef float Float;
131 typedef int Int;
132 typedef long Long;
133 typedef unsigned int UInt;
134 typedef short Short;
135 typedef int BooleaN;
136 typedef int Flag;
137 typedef char *RDir;
138 typedef char *RFile;
139 typedef char *RWDir;
140 typedef char *RWFile;
141 typedef char *WDir;
142 typedef char *WFile;
143 typedef char **Text;
144 typedef void Any;
145 struct S_Complex
146 {
148 };
149 struct D_Complex
150 {
152 };
153 #endif
154 
155 /* Indice de chaque composante dans le vecteur b[] de l'union rgba */
156 typedef union rgba {
157  unsigned long l;
158  byte b[4];
159 } rgba ;
160 #define RGBA_ROUGE 3
161 #define RGBA_VERT 2
162 #define RGBA_BLEU 1
163 #define RGBA_ALPHA 0
164 
165 #define HFLT_MIN -65504
166 #define HFLT_MAX 65504
167 
168 /* -------------- Definition du type des variables globales de header.c - */
169 
170 #ifndef HEADER_GLOBALS
171 extern bool Header_Quiet;
172 extern const char *Header_Type[IGB_MAX_TYPE+1];
173 extern unsigned short Data_Size[IGB_MAX_TYPE+1];
174 extern int Num_Components[IGB_MAX_TYPE+1];
175 extern const char *Header_Systeme[N_SYSTEMES];
176 extern unsigned long Header_Systeme_No[N_SYSTEMES];
177 extern char Header_Message[256];
178 #endif
179 
180 class IGBheader;
181 
182 template<class T>
183 int read_IGB_data( T* dp, int numt, IGBheader* h, char *buf=NULL );
184 
185 template<class T>
186 T IGB_convert_buffer_datum( IGBheader*, void *buf, int a );
187 
189 {
190  private:
191  FILE* file=NULL;
192  int v_x=0, v_y=0, v_z=1, v_t=1;
193  int v_type=0;
194  int v_taille ;
195  unsigned long v_systeme=endian() ;
196  int v_num=0;
197  int v_bin=0;
198  int v_trame = IGB_C8;
199  unsigned int v_lut=0 ;
200  unsigned int v_comp=0 ;
201  float v_epais=0;
202  float v_org_x=1., v_org_y=1., v_org_z=1., v_org_t=0.;
203  float v_inc_x=1., v_inc_y=1., v_inc_z=1., v_inc_t=1.;
204  float v_dim_x, v_dim_y, v_dim_z, v_dim_t ;
205  float *v_vect_z=NULL;
206  char v_unites_x[41]={}, v_unites_y[41]={}, v_unites_z[41]={}, v_unites_t[41]={};
208  char v_unites[41]={};
209  float v_facteur=1., v_zero=0.;
210  char v_struct_desc[41]={};
211  char v_aut_name[41]={};
212  char** v_comment=(char**)calloc(NALLOC,sizeof(char*));
213  void* v_transparent=NULL;
214  int puts_fcn(FILE *, char *);
215  long tell(FILE *);
216 
217  // boolean flags to indicate if a default value has been overridden
218  bool bool_x=false, bool_y=false, bool_z=false, bool_t=false;
219  bool bool_type=false;
220  bool bool_taille=false;
221  bool bool_num=false;
222  bool bool_bin=false;
223  bool bool_trame=false;
224  bool bool_lut=false;
225  bool bool_comp=false;
226  bool bool_epais=false;
227  bool bool_org_x=false, bool_org_y=false, bool_org_z=false, bool_org_t=false;
228  bool bool_inc_x=false, bool_inc_y=false, bool_inc_z=false, bool_inc_t=false;
229  bool bool_dim_x, bool_dim_y=false, bool_dim_z=false, bool_dim_t=false;
230  bool bool_vect_z=false;
231  bool bool_unites_x=false, bool_unites_y=false, bool_unites_z=false, bool_unites_t=false;
232  bool bool_unites=false;
233  bool bool_facteur=false, bool_zero=false;
234  bool bool_struct_desc=false;
235  bool bool_aut_name=false;
236  bool bool_comment=false;
237  bool bool_transparent=false;
238  char transstr[257];
239 
240  public:
241  IGBheader( FILE *f = NULL, bool read=false, bool quiet=false );
242  IGBheader( IGBheader *h ) { *this=*h; }
243  ~IGBheader();
244  int write();
245  int read( bool quiet=false );
246  void fileptr( FILE* f );
247  FILE* fileptr(void){ return file; }
248  void close(void){fclose(file);}
249  void swab( void *, int nd=-1 );
250  inline double from_raw( double a ){ return a*v_facteur+v_zero; }
251  inline double to_raw( double a ){ return (a-v_zero)/v_facteur; }
252  inline int slice_sz(){ return v_x*v_y*v_z; }
253  void comment( char* );
254  inline char **comment(void){return v_comment;}
255  inline int data_size(void){return Data_Size[v_type];}
256  inline int x(void){ return v_x; }
257  inline int x( bool &set ){ set=bool_x; return v_x; }
258  inline void x( int a ){ v_x = a; bool_x = true;}
259  inline int y(void){ return v_y; }
260  inline int y( bool &set ){ set=bool_y; return v_y; }
261  inline void y( int a ){ v_y = a; bool_y = true;}
262  inline int z(void){ return v_z; }
263  inline int z( bool &set ){ set=bool_z; return v_z; }
264  inline void z( int a ){ v_z = a; bool_z = true;}
265  inline int t(void){ return v_t; }
266  inline int t( bool &set ){ set=bool_t; return v_t; }
267  inline void t( int a ){ v_t = a; bool_t = true;}
268  inline int type(void){ return v_type; }
269  inline int type( bool &set ){ set=bool_type; return v_type; }
270  inline void type( int a ){ v_type = a; bool_type = true; }
271  void type( char* );
272  inline int taille(void){ return v_taille; }
273  inline int taille( bool &set ){ set=bool_taille; return v_taille; }
274  inline void taille( int a ){ v_taille = a; bool_taille = true;}
275  inline int num(void){ return v_num; }
276  inline int num( bool &set ){ set=bool_num; return v_num; }
277  inline void num( int a ){ v_num = a; bool_num = true;}
278  inline int bin(void){ return v_bin; }
279  inline int bin( bool &set ){ set=bool_bin; return v_bin; }
280  inline void bin( int a ){ v_bin = a; bool_bin = true;}
281  inline int trame(void){ return v_trame; }
282  inline int trame( bool &set ){ set=bool_trame; return v_trame; }
283  inline void trame( int a ){ v_trame = a; bool_trame = true;}
284  const char* systemestr(void);
285  inline int systeme( void ){ return v_systeme; }
286  void systeme( const char* s );
287  inline unsigned int lut(void){ return v_lut; }
288  inline unsigned int lut( bool &set ){ set=bool_x; return v_x; }
289  inline void lut( unsigned int a ){ v_lut = a; bool_lut = true; }
290  inline unsigned int comp(void){ return v_comp; }
291  inline unsigned int comp( bool &set ){ set=bool_lut; return v_lut; }
292  inline void comp( unsigned int a ){ v_comp = a; bool_comp = true;}
293  inline float epais(void){ return v_epais; }
294  inline float epais( bool &set ){ set=bool_epais; return v_epais; }
295  inline void epais( float a ){ v_epais = a; bool_epais = true;}
296  inline float org_x(void){ return v_org_x; }
297  inline float org_x( bool &set ){ set=bool_org_x; return v_org_x; }
298  inline void org_x( float a ){ v_org_x = a; bool_org_x = true; }
299  inline float org_y(void){ return v_org_y; }
300  inline float org_y( bool &set ){ set=bool_org_y; return v_org_y; }
301  inline void org_y( float a ){ v_org_y = a; bool_org_y = true; }
302  inline float org_z(void){ return v_org_z; }
303  inline float org_z( bool &set ){ set=bool_org_z; return v_org_z; }
304  inline void org_z( float a ){ v_org_z = a; bool_org_z = true;}
305  inline float org_t(void){ return v_org_t; }
306  inline float org_t( bool &set ){ set=bool_org_t; return v_org_t; }
307  inline void org_t( float a ){ v_org_t = a; bool_org_t = true;}
308  inline void inc_x( float a ){ v_inc_x = a; bool_inc_x = true;}
309  inline float inc_x( bool &set ){ set=bool_inc_x; return v_inc_x; }
310  inline float inc_x(void){ return v_inc_x; }
311  inline void inc_y( float a ){ v_inc_y = a; bool_inc_y = true;}
312  inline float inc_y( bool &set ){ set=bool_inc_y; return v_inc_y; }
313  inline float inc_y(void){ return v_inc_y; }
314  inline void inc_z( float a ){ v_inc_z = a; bool_inc_z = true;}
315  inline float inc_z( bool &set ){ set=bool_inc_z; return v_inc_z; }
316  inline float inc_z(void){ return v_inc_z; }
317  inline void inc_t( float a ){ v_inc_t = a; bool_inc_t = true;}
318  inline float inc_t( bool &set ){ set=bool_inc_t; return v_inc_t; }
319  inline float inc_t(void){ return v_inc_t; }
320  inline void dim_x( float a ){ v_dim_x = a; bool_dim_x = true;}
321  inline float dim_x( bool &set ){ set=bool_dim_x; return v_dim_x; }
322  inline float dim_x(void){ return v_dim_x; }
323  inline void dim_y( float a ){ v_dim_y = a; bool_dim_y = true;}
324  inline float dim_y( bool &set ){ set=bool_dim_y; return v_dim_y; }
325  inline float dim_y(void){ return v_dim_y; }
326  inline void dim_z( float a ){ v_dim_z = a; bool_dim_y = true;}
327  inline float dim_z( bool &set ){ set=bool_dim_z; return v_dim_z; }
328  inline float dim_z(void){ return v_dim_z; }
329  inline void dim_t( float a ){ v_dim_t = a; bool_dim_t = true;}
330  inline float dim_t( bool &set ){ set=bool_dim_t; return v_dim_t; }
331  inline float dim_t(void){ return v_dim_t; }
332  inline void facteur( float a ){ v_facteur = a; bool_facteur = true; }
333  inline float facteur( bool &set ){ set=bool_facteur; return v_facteur; }
334  inline float facteur(void){ return v_facteur; }
335  inline void zero( float a ){ v_zero = a; bool_zero = true; }
336  inline float zero( bool &set ){ set=bool_zero; return v_zero; }
337  inline float zero(void){ return v_zero; }
338  inline void vect_z( float* a ){ v_vect_z = a; bool_vect_z = true; }
339  inline float* vect_z( bool &set ){ set=bool_vect_z; return v_vect_z; }
340  inline float* vect_z(void){ return v_vect_z; }
341  inline void unites_x( const char* a ){ strcpy(v_unites_x, a); bool_unites_x = true; }
342  inline char* unites_x( bool &set ){ set=bool_unites_x; return v_unites_x; }
343  inline char* unites_x(void){ return v_unites_x; }
344  inline void unites_y( const char* a ){ strcpy(v_unites_y, a); bool_unites_y = true;}
345  inline char* unites_y( bool &set ){ set=bool_unites_y; return v_unites_y; }
346  inline char* unites_y(void){ return v_unites_y; }
347  inline void unites_z( const char* a ){ strcpy(v_unites_z,a); bool_unites_z = true; }
348  inline char* unites_z( bool &set ){ set=bool_unites_z; return v_unites_z; }
349  inline char* unites_z(void){ return v_unites_z; }
350  inline void unites_t( const char* a ){ strcpy(v_unites_t, a); bool_unites_t = true; }
351  inline char* unites_t( bool &set ){ set=bool_unites_t; return v_unites_t; }
352  inline char* unites_t(void){ return v_unites_t; }
353  inline void unites( const char* a ){ strcpy(v_unites, a); bool_unites = true; }
354  inline char* unites( bool &set ){ set=bool_unites; return v_unites; }
355  inline char* unites(void){ return v_unites; }
356  inline void struct_desc( const char* a ){ strcpy(v_struct_desc, a); bool_struct_desc = true; }
357  inline char* struct_desc( bool &set ){ set=bool_struct_desc; return v_struct_desc; }
358  inline char* struct_desc(void){ return v_struct_desc; }
359  inline void aut_name( const char* a ){ strcpy(v_aut_name, a); bool_aut_name = true; }
360  inline char* aut_name( bool &set ){ set=bool_aut_name; return v_aut_name; }
361  inline char* aut_name(void){ return v_aut_name; }
362  inline void transparent( void* a ){ v_transparent=a; bool_transparent = true; }
363  inline void* transparent( bool &set ){ set=bool_transparent; return v_transparent; }
364  inline void* transparent(void){ return v_transparent; }
365  inline char* transparentstr(void){ return transstr; }
366  int num_components(){ return Num_Components[v_type]; }
367  int endian();
368  template<class T> int read_data( T* dp, int numt=1, char *buf=NULL );
369  template<class T> void write_data( T* dp, int numt=1, char *buf=NULL );
370  template<class T> void to_bin( void *buf, T d );
371  template<class T> T convert_buffer_datum( void *buf, int a );
372 };
373 
374 
381 template<class T>
382 void
383 IGBheader::write_data( T* dp, int numt, char *buf )
384 {
385  int slicesize = data_size()*slice_sz()*numt;
386  bool alloc_buf = false;
387  if ( buf==NULL ) {
388  buf = new char[slicesize];
389  alloc_buf = true;
390  }
391 
392  int numprimitive = slice_sz()*num_components();
393  for ( int a=0; a<numprimitive; a++ )
394  to_bin<T>( buf+a*data_size(), dp[a] );
395 
396  fwrite( buf, 1, slicesize, file );
397 
398  if ( alloc_buf ) delete[] buf;
399 }
400 
401 
412 template<class T>
413 int
414 IGBheader::read_data( T* dp, int numt, char *buf )
415 {
416  int slicesize = data_size()*slice_sz()*numt;
417  bool alloc_buf = false;
418  if ( buf==NULL ) {
419  buf = new char[slicesize];
420  alloc_buf = true;
421  }
422 
423  int numread = fread( buf, slice_sz()*numt, data_size(), file );
424 
425  if ( systeme() != endian() ) swab(buf, numread);
426 
427  int numprimitive = numread*num_components(); // adjust vector types
428 
429 #pragma omp parallel for
430  for ( int a=0; a<numprimitive; a++ )
431  dp[a] = convert_buffer_datum<T>( buf, a );
432 
433  if ( alloc_buf ) delete[] buf;
434  return numread;
435 }
436 
437 
444 template<class T>
445 T IGBheader::convert_buffer_datum( void *buf, int a )
446 {
447  T datum;
448 
449  switch ( type() ) {
450  case IGB_BYTE:
451  datum = ((unsigned char *)buf)[a];
452  break;
453  case IGB_CHAR:
454  datum = ((signed char *)buf)[a];
455  break;
456  case IGB_SHORT:
457  datum = ((short *)buf)[a];
458  break;
459  case IGB_LONG:
460  datum = ((long *)buf)[a];
461  break;
462  case IGB_FLOAT:
463  case IGB_VEC3_f:
464  case IGB_VEC4_f:
465  case IGB_VEC9_f:
466  datum = ((float *)buf)[a];
467  break;
468  case IGB_DOUBLE:
469  case IGB_VEC3_d:
470  case IGB_VEC4_d:
471  case IGB_VEC9_d:
472  datum = ((double *)buf)[a];
473  break;
474  case IGB_INT:
475  datum = ((int *)buf)[a];
476  break;
477  case IGB_UINT:
478  datum = ((unsigned int *)buf)[a];
479  break;
480  case IGB_USHORT:
481  datum = ((unsigned short *)buf)[a];
482  break;
483  case IGB_HFLOAT:
484  datum = floatFromShort(((short_float *)buf)[a]);
485  break;
486  default:
487  memset(&datum,0,sizeof(datum));
488  }
489  return datum=from_raw(datum);
490 }
491 
498 #define CONVERT_TYPE(D,m,M,B) { const double min_val = static_cast<double>(m); \
499  const double max_val = static_cast<double>(M); \
500  if(datum < min_val) datum = min_val; else if(datum > max_val) datum = max_val; \
501  D a0 = (D)datum; *((D*)(B))=a0;};
502 
508 template<class T>
509 void
510 IGBheader::to_bin( void *buf, T d )
511 {
512  double datum=to_raw(d);
513  switch ( type() ) {
514  case IGB_BYTE:
515  CONVERT_TYPE( unsigned char, 0, UCHAR_MAX, buf )
516  break;
517  case IGB_CHAR:
518  CONVERT_TYPE( char, CHAR_MIN, CHAR_MAX, buf )
519  break;
520  case IGB_SHORT:
521  CONVERT_TYPE( short, SHRT_MIN, SHRT_MAX, buf )
522  break;
523  case IGB_LONG:
524  CONVERT_TYPE( long, LONG_MIN, LONG_MAX, buf )
525  break;
526  case IGB_FLOAT:
527  CONVERT_TYPE( float, (-FLT_MAX), FLT_MAX, buf )
528  break;
529  case IGB_VEC3_f:
530  case IGB_VEC4_f:
531  case IGB_VEC9_f:
532  assert(0);
533  break;
534  case IGB_DOUBLE:
535  CONVERT_TYPE( double, (-DBL_MAX), DBL_MAX, buf )
536  break;
537  case IGB_VEC3_d:
538  case IGB_VEC4_d:
539  case IGB_VEC9_d:
540  assert(0);
541  break;
542  case IGB_INT:
543  CONVERT_TYPE( int, INT_MIN, INT_MAX, buf )
544  break;
545  case IGB_UINT:
546  CONVERT_TYPE( unsigned int, 0, UINT_MAX, buf )
547  break;
548  case IGB_USHORT:
549  CONVERT_TYPE( unsigned short, 0, USHRT_MAX, buf )
550  break;
551  case IGB_HFLOAT:
552  float fdatum;
553  CONVERT_TYPE( float, HFLT_MIN, HFLT_MAX, &fdatum )
554  *((short_float*)buf) = shortFromFloat(fdatum);
555  break;
556  default:
557  assert(0);
558  }
559 }
560 
561 } // namespace opencarp
562 
563 #endif //IGBheader_h
void close(void)
Definition: IGBheader.h:248
void dim_t(float a)
Definition: IGBheader.h:329
void unites_x(const char *a)
Definition: IGBheader.h:341
int type(bool &set)
Definition: IGBheader.h:269
float org_y(bool &set)
Definition: IGBheader.h:300
float org_x(void)
Definition: IGBheader.h:296
void zero(float a)
Definition: IGBheader.h:335
void to_bin(void *buf, T d)
Definition: IGBheader.h:510
int read(bool quiet=false)
Definition: IGBheader.cc:732
float dim_z(bool &set)
Definition: IGBheader.h:327
int read_data(T *dp, int numt=1, char *buf=NULL)
Definition: IGBheader.h:414
float dim_t(bool &set)
Definition: IGBheader.h:330
float * vect_z(bool &set)
Definition: IGBheader.h:339
void num(int a)
Definition: IGBheader.h:277
void org_x(float a)
Definition: IGBheader.h:298
void comp(unsigned int a)
Definition: IGBheader.h:292
void unites_z(const char *a)
Definition: IGBheader.h:347
char * unites_y(bool &set)
Definition: IGBheader.h:345
char * unites(bool &set)
Definition: IGBheader.h:354
void org_t(float a)
Definition: IGBheader.h:307
void vect_z(float *a)
Definition: IGBheader.h:338
char * unites_t(bool &set)
Definition: IGBheader.h:351
void y(int a)
Definition: IGBheader.h:261
void inc_z(float a)
Definition: IGBheader.h:314
void unites(const char *a)
Definition: IGBheader.h:353
char * unites_z(void)
Definition: IGBheader.h:349
float epais(void)
Definition: IGBheader.h:293
void inc_y(float a)
Definition: IGBheader.h:311
unsigned int comp(bool &set)
Definition: IGBheader.h:291
unsigned int lut(void)
Definition: IGBheader.h:287
float inc_t(void)
Definition: IGBheader.h:319
int y(bool &set)
Definition: IGBheader.h:260
void unites_y(const char *a)
Definition: IGBheader.h:344
unsigned int comp(void)
Definition: IGBheader.h:290
void unites_t(const char *a)
Definition: IGBheader.h:350
const char * systemestr(void)
Definition: IGBheader.cc:1234
int x(bool &set)
Definition: IGBheader.h:257
int systeme(void)
Definition: IGBheader.h:285
void dim_y(float a)
Definition: IGBheader.h:323
float dim_t(void)
Definition: IGBheader.h:331
int taille(bool &set)
Definition: IGBheader.h:273
void org_y(float a)
Definition: IGBheader.h:301
char * struct_desc(void)
Definition: IGBheader.h:358
void t(int a)
Definition: IGBheader.h:267
float inc_y(void)
Definition: IGBheader.h:313
int data_size(void)
Definition: IGBheader.h:255
int bin(bool &set)
Definition: IGBheader.h:279
float inc_y(bool &set)
Definition: IGBheader.h:312
char * unites_x(void)
Definition: IGBheader.h:343
void z(int a)
Definition: IGBheader.h:264
float org_t(bool &set)
Definition: IGBheader.h:306
char * struct_desc(bool &set)
Definition: IGBheader.h:357
char * aut_name(void)
Definition: IGBheader.h:361
float dim_z(void)
Definition: IGBheader.h:328
void * transparent(bool &set)
Definition: IGBheader.h:363
float zero(void)
Definition: IGBheader.h:337
IGBheader(IGBheader *h)
Definition: IGBheader.h:242
int taille(void)
Definition: IGBheader.h:272
unsigned int lut(bool &set)
Definition: IGBheader.h:288
float zero(bool &set)
Definition: IGBheader.h:336
void bin(int a)
Definition: IGBheader.h:280
IGBheader(FILE *f=NULL, bool read=false, bool quiet=false)
Definition: IGBheader.cc:313
int num(bool &set)
Definition: IGBheader.h:276
void type(int a)
Definition: IGBheader.h:270
float * vect_z(void)
Definition: IGBheader.h:340
void taille(int a)
Definition: IGBheader.h:274
float inc_x(void)
Definition: IGBheader.h:310
float dim_y(void)
Definition: IGBheader.h:325
float inc_z(void)
Definition: IGBheader.h:316
char * unites_y(void)
Definition: IGBheader.h:346
int t(bool &set)
Definition: IGBheader.h:266
float facteur(bool &set)
Definition: IGBheader.h:333
void epais(float a)
Definition: IGBheader.h:295
float org_t(void)
Definition: IGBheader.h:305
int trame(bool &set)
Definition: IGBheader.h:282
void lut(unsigned int a)
Definition: IGBheader.h:289
void * transparent(void)
Definition: IGBheader.h:364
void write_data(T *dp, int numt=1, char *buf=NULL)
Definition: IGBheader.h:383
float org_z(void)
Definition: IGBheader.h:302
void struct_desc(const char *a)
Definition: IGBheader.h:356
char * unites_z(bool &set)
Definition: IGBheader.h:348
float dim_y(bool &set)
Definition: IGBheader.h:324
char * unites_t(void)
Definition: IGBheader.h:352
float inc_z(bool &set)
Definition: IGBheader.h:315
float org_x(bool &set)
Definition: IGBheader.h:297
float inc_t(bool &set)
Definition: IGBheader.h:318
char * unites_x(bool &set)
Definition: IGBheader.h:342
void transparent(void *a)
Definition: IGBheader.h:362
void x(int a)
Definition: IGBheader.h:258
char ** comment(void)
Definition: IGBheader.h:254
double to_raw(double a)
Definition: IGBheader.h:251
void dim_x(float a)
Definition: IGBheader.h:320
void org_z(float a)
Definition: IGBheader.h:304
int z(bool &set)
Definition: IGBheader.h:263
float facteur(void)
Definition: IGBheader.h:334
char * unites(void)
Definition: IGBheader.h:355
float org_y(void)
Definition: IGBheader.h:299
float epais(bool &set)
Definition: IGBheader.h:294
void facteur(float a)
Definition: IGBheader.h:332
T convert_buffer_datum(void *buf, int a)
Definition: IGBheader.h:445
void trame(int a)
Definition: IGBheader.h:283
char * aut_name(bool &set)
Definition: IGBheader.h:360
void inc_t(float a)
Definition: IGBheader.h:317
FILE * fileptr(void)
Definition: IGBheader.h:247
void inc_x(float a)
Definition: IGBheader.h:308
float org_z(bool &set)
Definition: IGBheader.h:303
void dim_z(float a)
Definition: IGBheader.h:326
float dim_x(void)
Definition: IGBheader.h:322
float inc_x(bool &set)
Definition: IGBheader.h:309
float dim_x(bool &set)
Definition: IGBheader.h:321
void aut_name(const char *a)
Definition: IGBheader.h:359
void swab(void *, int nd=-1)
Definition: IGBheader.cc:1293
char * transparentstr(void)
Definition: IGBheader.h:365
double from_raw(double a)
Definition: IGBheader.h:250
unsigned int UInt
Definition: IGBheader.h:133
char * WFile
Definition: IGBheader.h:142
char ** Text
Definition: IGBheader.h:143
const char * Header_Type[]
Definition: IGBheader.cc:249
int Flag
Definition: IGBheader.h:136
unsigned short Data_Size[]
Definition: IGBheader.cc:264
char * RFile
Definition: IGBheader.h:138
int read_IGB_data(T *dp, int numt, IGBheader *h, char *buf=NULL)
int BooleaN
Definition: IGBheader.h:135
char Header_Message[256]
Definition: IGBheader.cc:247
uint16_t short_float
Definition: short_float.h:48
long unsigned Header_Systeme_No[]
Definition: IGBheader.cc:282
signed char Char
Definition: IGBheader.h:126
union opencarp::rgba rgba
long Long
Definition: IGBheader.h:132
int Num_Components[]
Definition: IGBheader.cc:275
short Short
Definition: IGBheader.h:134
void Any
Definition: IGBheader.h:144
char * RDir
Definition: IGBheader.h:137
float Float
Definition: IGBheader.h:130
double Double
Definition: IGBheader.h:128
char * RWFile
Definition: IGBheader.h:140
unsigned char Byte
Definition: IGBheader.h:123
char * WDir
Definition: IGBheader.h:141
int Int
Definition: IGBheader.h:131
struct opencarp::List List
char * RWDir
Definition: IGBheader.h:139
T IGB_convert_buffer_datum(IGBheader *, void *buf, int a)
char * String
Definition: IGBheader.h:124
unsigned char byte
Definition: IGBheader.h:121
const char * Header_Systeme[]
Definition: IGBheader.cc:289
bool Header_Quiet
Definition: IGBheader.cc:246
#define IGB_UINT
Definition: IGBheader.h:68
#define N_SYSTEMES
Definition: IGBheader.h:51
#define IGB_HFLOAT
Definition: IGBheader.h:74
#define IGB_VEC9_d
Definition: IGBheader.h:76
#define IGB_MAX_TYPE
Definition: IGBheader.h:78
#define IGB_VEC9_f
Definition: IGBheader.h:75
#define IGB_BYTE
Definition: IGBheader.h:55
#define CONVERT_TYPE(D, m, M, B)
Definition: IGBheader.h:498
#define IGB_VEC3_f
Definition: IGBheader.h:70
#define IGB_VEC4_d
Definition: IGBheader.h:73
#define IGB_LONG
Definition: IGBheader.h:58
#define IGB_INT
Definition: IGBheader.h:67
#define IGB_FLOAT
Definition: IGBheader.h:59
#define IGB_VEC3_d
Definition: IGBheader.h:71
#define IGB_CHAR
Definition: IGBheader.h:56
#define IGB_VEC4_f
Definition: IGBheader.h:72
#define NALLOC
Definition: IGBheader.h:44
#define HFLT_MAX
Definition: IGBheader.h:166
#define IGB_DOUBLE
Definition: IGBheader.h:60
#define IGB_USHORT
Definition: IGBheader.h:69
#define IGB_C8
Definition: IGBheader.h:84
#define HFLT_MIN
Definition: IGBheader.h:165
#define IGB_SHORT
Definition: IGBheader.h:57
char * items
Definition: IGBheader.h:118
unsigned long l
Definition: IGBheader.h:157