[mmlimits] [Up] [mmdatatype] Image Information and Manipulation

mmmaxleveltype
Returns the maximum value associated to an image datatype

Synopsis

max = mmmaxleveltype( TYPE = 'uint8' )

Implemented in Python.

Input

TYPE String

One of the strings 'uint8', 'uint16' or 'int32', specifying the image type

Default: 'uint8'

Output

max

the maximum level value of type TYPE

Source Code

def mmmaxleveltype(TYPE='uint8'):
    max = 0
    if   TYPE == 'uint8'  : max=255
    elif TYPE == 'binary' : max=1
    elif TYPE == 'uint16' : max=65535
    elif TYPE == 'int32'  : max=2147483647
    else:
        assert 0, 'does not support this data type:'+TYPE
    return max
    
[mmlimits] [Up] [mmdatatype] Python