ImageData

sg_image_data

Defines the content of an image through an array of sg_range structs, each range pointing to the pixel data for one mip-level. For array-, cubemap- and 3D-images each mip-level contains all slice-surfaces for that mip-level in a single tightly packed memory block.

The size of a single surface in a mip-level for a regular 2D texture can be computed via:

sg_query_surface_pitch(pixel_format, mip_width, mip_height, 1);

For array- and 3d-images the size of a single miplevel is:

num_slices * sg_query_surface_pitch(pixel_format, mip_width, mip_height, 1);

For cubemap-images the size of a single mip-level is:

6 * sg_query_surface_pitch(pixel_format, mip_width, mip_height, 1);

The order of cubemap-faces is in a mip-level data chunk is:

[0] => +X [1] => -X [2] => +Y [3] => -Y [4] => +Z [5] => -Z

extern (C)
struct ImageData {}

Members

Variables

mip_levels
Range[16] mip_levels;
Undocumented in source.

Meta