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.

Syntax

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.

Example

The following script loads an image from the file sPath and computes the reciprocal:

I = CImage:new()

-- create a new CImage

I:Open(sPath)

-- load the image from a file named sPath

I:Recip()

-- calculate the reciprocal of the pixel values

Related Topics

Div

Xdiv

CImage class