Classes | Macros | Functions | Variables
imgui_draw.cpp File Reference
#include "imgui.h"
#include "imgui_internal.h"
#include <stdio.h>
#include <stdlib.h>
#include "imstb_rectpack.h"
#include "imstb_truetype.h"
Include dependency graph for imgui_draw.cpp:

Go to the source code of this file.

Classes

struct  ImFontBuildDstData
 
struct  ImFontBuildSrcData
 

Macros

#define GetCurrentClipRect()   (_ClipRectStack.Size ? _ClipRectStack.Data[_ClipRectStack.Size-1] : _Data->ClipRectFullscreen)
 
#define GetCurrentTextureId()   (_TextureIdStack.Size ? _TextureIdStack.Data[_TextureIdStack.Size-1] : (ImTextureID)NULL)
 
#define IM_FIXNORMAL2F(VX, VY)   do { float d2 = VX*VX + VY*VY; if (d2 < 0.5f) d2 = 0.5f; float inv_lensq = 1.0f / d2; VX *= inv_lensq; VY *= inv_lensq; } while (0)
 
#define IM_NORMALIZE2F_OVER_ZERO(VX, VY)   do { float d2 = VX*VX + VY*VY; if (d2 > 0.0f) { float inv_len = 1.0f / ImSqrt(d2); VX *= inv_len; VY *= inv_len; } } while (0)
 
#define IMGUI_DEFINE_MATH_OPERATORS
 
#define stb__in2(x)   ((i[x] << 8) + i[(x)+1])
 
#define stb__in3(x)   ((i[x] << 16) + stb__in2((x)+1))
 
#define stb__in4(x)   ((i[x] << 24) + stb__in3((x)+1))
 
#define STB_RECT_PACK_IMPLEMENTATION
 
#define STB_TRUETYPE_IMPLEMENTATION
 
#define STBRP_ASSERT(x)   IM_ASSERT(x)
 
#define STBRP_SORT   ImQsort
 
#define STBRP_STATIC
 
#define STBTT_assert(x)   IM_ASSERT(x)
 
#define STBTT_fabs(x)   ImFabs(x)
 
#define STBTT_fmod(x, y)   ImFmod(x,y)
 
#define STBTT_free(x, u)   ((void)(u), IM_FREE(x))
 
#define STBTT_iceil(x)   ((int)ImCeil(x))
 
#define STBTT_ifloor(x)   ((int)ImFloorStd(x))
 
#define STBTT_malloc(x, u)   ((void)(u), IM_ALLOC(x))
 
#define STBTT_pow(x, y)   ImPow(x,y)
 
#define STBTT_sqrt(x)   ImSqrt(x)
 
#define STBTT_STATIC
 

Functions

static bool CanMergeDrawCommands (ImDrawCmd *a, ImDrawCmd *b)
 
static void Decode85 (const unsigned char *src, unsigned char *dst)
 
static unsigned int Decode85Byte (char c)
 
static const char * GetDefaultCompressedFontDataTTFBase85 ()
 
static float ImAcos01 (float x)
 
ImVec2 ImBezierCalc (const ImVec2 &p1, const ImVec2 &p2, const ImVec2 &p3, const ImVec2 &p4, float t)
 
void ImFontAtlasBuildFinish (ImFontAtlas *atlas)
 
void ImFontAtlasBuildInit (ImFontAtlas *atlas)
 
void ImFontAtlasBuildMultiplyCalcLookupTable (unsigned char out_table[256], float in_brighten_factor)
 
void ImFontAtlasBuildMultiplyRectAlpha8 (const unsigned char table[256], unsigned char *pixels, int x, int y, int w, int h, int stride)
 
void ImFontAtlasBuildPackCustomRects (ImFontAtlas *atlas, void *stbrp_context_opaque)
 
static void ImFontAtlasBuildRenderDefaultTexData (ImFontAtlas *atlas)
 
void ImFontAtlasBuildSetupFont (ImFontAtlas *atlas, ImFont *font, ImFontConfig *font_config, float ascent, float descent)
 
bool ImFontAtlasBuildWithStbTruetype (ImFontAtlas *atlas)
 
