CImage:Datatype


The Datatype method returns the name of the image data type as a string. The data type refers to the value representation stored in the pixel. For example, "int" refers to a long integer having 4 bytes per pixel, and "double" refers to a double precision real number having 8 bytes per pixel.

Syntax

sType = CImage:Datatype()

where

    sType is a string giving the name of the Mira data type.

  

The data type string returned by this method is defined in the Mira Data Types table.

Example

Suppose the file sPath contains an image with data type 4, or "int" (32 bit integer) pixels. The following script prints the data type of the image:

I = CImage:new()

-- Create a CImage

I:Open( sPath )

-- Open the image from file path sPath.

s = I:Datatype()

-- retrieve the data type name

Printf( "Data type = '%s'\n",s)

-- result: Data type = 'int'

Related Topics

SetDatatype

CImage class

Mira Data Types