LuciadCPillar 2023.1.04
luciad::RasterStyle::Builder Class Referencefinal

Builder for raster styles. More...

#include <luciad/layers/styles/RasterStyle.h>

Public Member Functions

 Builder (const Builder &other)
 
 ~Builder ()
 
Builderbrightness (double brightness)
 Sets the brightness. More...
 
RasterStyle build () const
 Returns a newly created raster style, based on the properties set on this builder. More...
 
Buildercontrast (double contrast)
 Sets the contrast. More...
 
BuildermodulationColor (Color color)
 Sets the color that is modulated with the raster. More...
 
Builderopacity (double opacity)
 Sets the opacity of the raster. More...
 

Detailed Description

Builder for raster styles.

The default raster style has a white modulation color, with brightness, contrast and transparency values all equal to 1.

Example usage:

Builder & opacity(double opacity)
Sets the opacity of the raster.
RasterStyle build() const
Returns a newly created raster style, based on the properties set on this builder.
Builder & contrast(double contrast)
Sets the contrast.
Style for rasters.
Definition: RasterStyle.h:17
static Builder newBuilder()
Creates a new builder with the default values.
Since
2023.1

Constructor & Destructor Documentation

◆ Builder()

luciad::RasterStyle::Builder::Builder ( const Builder other)

◆ ~Builder()

luciad::RasterStyle::Builder::~Builder ( )

Member Function Documentation

◆ brightness()

Builder & luciad::RasterStyle::Builder::brightness ( double  brightness)

Sets the brightness.

The brightness is a value in [0, 2]. A value of 1 (the default) leaves the brightness unchanged. Values larger than 1 makes the colors brighter, while a value smaller than 1 makes the colors less bright.

This parameter is optional. If not set, default is 1.

Parameters
brightnessthe brightness
Returns
this builder.
Exceptions
luciad::InvalidArgumentExceptionwhen brightness < 0 or brightness > 2.

◆ build()

RasterStyle luciad::RasterStyle::Builder::build ( ) const

Returns a newly created raster style, based on the properties set on this builder.

Returns
a newly created raster style, based on the properties set on this builder.

◆ contrast()

Builder & luciad::RasterStyle::Builder::contrast ( double  contrast)

Sets the contrast.

The contrast is a value in [0, 2]. A value of 1 (the default) leaves the contrast unchanged. A value larger than 1 enhances the contrast of dark colors by making them brighter, while a value smaller than 1 enhances the contrast of bright colors by making them darker.

This parameter is optional. If not set, default is 1.

Parameters
contrastthe contrast
Returns
this builder.
Exceptions
luciad::InvalidArgumentExceptionwhen contrast < 0 or contrast > 2.

◆ modulationColor()

Builder & luciad::RasterStyle::Builder::modulationColor ( Color  color)

Sets the color that is modulated with the raster.

For example using a raster with gray-scale colors and a red modulation color will result in a resulting painted raster with red hues.

Using a white color has no effect.

This parameter is optional. If not set, default is white.

Parameters
colorthe modulation color
Returns
this builder.

◆ opacity()

Builder & luciad::RasterStyle::Builder::opacity ( double  opacity)

Sets the opacity of the raster.

This can also be achieved by setting a modulation color with opacity directly. When both opacity and a modulation color are set, the opacity set using this method takes precedence over that of the modulation color.

This parameter is optional. If not set, default is 1.

Parameters
opacitythe alpha value. Must be contained in the [0, 1] interval (0 is fully transparent, 1 is fully opaque).
Returns
this builder.
Exceptions
luciad::InvalidArgumentExceptionwhen opacity < 0 or opacity > 1.