CImage:PixelTypeStr (replaces DatatypeStr)


The PixelTypeStr method returns the name of the image pixel type as a string. The pixel type refers to the value representation stored in the pixel (integer, real, etc.).

Syntax

sType = CImage:PixelTypeStr()

bullet.gif    wheresType is a string giving the name of the Mira pixel type (see Remarks).

Remarks

The value sType returned by this method is defined in the Mira Pixel Types table. You can also use the PixelType method to retrieve the pixel type as a numeric code.

Example

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

I = new_image()

-- Create a CImage

I:Open( sPath )

-- Open the image from file path sPath.

s = I:PixelTypeStr()

-- retrieve the pixel type name string

Printf( "Pixel Type = %s\n",s)

-- result: Pixel Type = long

I:delete()

-- delete the CImage from memory

Related Topics

CImage class, PixelType, Pixel Types


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