Vizard 8 » Reference » Shaders » Post-Process Effects » Transform effects
8.1

Transform effects

The vizfx.postprocess.transform library is a collection of effects that perform various transformations on the rendered image.

Flip

 

Flips the image horizontally and/or vertically.

Constructor

Description

FlipEffect(

    horizontal = False,

    vertical = False

)

Create the flip effect with the initial horizontal and vertical flip flags.

 

Method

Description

<effect>.setFlipHorizontal(flip)

Set whether to flip image horizontally.

<effect>.getFlipHorizontal()

Get if image is flipped horizontally.

<effect>.setFlipVertical(flip)

Set whether to flip image vertically.

<effect>.getFlipVertical()

Get if image is flipped vertically.

This effect can be registered with vizconfig.

import vizfx.postprocess
from vizfx.postprocess.transform import FlipEffect
effect = FlipEffect(horizontal=True)
vizfx.postprocess.addEffect(effect)

Translate

 

Translate the image.

Constructor

Description

TranslateEffect(

    translate = (0.0,0.0),

    repeat = False

}

Create the translate effect with the initial translate offset and repeat flag.

 

Method

Description

<effect>.setTranslate(value)

Set the [x,y] translation in normalized (0-1) units.

<effect>.getTranslate()

Get the [x,y] translation in normalized (0-1) units.

<effect>.setRepeat(value)

Set whether to repeat the image when UV coordinates are outside (0-1) range.

<effect>.getRepeat()

Get whether to repeat the image when UV coordinates are outside (0-1) range.

This effect can be registered with vizconfig.

import vizfx.postprocess
from vizfx.postprocess.transform import TranslateEffect
effect = TranslateEffect(translate=(0.25,0.25))
vizfx.postprocess.addEffect(effect)

Rotate

 

Rotate the image about a specified center.

Constructor

Description

RotateEffect(

    angle = 0.0,

    center = (0.5,0.5),

    repeat = False

)

Create the rotate effect with the initial rotation angle, center, and repeat flag.

 

Method

Description

<effect>.setAngle(value)

Set the rotation angle, in degrees. Positive angles rotate clockwise.

<effect>.getAngle()

Get the rotation angle, in degrees.

<effect>.setCenter(value)

Set the [x,y] center to rotate about, in normalized (0-1) units.

<effect>.getCenter()

Get the [x,y] center to rotate about, in normalized (0-1) units.

<effect>.setRepeat(value)

Set whether to repeat the image when UV coordinates are outside (0-1) range.

<effect>.getRepeat()

Get whether to repeat the image when UV coordinates are outside (0-1) range.

This effect can be registered with vizconfig.

import vizfx.postprocess
from vizfx.postprocess.transform import RotateEffect
effect = RotateEffect(angle=45)
vizfx.postprocess.addEffect(effect)

Scale

 

Scale the image about a specified center.

Constructor

Description

ScaleEffect(

    scale = (1.0,1.0),

    center = (0.5,0.5),

    repeat = False

)

Create the scale effect with the initial scale factor, center, and repeat flag.

 

Method

Description

<effect>.setScale(value)

Set the [x,y] scale factor.

<effect>.getScale()

Get the [x,y] scale factor.

<effect>.setCenter(value)

Set the [x,y] center to scale about, in normalized (0-1) units.

<effect>.getCenter()

Get the [x,y] center to scale about, in normalized (0-1) units.

<effect>.setRepeat(value)

Set whether to repeat the image when UV coordinates are outside (0-1) range.

<effect>.getRepeat()

Get whether to repeat the image when UV coordinates are outside (0-1) range.

This effect can be registered with vizconfig.

import vizfx.postprocess
from vizfx.postprocess.transform import ScaleEffect
effect = ScaleEffect(scale=(0.5,0.5))
vizfx.postprocess.addEffect(effect)

Post-Process Basics

Color Effects

Distort Effects

Blur Effects

Transform Effects

Composite Effects