MCPcopy Create free account
hub / github.com/Wemino/MarkerPatch / ImFontAtlasTextureBlockFill

Function ImFontAtlasTextureBlockFill

include/imgui/imgui_draw.cpp:2952–2969  ·  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

2950
2951// Fill with single color. We don't use this directly but it is convenient for anyone working on uploading custom rects.
2952void ImFontAtlasTextureBlockFill(ImTextureData* dst_tex, int dst_x, int dst_y, int w, int h, ImU32 col)
2953{
2954 if (dst_tex->Format == ImTextureFormat_Alpha8)
2955 {
2956 ImU8 col_a = (col >> IM_COL32_A_SHIFT) & 0xFF;
2957 for (int y = 0; y < h; y++)
2958 memset((ImU8*)dst_tex->GetPixelsAt(dst_x, dst_y + y), col_a, w);
2959 }
2960 else
2961 {
2962 for (int y = 0; y < h; y++)
2963 {
2964 ImU32* p = (ImU32*)(void*)dst_tex->GetPixelsAt(dst_x, dst_y + y);
2965 for (int x = w; x > 0; x--, p++)
2966 *p = col;
2967 }
2968 }
2969}
2970
2971// Copy block from one texture to another
2972void 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