Copy block from one texture to another
| 2927 | |
| 2928 | // Copy block from one texture to another |
| 2929 | void 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 |
| 2942 | void ImFontAtlasTextureBlockQueueUpload(ImFontAtlas* atlas, ImTextureData* tex, int x, int y, int w, int h) |
no test coverage detected