Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-21 10:05:30

0001 /*
0002  *  qp_cmd_hfill2_tmpl.h  --
0003  *
0004  *  Original: 16-May-1995 16:50
0005  *
0006  *  Author:   Maarten Ballintijn <Maarten.Ballintijn@cern.ch>
0007  *
0008  */
0009 
0010 {
0011     register void       *o1;
0012     register void       *o2;
0013     register Float32    *o3;
0014     register int        n = 1, inc_o1, inc_o2, inc_o3;
0015     static float        w_1 = 1.0;
0016     float           x, y, w;
0017 
0018     o1 = &stack[frame[framep]];
0019     if ( frame_size[framep] != 1 ) {
0020         n = frame_size[framep];
0021         inc_o1 = 4 * datatype_size[ frame_type[framep] ];
0022     } else {
0023         inc_o1 = 0;
0024     }
0025 
0026     o2 = &stack[frame[framep-1]];
0027     if ( frame_size[framep-1] != 1 ) {
0028         n = frame_size[framep-1];
0029         inc_o2 = 4 * datatype_size[ frame_type[framep-1] ];
0030     } else {
0031         inc_o2 = 0;
0032     }
0033 
0034     o3 = (Float32 *) &stack[frame[framep-2]];
0035     if ( frame_size[framep-2] == 0 ) {  /* no selection */
0036         o3 = &w_1;
0037         inc_o3 = 0;
0038     } else if ( frame_size[framep-2] != 1 ) {
0039         inc_o3 = 0;
0040     } else {
0041         n = frame_size[framep-2];
0042         inc_o3 = 1;
0043     }
0044 
0045     for ( ; n > 0 ; n-- ) {
0046         if ( *o3 != 0. ) {
0047             switch( frame_type[framep] ) {
0048             case D_BOOL:    x = *(bool *) o1; break;
0049             case D_UINT:    x = *(UInt32 *) o1; break;
0050             case D_ULONG:   x = *(UInt64 *) o1; break;
0051             case D_INT: x = *(Int32 *) o1; break;
0052             case D_LONG:    x = *(Int64 *) o1; break;
0053             case D_FLOAT:   x = *(Float32 *) o1; break;
0054             case D_DOUBLE:  x = *(Float64 *) o1; break;
0055             default:
0056                 sf_report( "qp_cmd_hfill2_tmpl.h: DataType"
0057                     " (%d) not implemented\n",
0058                     frame_type[framep] );
0059                 *errp = R_INTERNAL_ERROR;
0060                 break;
0061             }
0062             o1 = (char *) o1 + inc_o1;
0063 
0064             switch( frame_type[framep-1] ) {
0065             case D_BOOL:    y = *(bool *) o2; break;
0066             case D_UINT:    y = *(UInt32 *) o2; break;
0067             case D_ULONG:   y = *(UInt64 *) o2; break;
0068             case D_INT: y = *(Int32 *) o2; break;
0069             case D_LONG:    y = *(Int64 *) o2; break;
0070             case D_FLOAT:   y = *(Float32 *) o2; break;
0071             case D_DOUBLE:  y = *(Float64 *) o2; break;
0072             default:
0073                 sf_report( "qp_cmd_hfill2_tmpl.h: DataType"
0074                     " (%d) not implemented\n",
0075                     frame_type[framep] );
0076                 *errp = R_INTERNAL_ERROR;
0077                 break;
0078             }
0079             o2 = (char *) o2 + inc_o2;
0080 
0081             w = *o3;
0082             o3 += inc_o3;
0083 
0084             HFILL( qp_hfill_id, x, y, w );
0085         }
0086     }
0087 }