CrystalSpace

Public API Reference

csImageManipulate Class Reference
[Graphics]

Helper class to manipulate iImage objects. More...

#include <csgfx/imagemanipulate.h>

List of all members.

Static Public Member Functions

static csRef< iImageBlur (iImage *source, csRGBpixel *transp=0)
 Return a blurred version of the image.
static csRef< iImageCrop (iImage *source, int x, int y, int width, int height)
 Create a new image and copy a subpart of the actual image into the new image.
static csRef< iImageGray (iImage *source)
 Create a new grayscale version of the given image.
static csRef< iImageMipmap (iImage *source, int step, csRGBpixel *transp=0)
 Create a new iImage which is a mipmapped version of this one.
static csRef< iImageRenormalizeNormals (iImage *source)
 Renormalizes a normal map (ie RGB triplets represent XYZ directions, stored biased and scaled so that the value 0 is mapped to -1, the value 255 is mapped to 1).
static csRef< iImageRescale (iImage *source, int NewWidth, int NewHeight, int NewDepth=1)
 Rescale an image to the given size.
static csRef< iImageSharpen (iImage *source, int strength, csRGBpixel *transp=0)
 Create a sharpened copy of the image.
static csRef< iImageTransformColor (iImage *source, const csColor4 &mult, const csColor4 &add)
 Do color manipulation on the image data and return a new image.

Detailed Description

Helper class to manipulate iImage objects.

The methods in this class generally return new images.

Definition at line 39 of file imagemanipulate.h.


Member Function Documentation

static csRef<iImage> csImageManipulate::Blur ( iImage source,
csRGBpixel transp = 0 
) [static]

Return a blurred version of the image.

static csRef<iImage> csImageManipulate::Crop ( iImage source,
int  x,
int  y,
int  width,
int  height 
) [static]

Create a new image and copy a subpart of the actual image into the new image.

static csRef<iImage> csImageManipulate::Gray ( iImage source  )  [static]

Create a new grayscale version of the given image.

This function works for RGBA and paletted images.

static csRef<iImage> csImageManipulate::Mipmap ( iImage source,
int  step,
csRGBpixel transp = 0 
) [static]

Create a new iImage which is a mipmapped version of this one.

'step' indicates how much the mipmap should be scaled down. Step 0 returns the original image. Step 1 scales the image down to 1/2. Steps > 1 repeat this 'step' times. The new image will have same format as the original one. If you pass a pointer to a transparent color, the texels of that color are handled differently.

static csRef<iImage> csImageManipulate::RenormalizeNormals ( iImage source  )  [static]

Renormalizes a normal map (ie RGB triplets represent XYZ directions, stored biased and scaled so that the value 0 is mapped to -1, the value 255 is mapped to 1).

static csRef<iImage> csImageManipulate::Rescale ( iImage source,
int  NewWidth,
int  NewHeight,
int  NewDepth = 1 
) [static]

Rescale an image to the given size.

static csRef<iImage> csImageManipulate::Sharpen ( iImage source,
int  strength,
csRGBpixel transp = 0 
) [static]

Create a sharpened copy of the image.

The effect of 'strength' differs from image to image. Values around 128-512 give good results. On really blurry images values up to 1024 or 2048 can be used.

static csRef<iImage> csImageManipulate::TransformColor ( iImage source,
const csColor4 mult,
const csColor4 add 
) [static]

Do color manipulation on the image data and return a new image.

This function works for RGBA and paletted images. Since the mult and add parameters are 4-colors you can also manipulate the alpha channel using this function.

Parameters:
mult is a 4-color indicating a multiplier to use for the colors.
add is a 4-color indicating an adder to use for the colors.

The documentation for this class was generated from the following file:

Generated for Crystal Space 2.1 by doxygen 1.6.1