CImage:Sqrt


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

Syntax

bResult = CImage:Sqrt()

bullet.gif    On success, this method returns true.

bullet.gif    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 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 class, Pow


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.