Images

Element type: miSCENE_IMAGE
Data type: miImg_image
Sizes: -
Defaults: all nulls
typedef struct miImg_image {
        miBoolean       filter;         /* caller wants filtered lookups */
        int             dirsize;        /* valid # of filter levels */
        int             dir[miIMG_DIRSIZE]; /* offs from this to other imgs */
        int             width, height;  /* width and height in pixels */
        int             bits;           /* requested bits per comp, 8/16/32 */
        int             comp;           /* requested components/pixel, 1..4 */
        miCBoolean      local;          /* local texture, use image/mmap/path*/
        miCBoolean      writable;       /* writable texture (eg. light map) */
        miCBoolean      cacheable;      /* cache in parts */
        miCBoolean      remap;          /* image is remapped */
        int             type;           /* requested miIMG_TYPE_* */
        miTag           real_name;      /* (local) file name to open */
        miTag           colorprofile;   /* color profile for image data */
        int             c[4];           /*      indexed by miIMG_*; 4*height */
                                        /*      component indices follow, */
                                        /*      then component scanlines */
} miImg_image;

A translator must provide: nothing.
A translator may provide: nothing.
Provided by mi_scene_create: all fields.

Images consist of three sections: the header (type miImg_image), a list of scanlines indices, and the actual uncompressed pixel data. There are height − 1 scanline indices, one set of comp (up to 4) indices for each scanline. They contain indices relative to the first pixel data byte. The pixel data is arranged in one-component scanlines of width component values each. All images are scanned bottom-up.

filter, if nonzero, enables pyramid texture mode.

dirsize and dir are used for internal purposes.

width is the number of pixels per scanline.

height is the number of scanlines.

bits is the number of bits per component pixel.

comp is the number of components per pixel.

writable, if true, specifies a writable texture. Such textures are created by shaders, usually lightmap shader, and then written to disk.

cacheable3.1, if true, is used internally to mark images that are paged into a texture cache. Do not set.

remap, if true, specifies that the image is a .map file created with imf_copy -r, which rearranges pixels so that the unit of caching is a ractangle instead of a group of scanlines. This increases cache performance for large textures.

local, if true, specifies a local image that each slave on the network must read locally, instead of fetching it across the network from the master.

type is the data type of the image.

real_name2.1 is the tag of a database item of type string (contains a null-terminated ASCII string) that is the full path of the file to open. This name is used for local images, where the file is opened when first accessed (after the usual filename rewriting). For this purpose, the path is not sufficient because it may be truncated. mental ray 3.0 accesses a symbol table to find the name specified with mi_api_texture_file_def instead of relying on real_name, because the file may be demand-loaded or memory-mapped, so that real_name may be unavailable or incorrect.

color_profile3.4 is a tag associated with the color profile describing the color space of the image color data. When the image data are created and rendering was performed in a prescribed color space, then the color data are transformed to the specified color profile before they are written. If the image data are read, then they are transformed from the given representation to the color profile associated with the rendering color space.

c is the first scanline index block. Only comp of the 4 available indices are used. It is unused if local is true.

Copyright © 1986-2009 by mental images GmbH