CImage:Sqrt
The Sqrt method computes the square root of the pixel values. The result replaces the image.
bSuccess = CImage:Sqrt() where |
bSuccess is the returned success code. On success it is true, otherwise false.
This method has a possibility of an illegal operation, "square root of a negative number", 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 computes the square root of the image values and redisplays the result:
|
-- attach the current displayed image |
|
-- perform the operation |
|
-- update the display after the shift |