CImage:Powa


The Powa method raises a specified number (the base) to a power given by each array element pixel. The result replaces the image.

Syntax

bSuccess = CImage:Pow( nBase )

where

    nBase specifies the value to be raised to a power.

    bSuccess is the returned success code. On success it is true, otherwise false.

  

This method has a possibility of an illegal operation if a negative number is raised to a non-integral power. Mira traps this condition and substitutes a replacement value into the output pixel. The replacement value is set for math operations using the SetMathErrVal method.

Example

Suppose an image is displayed in a CImageView named V. The following script raises 1.5 to powers specified by the image pixels:

I = V:GetImage()

-- attach the current displayed image

I:Powa( 1.5 )

-- raise 1.5 to the power of each image pixel

V:Update()

-- update the display after the shift

Related Topics

Pow

Sqrt

CImage class