RasterVisualizer Class
A visualizer that draws rasters.
NuGet/Assembly: Carmenta.Engine.5.16.2.nupkg (in the CECore assembly)
Syntax
public class RasterVisualizer : Visualizer
Remarks
A RasterVisualizer is a visualizer that draws rasters. It can only be applied to raster features, all other feature types are ignored. Each cell in the raster gets its color from the color table in the Color property, or from color information supplied in the raster itself. Each color can have an individual alpha (transparency) value, but it is also possible to set an alpha value for the entire raster which affects all colors the same.
![]() |
Example
// Create a gray scale visualization for 8Bit raster
public static void CreateGrayScaleFor8BitRaster(RasterVisualizer rasterVisualizer)
{
// Set alpha (transparency) to 80
rasterVisualizer.Alpha = 80;
// Create a keyed color attribute variable.
// The Key will be empty for raster visualization.
KeyedAttributeVariable<Color> keyedColorAttributeVariable =
new KeyedAttributeVariable<Color>(Atom.Empty);
// Get the table from the keyed color attribute variable
KeyValueTable<Color> colorTable = keyedColorAttributeVariable.Table;
// Create a Color table for the gray scale visualization.
// Minimum value = 0, will be black and maximum value = 255 will be white.
colorTable.Add(0, Color.Black);
colorTable.Add(255, Color.White);
// This property is a member of a type that might be referred to by a View
// or a GlobeView, either directly or indirectly through other objects, which means
// that you must use the Guard class to take the global configuration lock when it
// is modified to synchronize access with any running Carmenta Engine threads.
using (Guard guard = new Guard())
{
// Set the color table in the line visualizer
rasterVisualizer.Color = keyedColorAttributeVariable;
// Set ColorTableLookUp to FullRange.
// When FullRange is specified, the color table will be dynamically adjusted so that
// the full range of the table will be utilized.
rasterVisualizer.ColorTableLookup = ColorTableLookup.FullRange;
// Set Filter to Bicubic.
// Indicates that bi - cubic filtering should be used.
// This is usually the slowest option, but gives the best result.
rasterVisualizer.Filter = RasterFilter.Bicubic;
}
}
Inheritance Hierarchy
System.Object (not available in C#)
EngineObject
ResourceObject
Visualizer
RasterVisualizer
Platforms
Windows, Linux, Android
RasterVisualizer Members
The RasterVisualizer type has the following members.
Constructors
Name | Description |
---|---|
RasterVisualizer | Initializes a new instance of the RasterVisualizer class. |
Properties
Name | Description |
---|---|
Alpha | Gets or sets an alpha (transparency) value that is applied to all cells of the raster. |
Color | Gets or sets the color table used to draw the raster. |
ColorTableLookup | Gets or sets a value specifying how the lookup of colors in the color table is done. |
Condition | Gets or sets a condition that must evaluate to true if the visualizer shall be applied to a feature. Inherited from Visualizer |
Filter | Gets or sets which type of filtering should be used to draw the raster. |
IsDisposed | Gets a value that tells whether the current RasterVisualizer has been disposed. Inherited from EngineObject |
Name | Gets or sets the name of the RasterVisualizer. Inherited from ResourceObject |
NativeHandle | Gets the native Carmenta Engine kernel object the current RasterVisualizer represents. Inherited from EngineObject |
PickingSupport | Gets or sets a value specifying how much information is maintained when the visualizer creates a PresentationObject for a feature. Inherited from Visualizer |
IUserProperties.UserProperties | Gets the AttributeSet that contains the user properties. Inherited from IUserProperties |
Methods
Name | Description |
---|---|
Clone | Creates a copy of an object. Inherited from EngineObject |
Dispose | Releases the reference to the native Carmenta Engine kernel instance the EngineObject represents. Inherited from EngineObject |
Draw | Draws a feature on a drawable. Inherited from Visualizer |
Equals | Determines whether this instance is equal to another. Inherited from EngineObject |
FindChildObject | Overloaded. Finds the child object with the specified name. Inherited from Visualizer |
GetChildObjects | Overloaded. Gets the child objects of the current object. Inherited from Visualizer |