CImage:Powab
The Powab method raises the pixels of the current image to powers specified by the pixels of the operand image. This is useful for masking or sensitivity correction operations in which the operand image is a correction mask.
bResult = CImage:Pow( CImage )
CImage is the operand image, which is unchanged by this operation.
On success, this method returns true.
On failure, this method returns false.
This method has a possibility of an illegal operation if a negative number is raised to a non-integral power. 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 fragment loads a "mask" image from the file sPath, then applies it to a displayed image and redisplays the result:
I = V:GetImage() |
-- attach the current displayed image |
Imask = CImage:new() |
-- create a CImage for the mask image |
Imask:Open( sPath ) |
-- load the "mask" image |
I:Powab( Imask ) |
-- perform the operation |
V:Update() |
-- update the display after the shift |
Imask:delete() |
-- free the memory of the mask image |