CImage:Recip
The Recip method computes the reciprocal of the pixel values by dividing each pixel into the value 1.0. The result replaces the current image.
bSuccess = CImage:Recip() where |
bSuccess is the returned success code. On success it is true, otherwise false.
Usually, the image should have real type pixels before using this method. The pixel data type can be tested and changed using IsReal and SetDatatype. See Data Types for more information.
The following script loads an image from the file sPath and computes the reciprocal:
|
-- create a new CImage |
|
-- load the image from a file named sPath |
|
-- calculate the reciprocal of the pixel values |