CImage:Chs
The Chs method changes the sign of the pixels in the image.
bSuccess = CImage:Chs()
where
bSuccess is the returned success code. On success it is true, otherwise false.
The Chs operation changes positive pixel value to negative ones and vice versa. If the data type is entirely positive, like "byte" or "ushort", this operation does nothing.
The following script loads an image from the file sPath and changes the sign of the pixel values:
|
-- create a new CImage |
|
-- load the image from a file named sPath |
|
-- change the sign of all image pixels |
The same result could be accomplished using the - (unary minus) math operator:
|
-- create a new CImage |
|
-- load the image from a file named sPath |
|
-- change the sign of all image pixels |