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