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

Colour corrections. More...

Functions

ILuint ILAPIENTRY iluColoursUsed ()
 Returns the number of colours used in the current image. More...
 
ILboolean ILAPIENTRY iluContrast (ILfloat Contrast)
 changes the contrast of an image by using interpolation and extrapolation. More...
 
ILboolean ILAPIENTRY iluEqualize ()
 Equalizes the intensity distribution in the histogram of an image. More...
 
ILboolean ILAPIENTRY iluGammaCorrect (ILfloat Gamma)
 Performs gamma correction of an image. More...
 
ILboolean ILAPIENTRY iluHistogram (ILuint *Values, ILuint Count)
 Get a histogram of an image. More...
 
ILboolean ILAPIENTRY iluInvertAlpha ()
 Inverts the alpha in the image. More...
 
ILboolean ILAPIENTRY iluNegative ()
 Inverts the colours in the image.
 
ILboolean ILAPIENTRY iluNormalize ()
 Normalizes the intensities in an image. More...
 
ILboolean ILAPIENTRY iluSaturate1f (ILfloat Saturation)
 Modifies the color saturation of an image. More...
 
ILboolean ILAPIENTRY iluSaturate4f (ILfloat r, ILfloat g, ILfloat b, ILfloat Saturation)
 Modifies the color saturation of an image. More...
 
ILboolean ILAPIENTRY iluScaleAlpha (ILfloat scale)
 Scales the alpha components of the current bound image. More...
 
ILboolean ILAPIENTRY iluScaleColours (ILfloat r, ILfloat g, ILfloat b)
 Scales the individual colour components of the current bound image. More...
 
ILboolean ILAPIENTRY iluSwapColours ()
 "Swaps" the colour order of the current image. More...
 

Detailed Description

Colour corrections.

Brightness, contrast, gamma, etc.

Function Documentation

ILuint ILAPIENTRY iluColoursUsed ( )

Returns the number of colours used in the current image.

Creates a copy of the image data, quicksorts it and counts the number of unique colours in the image. This value is returned without affecting the original image.

Bug:
Only works with IL_UNSIGNED_BYTE typed non paletted images.
ILboolean ILAPIENTRY iluContrast ( ILfloat  Contrast)

changes the contrast of an image by using interpolation and extrapolation.

Common values for Contrast are in the range -0.5 to 1.7. Anything below 0.0 generates a negative of the image with varying contrast. 1.0 outputs the original image. 0.0 - 1.0 lowers the contrast of the image. 1.0 - 1.7 increases the contrast of the image. This effect is caused by interpolating (or extrapolating) the source image with a totally grey image.

Bug:
Only works with IL_UNSIGNED_BYTE typed non paletted images.
ILboolean ILAPIENTRY iluEqualize ( )

Equalizes the intensity distribution in the histogram of an image.

The lowest intensity will result in black and the highest in white.

ILboolean ILAPIENTRY iluGammaCorrect ( ILfloat  Gamma)

Performs gamma correction of an image.

If Gamma is less than 1.0, the image is darkened. If Gamma is greater than 1.0, the image is brightened.

ILboolean ILAPIENTRY iluHistogram ( ILuint *  Values,
ILuint  Count 
)

Get a histogram of an image.

Will store one value per channel spread over to whole supplied array.

Parameters
ValuesWhere to store the pixel counts.
CountNumber of entries in the value array, must be a multiple of the image's (or its palette's) number of channels.
ILboolean ILAPIENTRY iluInvertAlpha ( )

Inverts the alpha in the image.

Image must already have a valid alpha channel.

Todo:
Honour set region
ILboolean ILAPIENTRY iluNormalize ( )

Normalizes the intensities in an image.

The lowest intensity will result in black and the highest in white.

ILboolean ILAPIENTRY iluSaturate1f ( ILfloat  Saturation)

Modifies the color saturation of an image.

Applies a saturation consistent with the IL_LUMINANCE conversion values to red, green and blue. All parameters go from -1.0 to 1.0.

ILboolean ILAPIENTRY iluSaturate4f ( ILfloat  r,
ILfloat  g,
ILfloat  b,
ILfloat  Saturation 
)

Modifies the color saturation of an image.

Applies saturation to the colour components in the amounts specified. All parameters go from -1.0 to 1.0.

ILboolean ILAPIENTRY iluScaleAlpha ( ILfloat  scale)

Scales the alpha components of the current bound image.

Using 1.0f as the parameter yields that the original alpha value.

ILboolean ILAPIENTRY iluScaleColours ( ILfloat  r,
ILfloat  g,
ILfloat  b 
)

Scales the individual colour components of the current bound image.

Using 1.0f as any of the parameters yields that colour component's original plane in the new image.

ILboolean ILAPIENTRY iluSwapColours ( )

"Swaps" the colour order of the current image.

If the current image is in bgr(a) format, iluSwapColours will change the image to use rgb(a) format, or vice-versa. This can be helpful when you want to manipulate the image data yourself but only want to use a certain colour order. To determine the current colour order, call ilGetInteger with the IL_IMAGE_FORMAT parameter.