static void PathBezierToCasteljau (ImVector< ImVec2 > *path, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, float tess_tol, int level)
 
static void stb__lit (const unsigned char *data, unsigned int length)
 
static void stb__match (const unsigned char *data, unsigned int length)
 
static unsigned int stb_adler32 (unsigned int adler32, unsigned char *buffer, unsigned int buflen)
 
static unsigned int stb_decompress (unsigned char *output, const unsigned char *input, unsigned int length)
 
static unsigned int stb_decompress_length (const unsigned char *input)
 
static const unsigned char * stb_decompress_token (const unsigned char *i)
 
static void UnpackAccumulativeOffsetsIntoRanges (int base_codepoint, const short *accumulative_offsets, int accumulative_offsets_count, ImWchar *out_ranges)
 
static void UnpackBitVectorToFlatIndexList (const ImBitVector *in, ImVector< int > *out)
 

Variables

static const ImVec2 FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA [ImGuiMouseCursor_COUNT][3]
 
const int FONT_ATLAS_DEFAULT_TEX_DATA_H = 27
 
const unsigned int FONT_ATLAS_DEFAULT_TEX_DATA_ID = 0x80000000
 
static const char FONT_ATLAS_DEFAULT_TEX_DATA_PIXELS [FONT_ATLAS_DEFAULT_TEX_DATA_W_HALF *FONT_ATLAS_DEFAULT_TEX_DATA_H+1]
 
const int FONT_ATLAS_DEFAULT_TEX_DATA_W_HALF = 108
 
static const char proggy_clean_ttf_compressed_data_base85 [11980+1]
 
static const unsigned char * stb__barrier_in_b
 
static unsigned char * stb__barrier_out_b
 
static unsigned char * stb__barrier_out_e
 
static unsigned char * stb__dout
 

Macro Definition Documentation

◆ GetCurrentClipRect

#define GetCurrentClipRect ( )    (_ClipRectStack.Size ? _ClipRectStack.Data[_ClipRectStack.Size-1] : _Data->ClipRectFullscreen)

Definition at line 420 of file imgui_draw.cpp.

◆ GetCurrentTextureId

#define GetCurrentTextureId ( )    (_TextureIdStack.Size ? _TextureIdStack.Data[_TextureIdStack.Size-1] : (ImTextureID)NULL)

Definition at line 421 of file imgui_draw.cpp.

◆ IM_FIXNORMAL2F

#define IM_FIXNORMAL2F (   VX,
  VY 
)    do { float d2 = VX*VX + VY*VY; if (d2 < 0.5f) d2 = 0.5f; float inv_lensq = 1.0f / d2; VX *= inv_lensq; VY *= inv_lensq; } while (0)

Definition at line 621 of file imgui_draw.cpp.

◆ IM_NORMALIZE2F_OVER_ZERO

#define IM_NORMALIZE2F_OVER_ZERO (   VX,
  VY 
)    do { float d2 = VX*VX + VY*VY; if (d2 > 0.0f) { float inv_len = 1.0f / ImSqrt(d2); VX *= inv_len; VY *= inv_len; } } while (0)

Definition at line 620 of file imgui_draw.cpp.

◆ IMGUI_DEFINE_MATH_OPERATORS

#define IMGUI_DEFINE_MATH_OPERATORS

Definition at line 33 of file imgui_draw.cpp.

◆ stb__in2

#define stb__in2 (   x)    ((i[x] << 8) + i[(x)+1])

Definition at line 3405 of file imgui_draw.cpp.

◆ stb__in3

#define stb__in3 (   x)    ((i[x] << 16) + stb__in2((x)+1))

Definition at line 3406 of file imgui_draw.cpp.

◆ stb__in4

#define stb__in4 (   x)    ((i[x] << 24) + stb__in3((x)+1))

Definition at line 3407 of file imgui_draw.cpp.

◆ STB_RECT_PACK_IMPLEMENTATION

#define STB_RECT_PACK_IMPLEMENTATION

Definition at line 125 of file imgui_draw.cpp.

◆ STB_TRUETYPE_IMPLEMENTATION

