Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

render_include.c

Go to the documentation of this file.
00001 #undef TWO 00002 #ifdef TWO_VOLUMES 00003 #define TWO( x ) x 00004 #else 00005 #define TWO( x ) 00006 #endif 00007 00008 /* TWO if needed 00009 TYPE1, TYPE2 */ 00010 { 00011 #ifndef ONE_SLICE 00012 TYPE1 **start_data1; 00013 #ifdef TWO_VOLUMES 00014 TYPE2 **start_data2; 00015 #endif 00016 #endif 00017 #ifdef ONE_SLICE 00018 TYPE1 *ptr1; 00019 TWO( TYPE2 *ptr2; ) 00020 #endif 00021 00022 #ifndef ONE_SLICE 00023 start_data1 = (TYPE1 **) start_slices1; 00024 TWO( start_data2 = (TYPE2 **) start_slices2; ) 00025 #endif 00026 00027 #ifdef ONE_SLICE 00028 ptr1 = &((TYPE1 *) volume_data1) [y_offsets1[0][y]]; 00029 offset_ptr1 = &row_offsets1[0][start_x[y]]; 00030 TWO( ptr2 = &((TYPE2 *) volume_data2) [y_offsets2[0][y]]; ) 00031 TWO( offset_ptr2 = &row_offsets2[0][start_x[y]]; ) 00032 #else 00033 for_less( s, 0, n_slices1 ) 00034 start_data1[s] = &((TYPE1 *) volume_data1) [y_offsets1[s][y]]; 00035 #ifdef TWO_VOLUMES 00036 for_less( s, 0, n_slices2 ) 00037 start_data2[s] = &((TYPE2 *) volume_data2) [y_offsets2[s][y]]; 00038 #endif 00039 #endif 00040 00041 for_inclusive( x, start_x[y], end_x[y] ) 00042 { 00043 #ifdef ONE_SLICE 00044 voxel_data1 = ptr1[*offset_ptr1]; 00045 ++offset_ptr1; 00046 TWO( voxel_data2 = ptr2[*offset_ptr2]; ) 00047 TWO( ++offset_ptr2; ) 00048 #else 00049 real_voxel_data1 = 0.5; 00050 for_less( s, 0, n_slices1 ) 00051 { 00052 real_voxel_data1 += weights1[s] * 00053 start_data1[s][row_offsets1[s][x]]; 00054 } 00055 00056 voxel_data1 = (int) real_voxel_data1; 00057 #ifdef TWO_VOLUMES 00058 real_voxel_data2 = 0.5; 00059 for_less( s, 0, n_slices2 ) 00060 { 00061 real_voxel_data2 += weights2[s] * 00062 start_data2[s][row_offsets2[s][x]]; 00063 } 00064 00065 voxel_data2 = (int) real_voxel_data2; 00066 #endif 00067 00068 #endif 00069 00070 #ifdef TWO_VOLUMES 00071 #ifdef COLOUR_MAP 00072 colour = cmode_colour_map[voxel_data1][voxel_data2]; 00073 #else 00074 colour = rgb_colour_map[voxel_data1][voxel_data2]; 00075 #endif 00076 #else 00077 #ifdef COLOUR_MAP 00078 colour = single_cmode_map[voxel_data1]; 00079 #else 00080 colour = single_rgb_map[voxel_data1]; 00081 #endif 00082 #endif 00083 *pixel_ptr = colour; 00084 ++pixel_ptr; 00085 } 00086 }

Generated on Wed Jul 28 09:10:58 2004 for BICPL by doxygen 1.3.7