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

Function GetTexDataAsFormat

src/imgui/imgui_draw.cpp:2970–2983  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2968
2969#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
2970static void GetTexDataAsFormat(ImFontAtlas* atlas, ImTextureFormat format, unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel)
2971{
2972 ImTextureData* tex = atlas->TexData;
2973 if (!atlas->TexIsBuilt || tex == NULL || tex->Pixels == NULL || atlas->TexDesiredFormat != format)
2974 {
2975 atlas->TexDesiredFormat = format;
2976 atlas->Build();
2977 tex = atlas->TexData;
2978 }
2979 if (out_pixels) { *out_pixels = (unsigned char*)tex->Pixels; };
2980 if (out_width) { *out_width = tex->Width; };
2981 if (out_height) { *out_height = tex->Height; };
2982 if (out_bytes_per_pixel) { *out_bytes_per_pixel = tex->BytesPerPixel; }
2983}
2984
2985void ImFontAtlas::GetTexDataAsAlpha8(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel)
2986{

Callers 2

GetTexDataAsAlpha8Method · 0.85
GetTexDataAsRGBA32Method · 0.85

Calls 1

BuildMethod · 0.45

Tested by

no test coverage detected