CImage:Len


The Len method returns either the number of pixels in the image or the number of pixels along a specified axis.

Syntax

nLen = CImage:Len()

nLen = CImage:Len( nAxis )

 

where

    If no argument is given, the total number of pixels in the image is returned.

    nAxis is the axis whose length is being requested. This value is between 1 and the maximum number of axes supported by Mira. For example, nAxis=1 returns the number of columns in the image.

    nLen is the number of pixels along axis nAxis.

    On failure, this method returns 0.

Example

Suppose that CImage I has dimension 1024 x 512 x 64. Then

 

nLen = I:Len(1)

-- returns nLen = 1024

nLen = I:Len(2)

-- returns nLen = 512

nLen = I:Len(3)

-- returns nLen = 64

nLen = I:Len()

-- returns nLen = 33554432

Related Topics

Cols

Rows

Planes

Pixels

Data Type

CImage class