CImage:Sqrt
The Sqrt method computes the square root of the pixel values.
bResult = CImage:Sqrt() |
On success, this method returns true.
On failure, this method returns false.
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.
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 |