formZ SDK | 5.0 API Reference | System | Texture Maps

# fz_tmap_get_pixels

Description

Gets the pixels of a texture map. The channel argument indicates whether the rgb, alpha or rgb and alpha channels are returned. The pixels array must be allocated by the calling code to provide enough space to hold the cropped image of the texture. The required space can be calculated as follows :
nbytes = (crop_rect.right - crop_rect.left) * (crop_rect.bottom - crop_rect.top) * num_channels
When loading the rgb channels, num_channels is 3, the alpha channel only, num_channels is 1 and rgb and alpha, num_channels is 4.
fz_tmap_find_file should be called before using this function.

Plugin Prototype

fzrt_error_td fz_tmap_get_pixels(

fz_tmap_ptr | tmap,
unsigned char * | pixels,
fz_tmap_channel_enum | channels )

Parameters

tmap [Input]

the texture map for which to get the pixels

pixels [Result]

a preallocated array which receives the pixels

channels [Input]

which channels of the texture map to extract

Returns

error codes

Availability

5.0.0.0

See Also

Function Set

fz_tmap_fset

Defined in

fz_tmap_api.h