Simp module

Bitmap

structSource

Pixels in memory, before or after they are on the graphics card. stride is the bytes between rows. bitmap_alloc makes one, bitmap_load reads one from a file, and deinit frees it.

Example↗
bitmap: Bitmap;
bitmap_alloc(*bitmap, 4, 2, .RGBA8);
defer deinit(*bitmap);
assert(bitmap.stride == 16 && bitmap.data.count == 32);

Fields

width: s32
height: s32
mipmap_count: s32
data: [] u8
stride: s32
flags: enum_flags u32 { FREE_DATA_ON_DEINIT :: 0x1; IS_SRGB :: 0x2; }
format: := Texture_Format.BGRA8

See also