C# Class SoundInTheory.DynamicImage.Filters.ImageReplacementFilter

Provides the abstract base class for a filter which replaces the entire image. Examples of this filter include SoundInTheory.DynamicImage.Filters.ResizeFilter and SoundInTheory.DynamicImage.Filters.RotationFilter.
Inheritance: SoundInTheory.DynamicImage.Filters.Filter
Mostra file Open project: sitdap/dynamic-image

Public Methods

Method Description
ApplyFilter ( FastBitmap bitmap ) : void

Applies the filter to the specified bitmap. This method first calls ImageReplacementFilter.GetDestinationDimensions(FastBitmap, out Int32, out Int32) to calculate the size of the destination image. Then it calls ImageReplacementFilter.ApplyFilter(FastBitmap, DrawingContext, int, int) which is where the overridden class implements its filter algorithm.

Protected Methods

Method Description
ApplyFilter ( FastBitmap source, System.Windows.Media.DrawingContext dc, int width, int height ) : void

When overridden in a derived class, applies the filter to the specified source.

CleanUpDrawingVisual ( FastBitmap source, System.Windows.Media.DrawingVisual drawingVisual ) : void

Inherited classes can use this to clean up the supplied DrawingVisual. For example, ShaderEffectFilter disposes the shader effect.

ConfigureDrawingVisual ( FastBitmap source, System.Windows.Media.DrawingVisual drawingVisual ) : void

Inherited classes can use this to configure the supplied DrawingVisual. For example, RotationFilter sets the BitmapScalingMode render option.

GetDestinationDimensions ( FastBitmap source, int &width, int &height ) : bool

When overridden in a derived class, returns the dimensions of the output image.

OnBeginApplyFilter ( FastBitmap bitmap ) : void

This method allows derived classes to perform actions prior to the filter being applied.

OnEndApplyFilter ( ) : void

This method allows derived classes to perform actions after the filter has been applied.

Method Details

ApplyFilter() public final method

Applies the filter to the specified bitmap. This method first calls ImageReplacementFilter.GetDestinationDimensions(FastBitmap, out Int32, out Int32) to calculate the size of the destination image. Then it calls ImageReplacementFilter.ApplyFilter(FastBitmap, DrawingContext, int, int) which is where the overridden class implements its filter algorithm.
public final ApplyFilter ( FastBitmap bitmap ) : void
bitmap SoundInTheory.DynamicImage.Util.FastBitmap /// Image to apply the to. ///
return void

ApplyFilter() protected abstract method

When overridden in a derived class, applies the filter to the specified source.
protected abstract ApplyFilter ( FastBitmap source, System.Windows.Media.DrawingContext dc, int width, int height ) : void
source SoundInTheory.DynamicImage.Util.FastBitmap The source image.
dc System.Windows.Media.DrawingContext A object, created from .
width int
height int
return void

CleanUpDrawingVisual() protected method

Inherited classes can use this to clean up the supplied DrawingVisual. For example, ShaderEffectFilter disposes the shader effect.
protected CleanUpDrawingVisual ( FastBitmap source, System.Windows.Media.DrawingVisual drawingVisual ) : void
source SoundInTheory.DynamicImage.Util.FastBitmap
drawingVisual System.Windows.Media.DrawingVisual
return void

ConfigureDrawingVisual() protected method

Inherited classes can use this to configure the supplied DrawingVisual. For example, RotationFilter sets the BitmapScalingMode render option.
protected ConfigureDrawingVisual ( FastBitmap source, System.Windows.Media.DrawingVisual drawingVisual ) : void
source SoundInTheory.DynamicImage.Util.FastBitmap
drawingVisual System.Windows.Media.DrawingVisual
return void

GetDestinationDimensions() protected abstract method

When overridden in a derived class, returns the dimensions of the output image.
protected abstract GetDestinationDimensions ( FastBitmap source, int &width, int &height ) : bool
source SoundInTheory.DynamicImage.Util.FastBitmap The source image.
width int The desired width of the output image.
height int The desired height of the output image.
return bool

OnBeginApplyFilter() protected method

This method allows derived classes to perform actions prior to the filter being applied.
protected OnBeginApplyFilter ( FastBitmap bitmap ) : void
bitmap SoundInTheory.DynamicImage.Util.FastBitmap
return void

OnEndApplyFilter() protected method

This method allows derived classes to perform actions after the filter has been applied.
protected OnEndApplyFilter ( ) : void
return void