CImage:Datatype
The Datatype method returns the data type of image pixels as a numeric code. The data type refers to the value representation stored in the pixel (integer, real, etc.).
nCode = CImage:Datatype() |
The data type returned by this method is defined in the Mira Data Types table. You can also use the DatatypeStr method to retrieve the data type name as a string.
Suppose the file sPath contains an image with "long" (32 bit integer) pixels. The following script fragment prints the data type of the image:
|
-- Create a CImage |
|
-- Open the image from file path sPath. |
|
-- retrieve the numeric data type |
|
-- result: Data type = 4 |
|
-- delete the CImage from memory |