#define STB_TRUETYPE_IMPLEMENTATION

Definition at line 146 of file imgui_draw.cpp.

◆ STBRP_ASSERT

#define STBRP_ASSERT (   x)    IM_ASSERT(x)

Definition at line 123 of file imgui_draw.cpp.

◆ STBRP_SORT

#define STBRP_SORT   ImQsort

Definition at line 124 of file imgui_draw.cpp.

◆ STBRP_STATIC

#define STBRP_STATIC

Definition at line 122 of file imgui_draw.cpp.

◆ STBTT_assert

#define STBTT_assert (   x)    IM_ASSERT(x)

Definition at line 138 of file imgui_draw.cpp.

◆ STBTT_fabs

#define STBTT_fabs (   x)    ImFabs(x)

Definition at line 142 of file imgui_draw.cpp.

◆ STBTT_fmod

#define STBTT_fmod (   x,
  y 
)    ImFmod(x,y)

Definition at line 139 of file imgui_draw.cpp.

◆ STBTT_free

#define STBTT_free (   x,
 
)    ((void)(u), IM_FREE(x))

Definition at line 137 of file imgui_draw.cpp.

◆ STBTT_iceil

#define STBTT_iceil (   x)    ((int)ImCeil(x))

Definition at line 144 of file imgui_draw.cpp.

◆ STBTT_ifloor

#define STBTT_ifloor (   x)    ((int)ImFloorStd(x))

Definition at line 143 of file imgui_draw.cpp.

◆ STBTT_malloc

#define STBTT_malloc (   x,
 
)    ((void)(u), IM_ALLOC(x))

Definition at line 136 of file imgui_draw.cpp.

◆ STBTT_pow

#define STBTT_pow (   x,
  y 
)    ImPow(x,y)

Definition at line 141 of file imgui_draw.cpp.

◆ STBTT_sqrt

#define STBTT_sqrt (   x)    ImSqrt(x)

Definition at line 140 of file imgui_draw.cpp.

◆ STBTT_STATIC

#define STBTT_STATIC

Definition at line 145 of file imgui_draw.cpp.

Function Documentation

◆ CanMergeDrawCommands()

static bool CanMergeDrawCommands ( ImDrawCmd a,
ImDrawCmd b 
)
inlinestatic

Definition at line 1351 of file imgui_draw.cpp.

◆ Decode85()

static void Decode85 ( const unsigned char *  src,
unsigned char *  dst 
)
static

Definition at line 1739 of file imgui_draw.cpp.

◆ Decode85Byte()

static unsigned int Decode85Byte ( char  c)
static

Definition at line 1738 of file imgui_draw.cpp.

◆ GetDefaultCompressedFontDataTTFBase85()

static const char * GetDefaultCompressedFontDataTTFBase85 ( )
static

Definition at line 3589 of file imgui_draw.cpp.

◆ ImAcos01()

static float ImAcos01 ( float  x)
inlinestatic

Definition at line 3264 of file imgui_draw.cpp.

◆ ImBezierCalc()

ImVec2 ImBezierCalc ( const ImVec2 p1,
const ImVec2 p2,
const ImVec2 p3,
const ImVec2 p4,
float  t 
)

Definition at line 935 of file imgui_draw.cpp.

◆ ImFontAtlasBuildFinish()

void ImFontAtlasBuildFinish ( ImFontAtlas atlas)

Definition at line 2288 of file imgui_draw.cpp.

◆ ImFontAtlasBuildInit()

void ImFontAtlasBuildInit ( ImFontAtlas atlas)

Definition at line 2206 of file imgui_draw.cpp.

◆ ImFontAtlasBuildMultiplyCalcLookupTable()

void ImFontAtlasBuildMultiplyCalcLookupTable ( unsigned char  out_table[256],
float  in_brighten_factor 
)

Definition at line 1895 of file imgui_draw.cpp.

◆ ImFontAtlasBuildMultiplyRectAlpha8()

void ImFontAtlasBuildMultiplyRectAlpha8 ( const unsigned char  table[256],
unsigned char *  pixels,
int  x,
int  y,
int  w,
int  h,
int  stride 
)

