org.geotools.renderer.lite.gridcoverage2d
Class GradientColorMapGenerator

Object
  extended by GradientColorMapGenerator

public class GradientColorMapGenerator
extends Object

A class mainly used to parse an SVG file and create a ColorMap on top of the LinearGradientEntry contained on it, or create a ColorMap on top of a ";" separated values list of colors such as: rgb(0,0,255);rgb(0,255,0);rgb(255,0,0);... or #0000FF;#00FF00;#FF0000 as an instance. *

Author:
Daniele Romagnoli, GeoSolutions SAS

Field Summary
static String HEX_INLINEVALUE_MARKER
           
static String RGB_INLINEVALUE_MARKER
           
 
Method Summary
 ColorMap generateColorMap(double min, double max)
          Generate a ColorMap object, by updating the ColorMapEntries quantities on top of the min and max values reported here.
static GradientColorMapGenerator getColorMapGenerator(File file)
          Get an SVG ColorMap generator for the specified file
static GradientColorMapGenerator getColorMapGenerator(String colorValues)
          Get an SVG ColorMap generator for the specified file
static Color hex2Rgb(String colorStr)
          Convert an hex color representation to a Color
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RGB_INLINEVALUE_MARKER

public static final String RGB_INLINEVALUE_MARKER
See Also:
Constant Field Values

HEX_INLINEVALUE_MARKER

public static final String HEX_INLINEVALUE_MARKER
See Also:
Constant Field Values
Method Detail

generateColorMap

public ColorMap generateColorMap(double min,
                                 double max)
Generate a ColorMap object, by updating the ColorMapEntries quantities on top of the min and max values reported here.

Parameters:
min -
max -
Returns:

getColorMapGenerator

public static GradientColorMapGenerator getColorMapGenerator(File file)
                                                      throws SAXException,
                                                             IOException,
                                                             ParserConfigurationException
Get an SVG ColorMap generator for the specified file

Parameters:
file -
Returns:
Throws:
SAXException
IOException
ParserConfigurationException

getColorMapGenerator

public static GradientColorMapGenerator getColorMapGenerator(String colorValues)
                                                      throws IOException,
                                                             ParserConfigurationException
Get an SVG ColorMap generator for the specified file

Parameters:
a - ";" separated list of colors in the form rgb(r0,g0,b0);rgb(r1,g1,b1);... or #RRGGBB;#RRGGBB;#RRGGBB;...
Returns:
Throws:
SAXException
IOException
ParserConfigurationException

hex2Rgb

public static Color hex2Rgb(String colorStr)
Convert an hex color representation to a Color

Parameters:
colorStr -
Returns:
the Color instance related to that color HEX string


Copyright © 1996-2014 Geotools. All Rights Reserved.