minxy norm

mul


The mul function multiples the pixels of a CImage object or 1-dimensional array by a value.

Whereas this function operates on a pure (indexed) array, the slightly slower muln function operates on a general table that may be a multi-dimensional array or contain a mixture of numbers, strings, named keys, and sub-tables.

Syntax

result = mul( object, value )

bullet.gif    where object is a 1-dimensional array, CImage object, or simple number.

bullet.gif    value is a number.

bullet.gif    result is returned as an array, CImage object, or number, depending on the type of value.

Examples

The following script multiplies the members of a table by 3200.5.

t = mul( tbl, 3200.5 )

-- multiply the object by the value

  

The next script multiplies all pixels of a CImage by 3200.5.

V = AttachView( "CImageView" )

-- attach the topmost image window

Assert( V and V:Count() > 0 )

-- make sure an image window is on top

mul( V:GetImage(), 3200.5 )

-- multply the CImage by the value

Related Topics

Table and Array Functions

muln

 


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