false Value

Data Types


The data type describes the format of the value stored in a number or string. This may be a numeric value such as an integer or floating point number, or a string value for more complex quantities such as RGB color data. All Mira data types are listed in the table below.

Different functions and methods use the data type as a number or string as shown in the table below. For example, in the CImage class, Datatype returns the data type of image pixels as an integer Code, whereas DatatypeStr returns the data type using the String Name. Similarly, the CFile:Read and Write methods use the String Name to specify the data type of the value to read or write when working with a binary file. The Bytes column gives the number of bytes per value in memory.

Mira Data Types

Code

String Name

Bytes

Mathematical Description

1

byte

1

8 bit unsigned integer with range 0 to 255.

2

short

2

16 bit signed integer with range -32768 to 32767.

3

ushort

2

16 bit unsigned integer with range 0 to 65535.

4

long

4

32 bit signed integer.

5

float

4

32 bit IEEE floating point.

6

double

8

64 bit IEEE floating point.

7

rgb

4

24 bit color with each color channel containing a byte value in the range 0 to 255. Each pixel has 32 bits (4 bytes) consisting of 3, 8-bit channels plus one unused 8-bit channel.

8

urgb

8

48 bit color with each color channel containing a 16 bit unsigned integer value in the range 0 to 65535. Each pixel has 64 bits (8 bytes) consisting of 3, 16-bit channels plus one unused 16-bit channel.

9

lrgb

16

96 bit color with each color channel containing a 32 bit integer value. Each pixel has 128 bits (16 bytes) consisting of 3, 32-bit channels plus one unused 32-bit channel.

10

frgb

16

96 bit real color with each color channel containing a 32 bit floating point value. Each pixel has 128 bits (16 bytes) consisting of 3, 32-bit channels plus one unused 32-bit channel.

11

drgb

32

192 bit real color with each color channel containing a 64 bit floating point ("double") value. Each pixel has 256 bits (32 bytes) consisting of 3, 64-bit channels plus one unused 64-bit channel.

12

str

length+1

A string value consisting of one or more 8-bit characters. The number of bytes equals the string length plus 1 character for the terminating null.

Related Topics

CImage:Datatype, CImage:SetDatatype, DatatypeToStr, CFile:Read, CFile:Write