MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / ImFontAtlasBuildRender8bppRectFromString

Function ImFontAtlasBuildRender8bppRectFromString

KBotExt/imgui/imgui_draw.cpp:2699–2707  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2697}
2698
2699void ImFontAtlasBuildRender8bppRectFromString(ImFontAtlas* atlas, int x, int y, int w, int h, const char* in_str, char in_marker_char, unsigned char in_marker_pixel_value)
2700{
2701 IM_ASSERT(x >= 0 && x + w <= atlas->TexWidth);
2702 IM_ASSERT(y >= 0 && y + h <= atlas->TexHeight);
2703 unsigned char* out_pixel = atlas->TexPixelsAlpha8 + x + (y * atlas->TexWidth);
2704 for (int off_y = 0; off_y < h; off_y++, out_pixel += atlas->TexWidth, in_str += w)
2705 for (int off_x = 0; off_x < w; off_x++)
2706 out_pixel[off_x] = (in_str[off_x] == in_marker_char) ? in_marker_pixel_value : 0x00;
2707}
2708
2709void ImFontAtlasBuildRender32bppRectFromString(ImFontAtlas* atlas, int x, int y, int w, int h, const char* in_str, char in_marker_char, unsigned int in_marker_pixel_value)
2710{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected