CImage:Recip
The Recip method computes the reciprocal of the pixel values.
bResult = CImage:Recip() |
On success, this method returns true
On failure, this method returns 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 fragment loads an image from the file sPath, computes the reciprocal, and saves the result back to the file:
I = CImage:new() |
-- create a new CImage |
I:Open(sPath) |
-- load the image from a file named sPath |
I:Recip() |
-- perform the operation |
I:Save() |
|