Rotate image using bicubic interpolation.

The class implements image rotation filter using bicubic interpolation algorithm. It uses bicubic kernel W(x) as described on Wikipedia (coefficient a is set to -0.5).

Rotation is performed in counterclockwise direction.

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

Sample usage:

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

Initial image:

Result image:

Inheritance: BaseRotateFilter
Example #1
0
        private void SetFilter()
        {
            ImageType = ImageTypes.Rgb24bpp;

            switch (mode)
            {
            case Modes.Bicubic:
                Af.RotateBicubic newFilterA = new Af.RotateBicubic(angle);
                newFilterA.FillColor = color;
                newFilterA.KeepSize  = keepSize;
                imageFilter          = newFilterA;
                break;

            case Modes.Bilinear:
                Af.RotateBilinear newFilterB = new Af.RotateBilinear(angle);
                newFilterB.FillColor = color;
                newFilterB.KeepSize  = keepSize;
                imageFilter          = newFilterB;
                break;

            case Modes.Nearest:
                Af.RotateNearestNeighbor newFilterC = new Af.RotateNearestNeighbor(angle);
                newFilterC.FillColor = color;
                newFilterC.KeepSize  = keepSize;
                imageFilter          = newFilterC;
                break;
            }
        }