CImage:SetVal CImage:Sub

CImage:Sqrt


The Sqrt method computes the square root of the pixel values.

Syntax

bResult = CImage:Sqrt()

    On success, this method returns true.

    On failure, this method returns false.

Remarks

This method has a possibility of an illegal square root of a negative number operation if a negative valued pixel is encountered. 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 fragment computes the square root of the image values and redisplays the result:

 

I = V:GetImage()

-- attach the current displayed image

I:Sqrt()

-- perform the operation

V:Update()

-- update the display after the shift

Related Topics

CImage , Pow