add


The add function adds a value to a CImage object or 1-dimensional array.

Syntax

result = add( object, value )

bullet.gif    where object is a 1-dimensional array, CImage object, or single 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 adds 3200.5 to all members of a table.

t = add( tbl, 3200.5 )

-- add the number to all members of the table

  

The next script adds 3200.5 to all pixels of a CImage.

V = AttachView( "CImageView" )

-- attach the topmost image window

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

-- make sure an image window is on top

add( V:GetImage(), 3200.5 )

-- add the value to the CImage

Related Topics

Table and Array Functions

addn


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