Definition at line 1904 of file imgui_draw.cpp.

◆ ImFontAtlasBuildPackCustomRects()

void ImFontAtlasBuildPackCustomRects ( ImFontAtlas atlas,
void stbrp_context_opaque 
)

Definition at line 2230 of file imgui_draw.cpp.

◆ ImFontAtlasBuildRenderDefaultTexData()

static void ImFontAtlasBuildRenderDefaultTexData ( ImFontAtlas atlas)
static

Definition at line 2257 of file imgui_draw.cpp.

◆ ImFontAtlasBuildSetupFont()

void ImFontAtlasBuildSetupFont ( ImFontAtlas atlas,
ImFont font,
ImFontConfig font_config,
float  ascent,
float  descent 
)

Definition at line 2216 of file imgui_draw.cpp.

◆ ImFontAtlasBuildWithStbTruetype()

bool ImFontAtlasBuildWithStbTruetype ( ImFontAtlas atlas)

Definition at line 1949 of file imgui_draw.cpp.

◆ PathBezierToCasteljau()

static void PathBezierToCasteljau ( ImVector< ImVec2 > *  path,
float  x1,
float  y1,
float  x2,
float  y2,
float  x3,
float  y3,
float  x4,
float  y4,
float  tess_tol,
int  level 
)
static

Definition at line 946 of file imgui_draw.cpp.

◆ stb__lit()

static void stb__lit ( const unsigned char *  data,
unsigned int  length 
)
static

Definition at line 3396 of file imgui_draw.cpp.

◆ stb__match()

static void stb__match ( const unsigned char *  data,
unsigned int  length 
)
static

Definition at line 3387 of file imgui_draw.cpp.

◆ stb_adler32()

static unsigned int stb_adler32 ( unsigned int  adler32,
unsigned char *  buffer,
unsigned int  buflen 
)
static

Definition at line 3426 of file imgui_draw.cpp.

◆ stb_decompress()

static unsigned int stb_decompress ( unsigned char *  output,
const unsigned char *  input,
unsigned int  length 
)
static

Definition at line 3457 of file imgui_draw.cpp.

◆ stb_decompress_length()

static unsigned int stb_decompress_length ( const unsigned char *  input)
static

Definition at line 3379 of file imgui_draw.cpp.

◆ stb_decompress_token()

static const unsigned char* stb_decompress_token ( const unsigned char *  i)
static

Definition at line 3409 of file imgui_draw.cpp.

◆ UnpackAccumulativeOffsetsIntoRanges()

static void UnpackAccumulativeOffsetsIntoRanges ( int  base_codepoint,
const short *  accumulative_offsets,
int  accumulative_offsets_count,
ImWchar out_ranges 
)
static

Definition at line 2367 of file imgui_draw.cpp.

◆ UnpackBitVectorToFlatIndexList()

static void UnpackBitVectorToFlatIndexList ( const ImBitVector in,
ImVector< int > *  out 
)
static

Definition at line 1937 of file imgui_draw.cpp.

Variable Documentation

◆ FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA

const ImVec2 FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[ImGuiMouseCursor_COUNT][3]
static
Initial value:
=
{
{ ImVec2( 0,3), ImVec2(12,19), ImVec2( 0, 0) },
{ ImVec2(13,0), ImVec2( 7,16), ImVec2( 1, 8) },
{ ImVec2(31,0), ImVec2(23,23), ImVec2(11,11) },
{ ImVec2(21,0), ImVec2( 9,23), ImVec2( 4,11) },
{ ImVec2(55,18),ImVec2(23, 9), ImVec2(11, 4) },
{ ImVec2(73,0), ImVec2(17,17), ImVec2( 8, 8) },
{ ImVec2(55,0), ImVec2(17,17), ImVec2( 8, 8) },
{ ImVec2(91,0), ImVec2(17,22), ImVec2( 5, 0) },
}

Definition at line 1578 of file imgui_draw.cpp.

◆ FONT_ATLAS_DEFAULT_TEX_DATA_H

const int FONT_ATLAS_DEFAULT_TEX_DATA_H = 27

