kolrabi's another Image Library  1.11.0
 All Files Functions Groups Pages

Applying convolution matrices to images. More...

Functions

ILboolean ILAPIENTRY iluAlienify (void)
 Funny as hell filter that I stumbled upon accidentally. More...
 
ILboolean ILAPIENTRY iluBlurAvg (ILuint Iter)
 Average each pixel with its surrounding pixels Iter times. More...
 
ILboolean ILAPIENTRY iluBlurGaussian (ILuint Iter)
 Blurs an image using a Gaussian convolution filter, which usually gives better results than the filter used by iluBlurAvg. More...
 
ILAPI ILboolean ILAPIENTRY iluConvolution (ILint *matrix, ILint scale, ILint bias)
 Applies a user supplied convolution matrix. More...
 
ILboolean ILAPIENTRY iluEdgeDetectE ()
 Performs edge detection using an emboss convolution filter. More...
 
ILboolean ILAPIENTRY iluEdgeDetectP ()
 Detects the edges in the current image by combining two convolution filters. More...
 
ILboolean ILAPIENTRY iluEdgeDetectS ()
 Detects the edges in the current image by combining two convolution filters. More...
 
ILboolean ILAPIENTRY iluEmboss ()
 Embosses an image, causing it to have a "relief" feel to it. More...
 
ILboolean ILAPIENTRY iluNoisify (ILclampf Tolerance)
 Adds some noise. More...
 
ILboolean ILAPIENTRY iluPixelize (ILuint PixSize)
 Pixelizes an image. More...
 
ILboolean ILAPIENTRY iluReplaceColour (ILubyte Red, ILubyte Green, ILubyte Blue, ILfloat Tolerance)
 Replaces any occurence of the the color set by ilClearColour() with the given color where the euclidean distance between the colors is Tolerance or lower. More...
 
ILboolean ILAPIENTRY iluSharpen (ILfloat Factor, ILuint Iter)
 Sharpens an image. More...
 
ILboolean ILAPIENTRY iluWave (ILfloat Angle)
 Some weird wavy thing. More...
 

Detailed Description

Applying convolution matrices to images.

Blurring, sharpening, edge detection, etc.

Function Documentation

ILboolean ILAPIENTRY iluAlienify ( void  )

Funny as hell filter that I stumbled upon accidentally.

Bug:
Only works with IL_UNSIGNED_BYTE typed non paletted images.
Todo:
Honour set region
ILboolean ILAPIENTRY iluBlurAvg ( ILuint  Iter)

Average each pixel with its surrounding pixels Iter times.

The 3x3 convolution filter used to do the average blur is:

$ \frac{ \left[ \begin{array}{rrr} 1 & 1 & 1 \\ 1 & 1 & 1 \\ 1 & 1 & 1 \end{array} \right] }{ 9 } $

Todo:
Honour set region
ILboolean ILAPIENTRY iluBlurGaussian ( ILuint  Iter)

Blurs an image using a Gaussian convolution filter, which usually gives better results than the filter used by iluBlurAvg.

The filter is applied up to Iter number of times, giving more of a blurring effect the higher Iter is. The 3x3 convolution filter used to do the gaussian blur is:

$ \frac{ \left[ \begin{array}{rrr} 1 & 2 & 1 \\ 2 & 4 & 2 \\ 1 & 2 & 1 \end{array} \right] }{ 16 } $

Todo:
Honour set region
ILAPI ILboolean ILAPIENTRY iluConvolution ( ILint *  matrix,
ILint  scale,
ILint  bias 
)

Applies a user supplied convolution matrix.

The matrix must be a 3x3 matrix.

Todo:
Honour set region
ILboolean ILAPIENTRY iluEdgeDetectE ( )

Performs edge detection using an emboss convolution filter.

The 3x3 convolution filter used to do the edge detected is:

$ \frac{ \left[ \begin{array}{rrr} -1 & 0 & 1 \\ -1 & 0 & 1 \\ -1 & 0 & 1 \end{array} \right] }{ 1 } $

Todo:
Honour set region
ILboolean ILAPIENTRY iluEdgeDetectP ( )

Detects the edges in the current image by combining two convolution filters.

The filters used are Prewitt filters. The two filters are:

$ A = \left[ \begin{array}{rrr} -1 & -1 & -1 \\ 0 & 0 & 0 \\ 1 & 1 & 1 \end{array} \right] , B = \left[ \begin{array}{rrr} 1 & 0 & -1 \\ 1 & 0 & -1 \\ 1 & 0 & -1 \end{array} \right] $

Todo:
Honour set region
ILboolean ILAPIENTRY iluEdgeDetectS ( )

Detects the edges in the current image by combining two convolution filters.

The filters used are Sobel filters. The two filters are:

$ A = \left[ \begin{array}{rrr} 1 & 2 & 1 \\ 0 & 0 & 0 \\ -1 & -2 & -1 \end{array} \right] , B = \left[ \begin{array}{rrr} 1 & 0 & -1 \\ 2 & 0 & -2 \\ 1 & 0 & -1 \end{array} \right] $

Todo:
Honour set region
ILboolean ILAPIENTRY iluEmboss ( )

Embosses an image, causing it to have a "relief" feel to it.

The 3x3 convolution filter used is:

$ \left[ \begin{array}{rrr} -1 & 0 & 1 \\ -1 & 0 & 1 \\ -1 & 0 & 1 \end{array} \right] + 0.5 $

Todo:
Honour set region
ILboolean ILAPIENTRY iluNoisify ( ILclampf  Tolerance)

Adds some noise.

Very simple right now.

Todo:
This will probably use Perlin noise and parameters in the future.
ILboolean ILAPIENTRY iluPixelize ( ILuint  PixSize)

Pixelizes an image.

Todo:
Could probably be optimized a bit...too many nested for loops.
ILboolean ILAPIENTRY iluReplaceColour ( ILubyte  Red,
ILubyte  Green,
ILubyte  Blue,
ILfloat  Tolerance 
)

Replaces any occurence of the the color set by ilClearColour() with the given color where the euclidean distance between the colors is Tolerance or lower.

Todo:
Honour set region.
ILboolean ILAPIENTRY iluSharpen ( ILfloat  Factor,
ILuint  Iter 
)

Sharpens an image.

Can actually either sharpen or blur an image, depending on the value of Factor. iluBlurAvg and iluBlurGaussian are much faster for blurring, though. When Factor is 1.0, the image goes unchanged. When Factor is in the range 0.0 - 1.0, the current image is blurred. When Factor is in the range 1.0 - 2.5, the current image is sharpened. To achieve a more pronounced sharpening/blurring effect, simply increase the number of iterations by increasing the value passed in Iter.

Todo:
Honour set region.
ILboolean ILAPIENTRY iluWave ( ILfloat  Angle)

Some weird wavy thing.

Parameters
AngleSome angle.