8.15. tsImageBlur

Syntax

Pascal

procedure tsImageBlur(ImageID: tsImageID; X: tsFloat; Y: tsFloat;
  ChannelMask: tsBitmask; AutoExpand: tsBool;
  ExpandSizeX: ptsInt; ExpandSizeY: ptsInt);

C/C++

void tsImageBlur(tsImageID ImageID, tsFloat X, tsFloat Y,
  tsBitmask ChannelMask, tsBool AutoExpand,
  tsInt * ExpandSizeX, tsInt * ExpandSizeY);

Description

This function will apply an gaussian blur algorithm to the given image. You can specify an horizontal and vertical size of the filter separately. Also you have full informations about the resulting image.

Params

ImageID

The ID of the image which will be resized.

X

The horizontal position where the original image will be placed.

Y

The vertical position where the original image will be placed.

ChannelMask

Indicates on which channels the blurring will be applied. For an list of all available flags look in the table Channelmasks.

AutoExpand

This parameter controls the expansion of the image. The following values are allowed for AutoExpand.

TS_TRUE

The image will be expanded.

TS_FALSE

The size of the image wont be changed.

ExpandSizeX

If this param isn't nil / NULL the function returns the single horizontal size by which the image was expanded. The image was expanded on the left and on the right side. So the new width of the image is the old width and 2 * ExpandSizeX.

ExpandSizeY

If this param isn't nil / NULL the function returns the single vertical size by which the image was expanded. The image was expanded on the top and on the bottom. So the new height of the image is the old height and 2 * ExpandSizeY.

Error Codes

TS_NO_ACTIVE_CONTEXT

If there was no context bound.

TS_INVALID_OPERATION

If you try to resize an empty image.

TS_INVALID_VALUE

This will happen if you pass an invalid ImageID to this function.