Definition at line 1545 of file imgui_draw.cpp.

◆ FONT_ATLAS_DEFAULT_TEX_DATA_ID

const unsigned int FONT_ATLAS_DEFAULT_TEX_DATA_ID = 0x80000000

Definition at line 1546 of file imgui_draw.cpp.

◆ FONT_ATLAS_DEFAULT_TEX_DATA_PIXELS

const char FONT_ATLAS_DEFAULT_TEX_DATA_PIXELS[FONT_ATLAS_DEFAULT_TEX_DATA_W_HALF *FONT_ATLAS_DEFAULT_TEX_DATA_H+1]
static
Initial value:
=
{
"..- -XXXXXXX- X - X -XXXXXXX - XXXXXXX- XX "
"..- -X.....X- X.X - X.X -X.....X - X.....X- X..X "
"--- -XXX.XXX- X...X - X...X -X....X - X....X- X..X "
"X - X.X - X.....X - X.....X -X...X - X...X- X..X "
"XX - X.X -X.......X- X.......X -X..X.X - X.X..X- X..X "
"X.X - X.X -XXXX.XXXX- XXXX.XXXX -X.X X.X - X.X X.X- X..XXX "
"X..X - X.X - X.X - X.X -XX X.X - X.X XX- X..X..XXX "
"X...X - X.X - X.X - XX X.X XX - X.X - X.X - X..X..X..XX "
"X....X - X.X - X.X - X.X X.X X.X - X.X - X.X - X..X..X..X.X "
"X.....X - X.X - X.X - X..X X.X X..X - X.X - X.X -XXX X..X..X..X..X"
"X......X - X.X - X.X - X...XXXXXX.XXXXXX...X - X.X XX-XX X.X -X..XX........X..X"
"X.......X - X.X - X.X -X.....................X- X.X X.X-X.X X.X -X...X...........X"
"X........X - X.X - X.X - X...XXXXXX.XXXXXX...X - X.X..X-X..X.X - X..............X"
"X.........X -XXX.XXX- X.X - X..X X.X X..X - X...X-X...X - X.............X"
"X..........X-X.....X- X.X - X.X X.X X.X - X....X-X....X - X.............X"
"X......XXXXX-XXXXXXX- X.X - XX X.X XX - X.....X-X.....X - X............X"
"X...X..X --------- X.X - X.X - XXXXXXX-XXXXXXX - X...........X "
"X..X X..X - -XXXX.XXXX- XXXX.XXXX ------------------------------------- X..........X "
"X.X X..X - -X.......X- X.......X - XX XX - - X..........X "
"XX X..X - - X.....X - X.....X - X.X X.X - - X........X "
" X..X - X...X - X...X - X..X X..X - - X........X "
" XX - X.X - X.X - X...XXXXXXXXXXXXX...X - - XXXXXXXXXX "
"------------ - X - X -X.....................X- ------------------"
" ----------------------------------- X...XXXXXXXXXXXXX...X - "
" - X..X X..X - "
" - X.X X.X - "
" - XX XX - "
}

Definition at line 1547 of file imgui_draw.cpp.

◆ FONT_ATLAS_DEFAULT_TEX_DATA_W_HALF

const int FONT_ATLAS_DEFAULT_TEX_DATA_W_HALF = 108

Definition at line 1544 of file imgui_draw.cpp.

◆ proggy_clean_ttf_compressed_data_base85

const char proggy_clean_ttf_compressed_data_base85[11980+1]
static

Definition at line 3501 of file imgui_draw.cpp.

◆ stb__barrier_in_b

const unsigned char* stb__barrier_in_b
static

Definition at line 3385 of file imgui_draw.cpp.

◆ stb__barrier_out_b

unsigned char * stb__barrier_out_b
static

Definition at line 3384 of file imgui_draw.cpp.

◆ stb__barrier_out_e

unsigned char* stb__barrier_out_e
static

Definition at line 3384 of file imgui_draw.cpp.

◆ stb__dout

unsigned char* stb__dout
static

Definition at line 3386 of file imgui_draw.cpp.

ImVec2
Definition: imgui.h:208


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:03