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.

Syntax

bResult = CImage:Pow( CImage )

bullet.gif    CImage is the operand image, which is unchanged by this operation.

bullet.gif    On success, this method returns true.

bullet.gif    On failure, this method returns false.

Remarks

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.

Example

Suppose an image is displayed in a CImageView named V. The following script 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 = new_image()

-- 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

Related Topics

CImage class, Pow, Powa, Sqrt


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.