File and Data Types

File types specify the format to be created, or the format of the file found when it is opened for reading. The following file formats are defined as enumerator tags of the miImg_format typedef:

miIMG_FORMAT_RGB SGI RGB, compressed
miIMG_FORMAT_TIFF compressed TIFF in various subformats
miIMG_FORMAT_TIFF_U uncompressed TIFF in various subformats
miIMG_FORMAT_RLA Wavefront RLA
miIMG_FORMAT_RLB Wavefront RLB
miIMG_FORMAT_TARGA compressed RGBA Targa
miIMG_FORMAT_PIC Softimage pic, compressed
miIMG_FORMAT_ALIAS Alias
miIMG_FORMAT_CATIA Dassault Systèmes CATIA format
miIMG_FORMAT_JPEG baseline sequential JPEG
miIMG_FORMAT_PNG Portable Network Graphics
miIMG_FORMAT_HDR Radiance 8-bit RGBE high dynamic range image
miIMG_FORMAT_IFF Autodesk Maya color image format
miIMG_FORMAT_EXR OpenEXR image format
miIMG_FORMAT_DDS DirectX texture
miIMG_FORMAT_PPM Jef Poskanzer's portable pixmaps
miIMG_FORMAT_BMP Microsoft BMP 32-bit uncompressed
miIMG_FORMAT_QNT_PAL Quantel/Abekas, 576x720
miIMG_FORMAT_QNT_NTSC Quantel/Abekas, 486x720
miIMG_FORMAT_CT mi Color Texture
miIMG_FORMAT_CT_H mi HDR RGBE Color Texture
miIMG_FORMAT_ST mi Scalar Texture
miIMG_FORMAT_VT mi vector texture, from alpha
miIMG_FORMAT_WT mi vector texture, from intensity
miIMG_FORMAT_ZT mi Z channel, from intersect depth
miIMG_FORMAT_NT mi normal vectors
miIMG_FORMAT_MT mi motion vectors
miIMG_FORMAT_TT mi tag channel, from material tags
miIMG_FORMAT_BIT mi one-bit render-enable flags
miIMG_FORMAT_HT mi 8-bit RGBE high dynamic range image
miIMG_FORMAT_MAP mmap-ed raw texture file
miIMG_FORMAT_ZPIC Softimage Zpic, uncompr Z coords
miIMG_FORMAT_NULL dummy file, write nothing at all
miIMG_FORMAT_LWI Solidworks texture, read only
miIMG_FORMAT_PS PostScript, write only
miIMG_FORMAT_EPS Encapsulated PostScript, write only
miIMG_FORMAT_SHMAP shadow map, like ZT with appended space info
miIMG_FORMAT_CUSTOM_0 first user-defined file format
miIMG_FORMAT_CUSTOM_15 last user-defined file format
miIMG_FORMAT_TIFF_3 * compressed 3-component 8bit TIFF
miIMG_FORMAT_TIFF_U3 * uncompressed 3-component 8bit TIFF
miIMG_FORMAT_TIFF_16 * compressed 4-component 16bit TIFF
miIMG_FORMAT_TIFF_16_U * uncompress 4-component 16bit TIFF
miIMG_FORMAT_TIFF_16_3 * compressed 3-component 16bit TIFF
miIMG_FORMAT_TIFF_16_U3 * uncompress 3-component 16bit TIFF
miIMG_FORMAT_CT_16 * mi Color Texture, 16 bits
miIMG_FORMAT_CT_FP * mi Color Texture, floating-point
miIMG_FORMAT_ST_16 * mi Scalar Texture, 16 bits
miIMG_FORMAT_ST_FP * mi Scalar Texture, floating-point

Formats in the lower section of the table marked with * are obsolete and should not be used in future versions. Data-dependent format variants are now selected with the appropriate data type. If the data type does not match the format, the best default type for the format is used. Custom formats must be registered with mi_img_custom_format before they can be used.

Available data types are the following enumerator tags of the miImg_type typedef:

miIMG_TYPE_RGBA 4*8 bits, color with alpha
miIMG_TYPE_RGBA_16 4*16 bits, color with alpha
miIMG_TYPE_RGBA_FP 4*32 bits, color with alpha, floats [1]
miIMG_TYPE_RGB 4*8 bits, color
miIMG_TYPE_RGB_16 4*16 bits, color
miIMG_TYPE_RGB_FP 4*32 bits, color, floats [1]
miIMG_TYPE_RGBE 4*8 bits, high dynamic range RGB color
miIMG_TYPE_A 1*8 bits, alpha
miIMG_TYPE_A_16 1*16 bits, alpha
miIMG_TYPE_A_FP 1*32 bits, alpha, floats [1]
miIMG_TYPE_S 1*8 bits, intensity
miIMG_TYPE_S_16 1*16 bits, intensity
miIMG_TYPE_S_FP 1*32 bits, intensity, floats [1]
miIMG_TYPE_VTA 2*16 bits, bumpmap from alpha
miIMG_TYPE_VTS 2*16 bits, bumpmap from intensity
miIMG_TYPE_Z 1*32 bits, Z coordinates (float)
miIMG_TYPE_N 3*32 bits, normal vectors (float)
miIMG_TYPE_M 3*32 bits, motion vectors (float)
miIMG_TYPE_TAG 1*32 bits, tag channel
miIMG_TYPE_BIT 1*1 bit, bit mask
miIMG_TYPE_COVERAGE 1*32 bits, fp coverage of dominating object
miIMG_TYPE_ANY wildcard that turns off all conversions
miIMG_TYPE_ERROR special value for mi_img_identify_type

[1] The floating-point color formats can store component values outside the range 0…1. When such a value is converted to an 8-bit or 16-bit format it will be clamped into the representable value range.

File formats support data types, at least one default data type, called best_type; for example, a SOFTIMAGE PIC file could have data type miIMG_TYPE_RGBA or miIMG_TYPE_RGB, and an NT normal vector file always has the data type miIMG_TYPE_N. In general, much more file format variants are accepted on input than are available for output. Output types are reduced to just the most useful types, like miIMG_TYPE_RGBA or miIMG_TYPE_RGB for color images. As a special case, mental ray will allow storing RGBE data in 8-bit RGBA formats if this is explicitly requested; such image files are not displayable with standard image viewing programs.

miIMG_FORMAT_MAP files are an exception; they have their own data type field in the header which can have any miIMG_TYPE_* value. However, when opening a file, it is possible to specify the desired data type to be used when scanlines are accessed; or, when creating a file, specify the data type of the scanlines to be written. If these data types disagree with the data types supported by the file format, the image module transparently converts the data type. Not all conversions are possible.

Copyright © 1986, 2015 NVIDIA ARC GmbH. All rights reserved.