C# Класс Accord.Imaging.Filters.Texturer

Texturer filter.

Adjust pixels’ color values using factors from the given texture. In conjunction with different type of texture generators, the filter may produce different type of interesting effects.

The filter uses specified texture to adjust values using the next formula:
dst = src * PreserveLevel + src * FilterLevel * textureValue,
where src is value of pixel in a source image, dst is value of pixel in a destination image and textureValue is corresponding value from provided texture (see TextureGenerator or Texture). Using PreserveLevel and FilterLevel values it is possible to control the portion of source data affected by texture.

In most cases the PreserveLevel and FilterLevel properties are set in such way, that PreserveLevel + FilterLevel = 1. But there is no limitations actually for those values, so their sum may be as greater, as lower than 1 in order create different type of effects.

The filter accepts 8 bpp grayscale and 24 bpp color images for processing.

Sample usage:

// create filter Texturer filter = new Texturer( new TextileTexture( ), 0.3, 0.7 ); // apply the filter filter.ApplyInPlace( image );

Initial image:

Result image:

Наследование: BaseInPlacePartialFilter
Показать файл Открыть проект

Открытые методы

Метод Описание
Texturer ( ITextureGenerator generator ) : Accord.Imaging.Textures

Initializes a new instance of the Texturer class.

Texturer ( ITextureGenerator generator, double filterLevel, double preserveLevel ) : Accord.Imaging.Textures

Initializes a new instance of the Texturer class.

Texturer ( float texture ) : Accord.Imaging.Textures

Initializes a new instance of the Texturer class.

Texturer ( float texture, double filterLevel, double preserveLevel ) : Accord.Imaging.Textures

Initializes a new instance of the Texturer class.

Защищенные методы

Метод Описание
ProcessFilter ( UnmanagedImage image, Rectangle rect ) : void

Process the filter on the specified image.

Приватные методы

Метод Описание
Texturer ( ) : Accord.Imaging.Textures

Описание методов

ProcessFilter() защищенный Метод

Process the filter on the specified image.
protected ProcessFilter ( UnmanagedImage image, Rectangle rect ) : void
image UnmanagedImage Source image data.
rect System.Drawing.Rectangle Image rectangle for processing by the filter.
Результат void

Texturer() публичный Метод

Initializes a new instance of the Texturer class.
public Texturer ( ITextureGenerator generator ) : Accord.Imaging.Textures
generator ITextureGenerator Texture generator.
Результат Accord.Imaging.Textures

Texturer() публичный Метод

Initializes a new instance of the Texturer class.
public Texturer ( ITextureGenerator generator, double filterLevel, double preserveLevel ) : Accord.Imaging.Textures
generator ITextureGenerator Texture generator.
filterLevel double Filter level value (see property).
preserveLevel double Preserve level value (see property).
Результат Accord.Imaging.Textures

Texturer() публичный Метод

Initializes a new instance of the Texturer class.
public Texturer ( float texture ) : Accord.Imaging.Textures
texture float Generated texture.
Результат Accord.Imaging.Textures

Texturer() публичный Метод

Initializes a new instance of the Texturer class.
public Texturer ( float texture, double filterLevel, double preserveLevel ) : Accord.Imaging.Textures
texture float Generated texture.
filterLevel double Filter level value (see property).
preserveLevel double Preserve level value (see property).
Результат Accord.Imaging.Textures