int PEXGenerateMipmap( int domain, PEXTMDomainData *domain_data, unsigned long int power_of_two_tm_required, unsigned long int square_tm_required, PEXMipmapLevel *base_map, PEXMipmapLevel **texel_array )
Zero if successful; otherwise, one of the following:
Invoke PEXGenerateMipmap to create a prefiltered texture map and get a list of texel arrays suitable for the PEXCreateMipmapTM function.
The information contained in domain and domain_data determines if a mipmap or other type of texture map is created from the base level data provided. At present, color mipmaps are the only type of domain supported. Subsequent releases of PEX may support others.
You need to set the tm_type, texel_type, and num_levels members of the PEXTMDomainData structure before invoking this function. A value of zero in num_levels indicates to the function that it should generate as many levels as necessary to create a full mipmap pyramid or other type of supported map. If the value is non-zero, then the utility creates either the number of levels requested or all the levels for a full map, whichever is less. Upon exit, the num_levels field is updated to the number of levels actually created by the utility.
The implementation constraints are observed in the creation of the final texel data. If an implementation requires that maps be created with square dimensions and/or dimensions which are a power of two, then the utility applies the appropriate image sizing to the nearest correct dimension. When shrinking the image, the texels from the source image are sampled down using a box filter to create the destination image. When magnifying the image, the texels from the source image are linearly interpolated to create the destination image.
Texel arrays allocated by this function are disposed of using the PEXFreeMipmap utility after they have been used by the PEXCreateMipmapTM function.
None.
For a list of related topics and for a list of all texture mapping functions, see Texture Mapping.