UltraScan III
List of all members | Static Public Member Functions | Static Public Attributes
US_ColorGradIO Class Reference

Get colors list from color steps XML file. All functions are static. More...

#include "us_colorgradIO.h"

Static Public Member Functions

static int read_color_gradient (QString, QList< QColor > &)
 Public static function to create a gradient colors list from a color steps XML file. More...
 
static int read_color_steps (QString, QList< QColor > &, QList< double > &)
 Public static function to create color steps and step value lists from a color steps XML file. More...
 
static int read_color_step_params (QString, QList< int > &)
 Public static function to create a list of the integer parameter values from a color steps XML file. More...
 

Static Public Attributes

static const int XFS_OK = 0
 xml file opened & successfully read More...
 
static const int XFS_EROPN = 1
 unable to open xml file More...
 
static const int XFS_ERXML = 2
 file is not xml More...
 
static const int XFS_ERCST = 3
 file is not color step More...
 

Detailed Description

Get colors list from color steps XML file. All functions are static.

Definition at line 11 of file us_colorgradIO.h.

Member Function Documentation

int US_ColorGradIO::read_color_gradient ( QString  xmlfilename,
QList< QColor > &  gcolors 
)
static

Public static function to create a gradient colors list from a color steps XML file.

Parameters
xmlfilenameThe full path name to an XML color gradient file.
gcolorsReturned list of gradient colors
Returns
Return code: 0 (XFS_OK) -> ok; 1 (XFS_EROPN) -> can't open; 2 (XFS_ERXML) -> not xml; 3 (XFS_ERCST) -> not color steps.

This function returns the full list of colors implied by the input color steps xml file.

Definition at line 6 of file us_colorgradIO.cpp.

int US_ColorGradIO::read_color_step_params ( QString  xmlfilename,
QList< int > &  cparams 
)
static

Public static function to create a list of the integer parameter values from a color steps XML file.

Parameters
xmlfilenameThe full path name to an XML color gradient file.
cparamsReturned list of color step parameters, where each set of 4 is a (red,green,blue,npoints) quadruple.
Returns
Return code: 0 (XFS_OK) -> ok; 1 (XFS_EROPN) -> can't open; 2 (XFS_ERXML) -> not xml; 3 (XFS_ERCST) -> not color steps.

This function returns the color gradient attribute values from an input color steps xml file. The integer values are ordered into (red, green, blue, number_points ) sets, so the number of steps is one fourth the returned list's size less one.

Definition at line 121 of file us_colorgradIO.cpp.

int US_ColorGradIO::read_color_steps ( QString  xmlfilename,
QList< QColor > &  scolors,
QList< double > &  svalues 
)
static

Public static function to create color steps and step value lists from a color steps XML file.

Parameters
xmlfilenameThe full path name to an XML color gradient file.
scolorsReturned list of step colors.
svaluesReturned corresponding list of step values.
Returns
Return code: 0 (XFS_OK) -> ok; 1 (XFS_EROPN) -> can't open; 2 (XFS_ERXML) -> not xml; 3 (XFS_ERCST) -> not color steps.

This function returns the list of step colors and the corresponding list of step values in the range 0.0 to 1.0. The first of the values list will always be 0.0 and the last always 1.0, with values in between ordered and inside those ranges. This pair of lists can easily be used in QwtLinearColorMap's constructor and it's addColorStep method.

Definition at line 73 of file us_colorgradIO.cpp.

Member Data Documentation

const int US_ColorGradIO::XFS_ERCST = 3
static

file is not color step

Definition at line 18 of file us_colorgradIO.h.

const int US_ColorGradIO::XFS_EROPN = 1
static

unable to open xml file

Definition at line 16 of file us_colorgradIO.h.

const int US_ColorGradIO::XFS_ERXML = 2
static

file is not xml

Definition at line 17 of file us_colorgradIO.h.

const int US_ColorGradIO::XFS_OK = 0
static

xml file opened & successfully read

Definition at line 15 of file us_colorgradIO.h.


The documentation for this class was generated from the following files: