Package org.esa.snap.core.datamodel
Class RGBImageProfile
java.lang.Object
org.esa.snap.core.datamodel.RGBImageProfile
- All Implemented Interfaces:
ConfigurableExtension
A profile used for the creation of RGB images. The profile comprises the band arithmetic expressions
for the computation of red, green, blue and alpha (optional) channels of the resulting image.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default name for the band providing input for the alpha image channel.static final StringThe default name for the band providing input for the blue image channel.static final Stringstatic final StringThe default name for the band providing input for the green image channel.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringPreferences key for RGB profile entriesstatic final Stringstatic final StringThe default name for the band providing input for the red image channel.static final String[]An array of 3 strings containing the names for the default red, green and blue bands.static final String[]An array of 4 strings containing the names for the default red, green, blue and alpha bands. -
Constructor Summary
ConstructorsConstructorDescriptionRGBImageProfile(String name, String[] rgbaExpressions) RGBImageProfile(String name, String[] rgbaExpressions, String[] pattern) RGBImageProfile(String name, String[] rgbaExpressions, String[] pattern, Range[] valueRanges) Creates a new RGB profile. -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(ConfigurationElement config) Deprecated.Not in use anymore.booleanequalExpressions(String[] rgbaExpressions) Deprecated.booleanequalExpressions(RGBImageProfile profile) booleanstatic RGBImageProfilegetCurrentProfile(Product product) getName()String[]voidgetProperties(Properties properties) Sets profile properties and accordingly sets them in the given property map.String[]String[]booleanhasAlpha()inthashCode()booleanisApplicableTo(Product product) Tests whether this profile is applicable to the given product.booleanbooleanisValid()Tests if one of the R,G,B expressions are non-empty strings.static RGBImageProfileloadProfile(File file) Loads a profile from the given file using the Java properties file formatstatic RGBImageProfileloadProfile(URL url) Loads a profile from the given url using the Java properties file formatvoidsetAlphaExpression(String expression) voidsetBandArithmeticParser(Parser bandArithmeticParser) voidsetBlueExpression(String expression) voidsetBlueMinMax(Range range) voidsetGreenExpression(String expression) voidsetGreenMinMax(Range range) voidsetInternal(boolean internal) voidvoidsetPattern(String[] pattern) voidsetProperties(Properties properties) Sets profile properties from the given property map.voidsetRedExpression(String expression) voidsetRedMinMax(Range range) voidsetRgbaExpressions(String[] rgbaExpressions) voidsetRgbExpressions(String[] rgbExpressions) voidStores this profile in the given file using the Java properties file formatstatic voidstoreRgbaExpressions(Product product, String[] rgbaExpressions) static voidstoreRgbaExpressions(Product product, String[] rgbaExpressions, String[] bandNames) toString()
-
Field Details
-
RED_BAND_NAME
The default name for the band providing input for the red image channel.- See Also:
-
GREEN_BAND_NAME
The default name for the band providing input for the green image channel.- See Also:
-
BLUE_BAND_NAME
The default name for the band providing input for the blue image channel.- See Also:
-
ALPHA_BAND_NAME
The default name for the band providing input for the alpha image channel.- See Also:
-
RGB_BAND_NAMES
An array of 3 strings containing the names for the default red, green and blue bands. -
RGBA_BAND_NAMES
An array of 4 strings containing the names for the default red, green, blue and alpha bands. -
FILENAME_EXTENSION
- See Also:
-
PROPERTY_KEY_NAME
- See Also:
-
PROPERTY_KEY_RED
- See Also:
-
PROPERTY_KEY_GREEN
- See Also:
-
PROPERTY_KEY_BLUE
- See Also:
-
PROPERTY_KEY_ALPHA
- See Also:
-
PROPERTY_KEY_INTERNAL
- See Also:
-
PROPERTY_KEY_PREFIX_RGB_PROFILE
Preferences key for RGB profile entries- See Also:
-
-
Constructor Details
-
RGBImageProfile
-
RGBImageProfile
-
RGBImageProfile
public RGBImageProfile(String name, String[] rgbaExpressions, String[] pattern, Range[] valueRanges) Creates a new RGB profile. In the pattern you can simply use '*' for a sequence of characters or use '?' for a single character. For Example:new String[]{ "MER_*_2*", "MER_*_2*", ""}- Parameters:
name- The name of the profilergbaExpressions- the expressions for the RGBA channels. Only RGB expressions are mandatory, the one for the alpha channel can be missingpattern- Pattern to check if this profile can be applied to a certain product. Three patterns need to be provided. 1. Will be matched against the product type 2. Will be matched against the product name 3. Will be matched against the description of the product
-
-
Method Details
-
getName
-
setName
-
getRgbChannelDef
-
isInternal
public boolean isInternal() -
setInternal
public void setInternal(boolean internal) -
setBandArithmeticParser
-
getBandArithmeticParser
-
equalExpressions
-
equalExpressions
Deprecated.This API function exposes internal structure. please use equalExpressions(RGBImageProfile profile) -
isValid
public boolean isValid()Tests if one of the R,G,B expressions are non-empty strings.- Returns:
- true, if so
-
getRgbExpressions
-
setRgbExpressions
-
getRgbaExpressions
-
setRgbaExpressions
-
getRedExpression
-
setRedExpression
-
getGreenExpression
-
setGreenExpression
-
getBlueExpression
-
setBlueExpression
-
getAlphaExpression
-
setAlphaExpression
-
hasAlpha
public boolean hasAlpha() -
getPattern
-
setPattern
-
isApplicableTo
Tests whether this profile is applicable to the given product. With other words, the method tests if an RGB image can be created from the given product.- Parameters:
product- the product- Returns:
- true, if so
-
getCurrentProfile
-
loadProfile
Loads a profile from the given file using the Java properties file format- Parameters:
file- the file- Returns:
- the profile, never null
- Throws:
IOException- if an I/O error occurs- See Also:
-
loadProfile
Loads a profile from the given url using the Java properties file format- Parameters:
url- the url- Returns:
- the profile, never null
- Throws:
IOException- if an I/O error occurs- See Also:
-
store
Stores this profile in the given file using the Java properties file format- Parameters:
file- the file- Throws:
IOException- if an I/O error occurs- See Also:
-
getProperties
Sets profile properties and accordingly sets them in the given property map.- Parameters:
properties- the property map which receives the properties of this profiles
-
setProperties
Sets profile properties from the given property map.- Parameters:
properties- the property map which provides the properties for this profiles
-
storeRgbaExpressions
-
storeRgbaExpressions
-
hashCode
public int hashCode() -
equals
-
toString
-
configure
Deprecated.Not in use anymore. Was used in BEAM. Might be removed in the future. Deprecated since SNAP 9.Description copied from interface:ConfigurableExtensionConfigures this extension with the supplied configuration data.- Specified by:
configurein interfaceConfigurableExtension- Parameters:
config- The configuration data.- Throws:
CoreException- if an error occurred during configuration.
-
setRedMinMax
-
getRedMinMax
-
setGreenMinMax
-
getGreenMinMax
-
setBlueMinMax
-
getBlueMinMax
-