MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / ImFontAtlasTextureBlockFill

Function ImFontAtlasTextureBlockFill

imgui_tiny_app/imgui/imgui_draw.cpp:2938–2955  ·  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

2936
2937// Fill with single color. We don't use this directly but it is convenient for anyone working on uploading custom rects.
2938void ImFontAtlasTextureBlockFill(ImTextureData* dst_tex, int dst_x, int dst_y, int w, int h, ImU32 col)
2939{
2940 if (dst_tex->Format == ImTextureFormat_Alpha8)
2941 {
2942 ImU8 col_a = (col >> IM_COL32_A_SHIFT) & 0xFF;
2943 for (int y = 0; y < h; y++)
2944 memset((ImU8*)dst_tex->GetPixelsAt(dst_x, dst_y + y), col_a, w);
2945 }
2946 else
2947 {
2948 for (int y = 0; y < h; y++)
2949 {
2950 ImU32* p = (ImU32*)(void*)dst_tex->GetPixelsAt(dst_x, dst_y + y);
2951 for (int x = w; x > 0; x--, p++)
2952 *p = col;
2953 }
2954 }
2955}
2956
2957// Copy block from one texture to another
2958void 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