MCPcopy Create free account
hub / github.com/cinder/Cinder / ImFontAtlasTextureBlockFill

Function ImFontAtlasTextureBlockFill

src/imgui/imgui_draw.cpp:2909–2926  ·  view source on GitHub ↗

Fill with single color. We don't use this directly but it is convenient for anyone working on uploading custom rects.

Source from the content-addressed store, hash-verified

2907
2908// Fill with single color. We don't use this directly but it is convenient for anyone working on uploading custom rects.
2909void ImFontAtlasTextureBlockFill(ImTextureData* dst_tex, int dst_x, int dst_y, int w, int h, ImU32 col)
2910{
2911 if (dst_tex->Format == ImTextureFormat_Alpha8)
2912 {
2913 ImU8 col_a = (col >> IM_COL32_A_SHIFT) & 0xFF;
2914 for (int y = 0; y < h; y++)
2915 memset((ImU8*)dst_tex->GetPixelsAt(dst_x, dst_y + y), col_a, w);
2916 }
2917 else
2918 {
2919 for (int y = 0; y < h; y++)
2920 {
2921 ImU32* p = (ImU32*)(void*)dst_tex->GetPixelsAt(dst_x, dst_y + y);
2922 for (int x = w; x > 0; x--, p++)
2923 *p = col;
2924 }
2925 }
2926}
2927
2928// Copy block from one texture to another
2929void ImFontAtlasTextureBlockCopy(ImTextureData* src_tex, int src_x, int src_y, ImTextureData* dst_tex, int dst_x, int dst_y, int w, int h)

Callers

nothing calls this directly

Calls 1

GetPixelsAtMethod · 0.80

Tested by

no test coverage detected