Description
Applies a sequence of filters to the source
raster in the order in which they were added. When
Continue On Failure is set to true, subsequent filters will
still be applied to the source raster even if one or more filters
in the sequence cannot be applied.
Public Methods
Add |
Adds a filter to the
sequence. |
Clear |
Clears all filters from the
sequence. |
Contains |
Returns true if the
sequence contains the filter. |
Remove |
Removes a filter from the
sequence. |
Public Properties
ContinueOnFailure |
Gets or sets whether to
continue applying filters in the sequence regardless of individual
filter failures. When set to true, subsequent filters will still be
applied to the source raster even if one or more filters in the
sequence cannot be applied. |
Count |
Gets the number of filters
in the collection. |
Example
Adjust brightness,
contrast, and gamma
[C#] |
Copy Code
|
IAgStkGraphicsSceneManager manager = ((IAgScenario)root.CurrentScenario).SceneManager;
IAgStkGraphicsScreenOverlayCollectionBase overlayManager = (IAgStkGraphicsScreenOverlayCollectionBase)manager.ScreenOverlays.Overlays;
IAgStkGraphicsRaster image = manager.Initializers.Raster.InitializeWithStringUri(
imageFile);
IAgStkGraphicsSequenceFilter sequenceFilter = manager.Initializers.SequenceFilter.Initialize();
sequenceFilter.Add((IAgStkGraphicsRasterFilter)manager.Initializers.BrightnessFilter.InitializeWithAdjustment(.1));
sequenceFilter.Add((IAgStkGraphicsRasterFilter)manager.Initializers.ContrastFilter.InitializeWithAdjustment(.2));
sequenceFilter.Add((IAgStkGraphicsRasterFilter)manager.Initializers.GammaCorrectionFilter.InitializeWithGamma(.9));
image.ApplyInPlace((IAgStkGraphicsRasterFilter)sequenceFilter);
IAgStkGraphicsRendererTexture2D texture = manager.Textures.FromRaster(image);
IAgStkGraphicsTextureScreenOverlay overlay = manager.Initializers.TextureScreenOverlay.Initialize();
((IAgStkGraphicsOverlay)overlay).Width = 0.2;
((IAgStkGraphicsOverlay)overlay).WidthUnit = AgEStkGraphicsScreenOverlayUnit.eStkGraphicsScreenOverlayUnitFraction;
((IAgStkGraphicsOverlay)overlay).Height = 0.2;
((IAgStkGraphicsOverlay)overlay).HeightUnit = AgEStkGraphicsScreenOverlayUnit.eStkGraphicsScreenOverlayUnitFraction;
((IAgStkGraphicsOverlay)overlay).Origin = AgEStkGraphicsScreenOverlayOrigin.eStkGraphicsScreenOverlayOriginCenterRight;
overlay.Texture = texture;
overlayManager.Add((IAgStkGraphicsScreenOverlay)overlay);
|
|
Adjust brightness,
contrast, and gamma
[Visual Basic .NET] |
Copy Code
|
Dim manager As
IAgStkGraphicsSceneManager = DirectCast(root.CurrentScenario,
IAgScenario).SceneManager
Dim overlayManager As IAgStkGraphicsScreenOverlayCollectionBase =
DirectCast(manager.ScreenOverlays.Overlays,
IAgStkGraphicsScreenOverlayCollectionBase)
Dim image As IAgStkGraphicsRaster =
manager.Initializers.Raster.InitializeWithStringUri( _
imageFile)
Dim sequenceFilter As IAgStkGraphicsSequenceFilter =
manager.Initializers.SequenceFilter.Initialize()
sequenceFilter.Add(DirectCast(manager.Initializers.BrightnessFilter.InitializeWithAdjustment(0.1),
IAgStkGraphicsRasterFilter))
sequenceFilter.Add(DirectCast(manager.Initializers.ContrastFilter.InitializeWithAdjustment(0.2),
IAgStkGraphicsRasterFilter))
sequenceFilter.Add(DirectCast(manager.Initializers.GammaCorrectionFilter.InitializeWithGamma(0.9),
IAgStkGraphicsRasterFilter))
image.ApplyInPlace(DirectCast(sequenceFilter,
IAgStkGraphicsRasterFilter))
Dim texture As IAgStkGraphicsRendererTexture2D =
manager.Textures.FromRaster(image)
Dim overlay As IAgStkGraphicsTextureScreenOverlay =
manager.Initializers.TextureScreenOverlay.Initialize()
DirectCast(overlay, IAgStkGraphicsOverlay).Width = 0.2
DirectCast(overlay, IAgStkGraphicsOverlay).WidthUnit =
AgEStkGraphicsScreenOverlayUnit.eStkGraphicsScreenOverlayUnitFraction
DirectCast(overlay, IAgStkGraphicsOverlay).Height = 0.2
DirectCast(overlay, IAgStkGraphicsOverlay).HeightUnit =
AgEStkGraphicsScreenOverlayUnit.eStkGraphicsScreenOverlayUnitFraction
overlay.Texture = texture
DirectCast(overlay, IAgStkGraphicsOverlay).Origin =
AgEStkGraphicsScreenOverlayOrigin.eStkGraphicsScreenOverlayOriginCenterRight
overlayManager.Add(DirectCast(overlay,
IAgStkGraphicsScreenOverlay))
|
|
CoClasses that Implement
IAgStkGraphicsSequenceFilter