/* *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* */ /* ** Copyright UCAR (c) 1990 - 2016 */ /* ** University Corporation for Atmospheric Research (UCAR) */ /* ** National Center for Atmospheric Research (NCAR) */ /* ** Boulder, Colorado, USA */ /* ** BSD licence applies - redistribution and use in source and binary */ /* ** forms, with or without modification, are permitted provided that */ /* ** the following conditions are met: */ /* ** 1) If the software is modified to produce derivative works, */ /* ** such modified software should be clearly marked, so as not */ /* ** to confuse it with the version available from UCAR. */ /* ** 2) Redistributions of source code must retain the above copyright */ /* ** notice, this list of conditions and the following disclaimer. */ /* ** 3) Redistributions in binary form must reproduce the above copyright */ /* ** notice, this list of conditions and the following disclaimer in the */ /* ** documentation and/or other materials provided with the distribution. */ /* ** 4) Neither the name of UCAR nor the names of its contributors, */ /* ** if any, may be used to endorse or promote products derived from */ /* ** this software without specific prior written permission. */ /* ** DISCLAIMER: THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS */ /* ** OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */ /* ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* */ /* * NAME * row_hdr * * PURPOSE * Generate row_hdr for interval array * * NOTES * * * HISTORY * wiener - Feb 9, 1993: Created. */ #include #include /* * DESCRIPTION: * make_row_hdr - generate a row header structure for an array of * intervals (similar to gen_row_hdr but does not allocate row header array * * IN: * intervals - array of intervals * num_intervals - size of intervals array * ydim - total number of rows covered by the intervals array (may * cover multiple planes) * * OUT: * row_hdr - contains output row_hdr array * * RETURNS: * size of row_hdr array or -1 on failure * * NOTES: * The intervals are assumed to be sorted according to row, column order. */ int EG_make_row_hdr(Interval *intervals, int num_intervals, int ydim, Row_hdr *row_hdr) { int curr_row; int i; int new_row; /* initialize row header sizes to -1 for all rows */ for (i=0; i 0) { /* attach the pointer */ new_row_hdr[new_row].size = row_hdr[i].size; new_row_hdr[new_row].intervals = &new_intervals[offset]; offset += row_hdr[i].size; /* set the interval array */ for (j=0; jbegin + xoff; /* printf("row %d, begin %d, end %d\n", iptr->row, iptr->begin, iptr->end); printf("loc is %d\n", loc); */ memset (&buffer[loc], (int)value, iptr->end - iptr->begin + 1); } } } #endif