C# Class Accord.Imaging.Filters.TexturedFilter

Textured filter - filter an image using texture.

The filter is similar to TexturedMerge filter in its nature, but instead of working with source image and overly, it uses provided filters to create images to merge (see Filter1 and Filter2 properties). In addition, it uses a bit more complex formula for calculation of destination pixel's value, which gives greater amount of flexibility:
dst = FilterLevel * ( src1 * textureValue + src2 * ( 1.0 - textureValue ) ) + PreserveLevel * src2, where src1 is value of pixel from the image produced by Filter1, src2 is value of pixel from the image produced by Filter2, dst is value of pixel in a destination image and textureValue is corresponding value from provided texture (see TextureGenerator or Texture).

It is possible to set Filter2 to . In this case original source image will be used instead of result produced by the second filter.

The filter 24 bpp color images for processing.

Sample usage #1:

// create filter TexturedFilter filter = new TexturedFilter( new CloudsTexture( ), new HueModifier( 50 ) ); // apply the filter Bitmap newImage = filter.Apply( image );

Sample usage #2:

// create filter TexturedFilter filter = new TexturedFilter( new CloudsTexture( ), new GrayscaleBT709( ), new Sepia( ) ); // apply the filter Bitmap newImage = filter.Apply( image );

Initial image:

Result image #1:

Result image #2:

Inheritance: BaseFilter
Afficher le fichier Open project: accord-net/framework

Méthodes publiques

Méthode Description
TexturedFilter ( ITextureGenerator generator, IFilter filter1 ) : System

Initializes a new instance of the TexturedFilter class.

TexturedFilter ( ITextureGenerator generator, IFilter filter1, IFilter filter2 ) : System

Initializes a new instance of the TexturedFilter class.

TexturedFilter ( float texture, IFilter filter1 ) : System

Initializes a new instance of the TexturedFilter class.

TexturedFilter ( float texture, IFilter filter1, IFilter filter2 ) : System

Initializes a new instance of the TexturedFilter class.

Méthodes protégées

Méthode Description
ProcessFilter ( UnmanagedImage sourceData, UnmanagedImage destinationData ) : void

Process the filter on the specified image.

Private Methods

Méthode Description
TexturedFilter ( ) : System

Method Details

ProcessFilter() protected méthode

Process the filter on the specified image.
Texture size does not match image size. Filters should not change image dimension.
protected ProcessFilter ( UnmanagedImage sourceData, UnmanagedImage destinationData ) : void
sourceData UnmanagedImage Source image data.
destinationData UnmanagedImage Destination image data.
Résultat void

TexturedFilter() public méthode

Initializes a new instance of the TexturedFilter class.
public TexturedFilter ( ITextureGenerator generator, IFilter filter1 ) : System
generator ITextureGenerator Texture generator.
filter1 IFilter First filter.
Résultat System

TexturedFilter() public méthode

Initializes a new instance of the TexturedFilter class.
public TexturedFilter ( ITextureGenerator generator, IFilter filter1, IFilter filter2 ) : System
generator ITextureGenerator Texture generator.
filter1 IFilter First filter.
filter2 IFilter Second filter.
Résultat System

TexturedFilter() public méthode

Initializes a new instance of the TexturedFilter class.
public TexturedFilter ( float texture, IFilter filter1 ) : System
texture float Generated texture.
filter1 IFilter First filter.
Résultat System

TexturedFilter() public méthode

Initializes a new instance of the TexturedFilter class.
public TexturedFilter ( float texture, IFilter filter1, IFilter filter2 ) : System
texture float Generated texture.
filter1 IFilter First filter.
filter2 IFilter Second filter.
Résultat System