7 QList< QColor >& gcolors )
18 int nvals = cparams.size();
28 for (
int jj = 0; jj < nvals; jj+= 4 )
30 ered = cparams.at( jj );
31 egrn = cparams.at( jj+1 );
32 eblu = cparams.at( jj+2 );
33 npts = cparams.at( jj+3 );
37 qreal dpts = (qreal)npts;
39 qreal dred = (qreal)( ered - sred ) / dpts;
40 qreal dgrn = (qreal)( egrn - sgrn ) / dpts;
41 qreal dblu = (qreal)( eblu - sblu ) / dpts;
43 qreal ored = (qreal)sred;
44 qreal ogrn = (qreal)sgrn;
45 qreal oblu = (qreal)sblu;
47 for (
int ii = 0; ii < npts; ii++ )
52 int ired = qRound( ored );
53 int igrn = qRound( ogrn );
54 int iblu = qRound( oblu );
56 gcolors.append( QColor( ired, igrn, iblu ) );
61 gcolors.append( QColor( ered, egrn, eblu ) );
74 QList< QColor >& scolors, QList< double >& svalues )
87 int nvals = cparams.size();
90 for (
int jj = 0; jj < nvals; jj += 4 )
92 int red = cparams.at( jj );
93 int grn = cparams.at( jj+1 );
94 int blu = cparams.at( jj+2 );
95 int npt = cparams.at( jj+3 );
98 scolors.append( QColor( red, grn, blu ) );
108 double rcolor = (double)( ncolor );
111 for (
int jj = 3; jj < nvals; jj += 4 )
113 kcolor += cparams.at( jj );
114 rvalue = (double)kcolor / rcolor;
115 svalues.append( rvalue );
122 QList< int >& cparams )
127 QFile filei( xmlfilename );
129 if ( filei.open( QIODevice::ReadOnly ) )
131 QXmlStreamReader xmli( &filei );
132 bool is_uscs =
false;
134 while( ! xmli.atEnd() )
138 if ( xmli.isComment() )
140 QString comm = xmli.text().toString();
142 if ( comm.contains(
"UltraScanColorSteps" ) )
148 if ( xmli.isStartElement() && xmli.name() ==
"color" )
151 QXmlStreamAttributes ats = xmli.attributes();
152 int red = ats.value(
"red" ).toString().toInt();
153 int grn = ats.value(
"green" ).toString().toInt();
154 int blu = ats.value(
"blue" ).toString().toInt();
155 int npts = ats.value(
"points" ).toString().toInt();
157 cparams.append( red );
158 cparams.append( grn );
159 cparams.append( blu );
160 cparams.append( npts );