Main Page   Modules   Data Structures   File List   Data Fields   Globals  

incl/funcdef.h

Go to the documentation of this file.
00001 /* === Doxygen File Comment ============================== */
00009 /* ======================================================= */
00010 
00011                                 /* SPECTRUM */
00012 
00013 #define RD_spec(spectre,i)      \
00014         (((spectre)->data_type) == SHORT ? (spectre)->data.s_data[i] : \
00015         (((spectre)->data_type) == LONG ? (spectre)->data.l_data[i] : \
00016         (((spectre)->data_type) == INT ? (spectre)->data.l_data[i] : \
00017         (((spectre)->data_type) == FLOAT ? (spectre)->data.f_data[i] : \
00018         (((spectre)->data_type) == DOUBLE ? (spectre)->data.d_data[i] : MAXSHORT)))))
00019 
00020 #define WR_spec(spectre,i,val)  \
00021         switch ((spectre)->data_type) {\
00022                 case SHORT  : (spectre)->data.s_data[i] = (short)(val); break; \
00023                 case LONG   : (spectre)->data.l_data[i] = (long)(val); break; \
00024                 case INT   : (spectre)->data.l_data[i] = (long)(val); break; \
00025                 case FLOAT  : (spectre)->data.f_data[i] = (float)(val); break; \
00026                 case DOUBLE : (spectre)->data.d_data[i] = (double)(val); break; \
00027         }
00028 
00029 #define RD_qspec(spectre,i) (spectre)->quality[i]
00030 #define WR_qspec(spectre,i,val) (spectre)->quality[i] = (long)(val)
00031         
00032 #define in_spectrum(spectre,x) (((x)<((spectre)->start-(spectre)->step/2)) || ((x)>((spectre)->end+(spectre)->step/2))) ? 0:1
00033 #define coord_spec(spectre,i) ((spectre)->start + (i)*(spectre)->step)
00034 #define pixel_spec(spectre,x) (0.5 + ((x) - (spectre)->start)/(spectre)->step)
00035 
00036                                 /* SLICE */
00037 
00038 #define RD_slice(slice,i)       \
00039         (((slice)->data_type) == SHORT ? (slice)->data.s_data[i] : \
00040         (((slice)->data_type) == LONG ? (slice)->data.l_data[i] : \
00041         (((slice)->data_type) == INT ? (slice)->data.l_data[i] : \
00042         (((slice)->data_type) == FLOAT ? (slice)->data.f_data[i] : \
00043         (((slice)->data_type) == DOUBLE ? (slice)->data.d_data[i] : MAXSHORT)))))
00044 
00045 #define WR_slice(slice,i,val)   \
00046         switch ((slice)->data_type) {\
00047                 case SHORT  : (slice)->data.s_data[i] = (short)(val); break; \
00048                 case LONG   : (slice)->data.l_data[i] = (long)(val); break; \
00049                 case INT    : (slice)->data.l_data[i] = (long)(val); break; \
00050                 case FLOAT  : (slice)->data.f_data[i] = (float)(val); break; \
00051                 case DOUBLE : (slice)->data.d_data[i] = (double)(val); break; \
00052         }
00053 
00054 #define RD_qslice(slice,i) (slice)->quality[i]
00055 #define WR_qslice(slice,i,val)  (slice)->quality[i] = (long)(val)
00056 
00057                                 /* FRAMES */
00058                                 
00059 #define RD_frame(frame,i,j)     \
00060    (((frame)->data_type) == SHORT ? (frame)->data.s_data[(i)+(j)*(frame)->nx]: \
00061    (((frame)->data_type) == LONG ? (frame)->data.l_data[(i)+(j)*(frame)->nx] : \
00062    (((frame)->data_type) == INT ? (frame)->data.l_data[(i)+(j)*(frame)->nx] : \
00063    (((frame)->data_type) == FLOAT ? (frame)->data.f_data[(i)+(j)*(frame)->nx]: \
00064    (((frame)->data_type) == DOUBLE ? (frame)->data.d_data[(i)+(j)*(frame)->nx]: MAXSHORT)))))
00065 
00066 #define WR_frame(frame,i,j,val) \
00067         switch ((frame)->data_type) {\
00068                 case SHORT  : (frame)->data.s_data[(i)+(j)*(frame)->nx]=(short)(val); \
00069                                                 break; \
00070                 case LONG   : (frame)->data.l_data[(i)+(j)*(frame)->nx]=(long)(val); \
00071                                                 break; \
00072                 case INT   : (frame)->data.l_data[(i)+(j)*(frame)->nx]=(long)(val); \
00073                                                 break; \
00074                 case FLOAT  : (frame)->data.f_data[(i)+(j)*(frame)->nx]=(float)(val); \
00075                                                 break; \
00076                 case DOUBLE : (frame)->data.d_data[(i)+(j)*(frame)->nx]=(double)(val);\
00077                                                 break; \
00078  }
00079 
00080 #define RD_qframe(frame,i,j) (frame)->quality[(i)+(j)*(frame)->nx]
00081 #define WR_qframe(frame,i,j,val) (frame)->quality[(i)+(j)*(frame)->nx] = (long)(val)
00082 
00083 #define in_frame(frame,x,y)     (((x)<(frame)->startx) || ((x)>(frame)->endx) || ((y)<(frame)->starty) || ((y)>(frame)->endy)) ? 0:1
00084 
00085                                 /* CUBES */
00086                                 
00087 #define RD_cube(cube,i,j,k)     \
00088  (((cube)->data_type) == SHORT ? (cube)->data.s_data[(i)\
00089                 +(j)*(cube)->nx+(k)*(cube)->nx*(cube)->ny]: \
00090  (((cube)->data_type) == INT ? (cube)->data.l_data[(i)\
00091                 +(j)*(cube)->nx+(k)*(cube)->nx*(cube)->ny] : \
00092  (((cube)->data_type) == LONG ? (cube)->data.l_data[(i)\
00093                 +(j)*(cube)->nx+(k)*(cube)->nx*(cube)->ny] : \
00094  (((cube)->data_type) == FLOAT ? (cube)->data.f_data[(i)\
00095                 +(j)*(cube)->nx+(k)*(cube)->nx*(cube)->ny]: \
00096  (((cube)->data_type) == DOUBLE ? (cube)->data.d_data[(i)\
00097                 +(j)*(cube)->nx+(k)*(cube)->nx*(cube)->ny]: MAXSHORT)))))
00098 
00099 #define WR_cube(cube,i,j,k,val) \
00100         switch ((cube)->data_type) {\
00101                 case SHORT  : (cube)->data.s_data[(i) \
00102                         +(j)*(cube)->nx +(k)*(cube)->nx*(cube)->ny]=(short)(val); \
00103                                                 break; \
00104                 case LONG   : (cube)->data.l_data[(i) \
00105                         +(j)*(cube)->nx +(k)*(cube)->nx*(cube)->ny]=(long)(val); \
00106                                                 break; \
00107                 case INT   : (cube)->data.l_data[(i) \
00108                         +(j)*(cube)->nx +(k)*(cube)->nx*(cube)->ny]=(long)(val); \
00109                                                 break; \
00110                 case FLOAT  : (cube)->data.f_data[(i) \
00111                         +(j)*(cube)->nx +(k)*(cube)->nx*(cube)->ny]=(float)(val); \
00112                                                 break; \
00113                 case DOUBLE : (cube)->data.d_data[(i) \
00114                         +(j)*(cube)->nx +(k)*(cube)->nx*(cube)->ny]=(double)(val);\
00115                                                 break; \
00116  }
00117 
00118 #define RD_qcube(cube,i,j,k) (cube)->quality[(i)+(j)*(cube)->nx+(k)*(cube)->nx*(cube)->ny]
00119 #define WR_qcube(cube,i,j,k,val) (cube)->quality[(i)+(j)*(cube)->nx+(k)*(cube)->nx*(cube)->ny] = (long)(val)
00120 
00121 #define in_cube(cube,x,y,z)     (((x)<(cube)->startx) || ((x)>(cube)->endx) \
00122  || ((y)<(cube)->starty) || ((y)>(cube)->endy) \
00123  || ((z)<(cube)->startz) || ((z)>(cube)->endz)) ? 0:1
00124 

Generated on Tue Jul 1 17:35:45 2003 for IFU_C_iolibs by doxygen1.3