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

Function ImFontAtlasTextureBlockCopy

src/imgui/imgui_draw.cpp:2929–2939  ·  view source on GitHub ↗

Copy block from one texture to another

Source from the content-addressed store, hash-verified

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)
2930{
2931 IM_ASSERT(src_tex->Pixels != NULL && dst_tex->Pixels != NULL);
2932 IM_ASSERT(src_tex->Format == dst_tex->Format);
2933 IM_ASSERT(src_x >= 0 && src_x + w <= src_tex->Width);
2934 IM_ASSERT(src_y >= 0 && src_y + h <= src_tex->Height);
2935 IM_ASSERT(dst_x >= 0 && dst_x + w <= dst_tex->Width);
2936 IM_ASSERT(dst_y >= 0 && dst_y + h <= dst_tex->Height);
2937 for (int y = 0; y < h; y++)
2938 memcpy(dst_tex->GetPixelsAt(dst_x, dst_y + y), src_tex->GetPixelsAt(src_x, src_y + y), w * dst_tex->BytesPerPixel);
2939}
2940
2941// Queue texture block update for renderer backend
2942void ImFontAtlasTextureBlockQueueUpload(ImFontAtlas* atlas, ImTextureData* tex, int x, int y, int w, int h)

Calls 1

GetPixelsAtMethod · 0.80

Tested by

no test coverage detected