C# Класс AForge.Imaging.Filters.RotateNearestNeighbor

Rotate image using nearest neighbor algorithm.

The class implements image rotation filter using nearest neighbor algorithm, which does not assume any interpolation.

Rotation is performed in counterclockwise direction.

The filter accepts 8/16 bpp grayscale images and 24/48 bpp color image for processing.

Sample usage:

// create filter - rotate for 30 degrees keeping original image size RotateNearestNeighbor filter = new RotateNearestNeighbor( 30, true ); // apply the filter Bitmap newImage = filter.Apply( image );

Initial image:

Result image:

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

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

Метод Описание
RotateNearestNeighbor ( double angle ) : System

Initializes a new instance of the RotateNearestNeighbor class.

This constructor sets BaseRotateFilter.KeepSize property to .

RotateNearestNeighbor ( double angle, bool keepSize ) : System

Initializes a new instance of the RotateNearestNeighbor class.

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

Метод Описание
ProcessFilter ( UnmanagedImage sourceData, UnmanagedImage destinationData ) : void

Process the filter on the specified image.

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

Метод Описание
ProcessFilter16bpc ( UnmanagedImage sourceData, UnmanagedImage destinationData ) : void
ProcessFilter8bpc ( UnmanagedImage sourceData, UnmanagedImage destinationData ) : void

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

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

Process the filter on the specified image.
protected ProcessFilter ( UnmanagedImage sourceData, UnmanagedImage destinationData ) : void
sourceData UnmanagedImage Source image data.
destinationData UnmanagedImage Destination image data.
Результат void

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

Initializes a new instance of the RotateNearestNeighbor class.

This constructor sets BaseRotateFilter.KeepSize property to .

public RotateNearestNeighbor ( double angle ) : System
angle double Rotation angle.
Результат System

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

Initializes a new instance of the RotateNearestNeighbor class.
public RotateNearestNeighbor ( double angle, bool keepSize ) : System
angle double Rotation angle.
keepSize bool Keep image size or not.
Результат System