openMSX
Classes | Macros | Enumerations | Functions | Variables
imgui_draw.cc File Reference
#include "imgui.h"
#include "imgui_internal.h"
#include "misc/freetype/imgui_freetype.h"
#include <stdio.h>
#include "imstb_rectpack.h"
Include dependency graph for imgui_draw.cc:

Go to the source code of this file.

Classes

struct  ImTriangulatorNode
 
struct  ImTriangulatorNodeSpan
 
struct  ImTriangulator
 

Macros

#define IMGUI_DEFINE_MATH_OPERATORS
 
#define STBRP_STATIC
 
#define STBRP_ASSERT(x)   do { IM_ASSERT(x); } while (0)
 
#define STBRP_SORT   ImQsort
 
#define STB_RECT_PACK_IMPLEMENTATION
 
#define ImDrawCmd_HeaderSize   (offsetof(ImDrawCmd, VtxOffset) + sizeof(unsigned int))
 
#define ImDrawCmd_HeaderCompare(CMD_LHS, CMD_RHS)   (memcmp(CMD_LHS, CMD_RHS, ImDrawCmd_HeaderSize))
 
#define ImDrawCmd_HeaderCopy(CMD_DST, CMD_SRC)   (memcpy(CMD_DST, CMD_SRC, ImDrawCmd_HeaderSize))
 
#define ImDrawCmd_AreSequentialIdxOffset(CMD_0, CMD_1)   (CMD_0->IdxOffset + CMD_0->ElemCount == CMD_1->IdxOffset)
 
#define IM_NORMALIZE2F_OVER_ZERO(VX, VY)   { float d2 = VX*VX + VY*VY; if (d2 > 0.0f) { float inv_len = ImRsqrt(d2); VX *= inv_len; VY *= inv_len; } } (void)0
 
#define IM_FIXNORMAL2F_MAX_INVLEN2   100.0f
 
#define IM_FIXNORMAL2F(VX, VY)   { float d2 = VX*VX + VY*VY; if (d2 > 0.000001f) { float inv_len2 = 1.0f / d2; if (inv_len2 > IM_FIXNORMAL2F_MAX_INVLEN2) inv_len2 = IM_FIXNORMAL2F_MAX_INVLEN2; VX *= inv_len2; VY *= inv_len2; } } (void)0
 
#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))
 

Enumerations

enum  ImTriangulatorNodeType { ImTriangulatorNodeType_Convex , ImTriangulatorNodeType_Ear , ImTriangulatorNodeType_Reflex }
 

Functions

ImVec2 ImBezierCubicCalc (const ImVec2 &p1, const ImVec2 &p2, const ImVec2 &p3, const ImVec2 &p4, float t)
 
ImVec2 ImBezierQuadraticCalc (const ImVec2 &p1, const ImVec2 &p2, const ImVec2 &p3, float t)
 
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 ImFontAtlasUpdateConfigDataPointers (ImFontAtlas *atlas)
 
void ImFontAtlasBuildSetupFont (ImFontAtlas *atlas, ImFont *font, ImFontConfig *font_config, float ascent, float descent)
 
void ImFontAtlasBuildPackCustomRects (ImFontAtlas *atlas, void *stbrp_context_opaque)
 
void 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)
 
void 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)
 
void ImFontAtlasBuildInit (ImFontAtlas *atlas)
 
void ImFontAtlasBuildFinish (ImFontAtlas *atlas)
 

Variables

const int FONT_ATLAS_DEFAULT_TEX_DATA_W = 122
 
const int FONT_ATLAS_DEFAULT_TEX_DATA_H = 27
 

Macro Definition Documentation

◆ IM_FIXNORMAL2F

#define IM_FIXNORMAL2F (   VX,
  VY 
)    { float d2 = VX*VX + VY*VY; if (d2 > 0.000001f) { float inv_len2 = 1.0f / d2; if (inv_len2 > IM_FIXNORMAL2F_MAX_INVLEN2) inv_len2 = IM_FIXNORMAL2F_MAX_INVLEN2; VX *= inv_len2; VY *= inv_len2; } } (void)0

Definition at line 750 of file imgui_draw.cc.

◆ IM_FIXNORMAL2F_MAX_INVLEN2

#define IM_FIXNORMAL2F_MAX_INVLEN2   100.0f

Definition at line 749 of file imgui_draw.cc.

◆ IM_NORMALIZE2F_OVER_ZERO

#define IM_NORMALIZE2F_OVER_ZERO (   VX,
  VY 
)    { float d2 = VX*VX + VY*VY; if (d2 > 0.0f) { float inv_len = ImRsqrt(d2); VX *= inv_len; VY *= inv_len; } } (void)0

Definition at line 748 of file imgui_draw.cc.

◆ ImDrawCmd_AreSequentialIdxOffset

#define ImDrawCmd_AreSequentialIdxOffset (   CMD_0,
  CMD_1 
)    (CMD_0->IdxOffset + CMD_0->ElemCount == CMD_1->IdxOffset)

Definition at line 519 of file imgui_draw.cc.

◆ ImDrawCmd_HeaderCompare

#define ImDrawCmd_HeaderCompare (   CMD_LHS,
  CMD_RHS 
)    (memcmp(CMD_LHS, CMD_RHS, ImDrawCmd_HeaderSize))

Definition at line 517 of file imgui_draw.cc.

◆ ImDrawCmd_HeaderCopy

#define ImDrawCmd_HeaderCopy (   CMD_DST,
  CMD_SRC 
)    (memcpy(CMD_DST, CMD_SRC, ImDrawCmd_HeaderSize))

Definition at line 518 of file imgui_draw.cc.

◆ ImDrawCmd_HeaderSize

#define ImDrawCmd_HeaderSize   (offsetof(ImDrawCmd, VtxOffset) + sizeof(unsigned int))

Definition at line 516 of file imgui_draw.cc.

◆ IMGUI_DEFINE_MATH_OPERATORS

#define IMGUI_DEFINE_MATH_OPERATORS

Definition at line 31 of file imgui_draw.cc.

◆ stb__in2

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

Definition at line 4504 of file imgui_draw.cc.

◆ stb__in3

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

Definition at line 4505 of file imgui_draw.cc.

◆ stb__in4

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

Definition at line 4506 of file imgui_draw.cc.

◆ STB_RECT_PACK_IMPLEMENTATION

#define STB_RECT_PACK_IMPLEMENTATION

Definition at line 121 of file imgui_draw.cc.

◆ STBRP_ASSERT

#define STBRP_ASSERT (   x)    do { IM_ASSERT(x); } while (0)

Definition at line 119 of file imgui_draw.cc.

◆ STBRP_SORT

#define STBRP_SORT   ImQsort

Definition at line 120 of file imgui_draw.cc.

◆ STBRP_STATIC

#define STBRP_STATIC

Definition at line 118 of file imgui_draw.cc.

Enumeration Type Documentation

◆ ImTriangulatorNodeType

Enumerator
ImTriangulatorNodeType_Convex 
ImTriangulatorNodeType_Ear 
ImTriangulatorNodeType_Reflex 

Definition at line 1759 of file imgui_draw.cc.

Function Documentation

◆ ImBezierCubicCalc()

ImVec2 ImBezierCubicCalc ( const ImVec2 &  p1,
const ImVec2 &  p2,
const ImVec2 &  p3,
const ImVec2 &  p4,
float  t 
)

Definition at line 1285 of file imgui_draw.cc.

References p3, p4, t, w3, and w4.

Referenced by ImBezierCubicClosestPoint().

◆ ImBezierQuadraticCalc()

ImVec2 ImBezierQuadraticCalc ( const ImVec2 &  p1,
const ImVec2 &  p2,
const ImVec2 &  p3,
float  t 
)

Definition at line 1295 of file imgui_draw.cc.

References p3, t, and w3.

◆ ImFontAtlasBuildFinish()

void ImFontAtlasBuildFinish ( ImFontAtlas *  atlas)

Definition at line 3275 of file imgui_draw.cc.

Referenced by ImFontAtlasBuildWithFreeTypeEx().

◆ ImFontAtlasBuildInit()

void ImFontAtlasBuildInit ( ImFontAtlas *  atlas)

◆ ImFontAtlasBuildMultiplyCalcLookupTable()

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

Definition at line 2749 of file imgui_draw.cc.

Referenced by ImFontAtlasBuildWithFreeTypeEx().

◆ ImFontAtlasBuildMultiplyRectAlpha8()

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

Definition at line 2758 of file imgui_draw.cc.

◆ ImFontAtlasBuildPackCustomRects()

void ImFontAtlasBuildPackCustomRects ( ImFontAtlas *  atlas,
void *  stbrp_context_opaque 
)

Definition at line 3105 of file imgui_draw.cc.

Referenced by ImFontAtlasBuildWithFreeTypeEx().

◆ ImFontAtlasBuildRender32bppRectFromString()

void 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 
)

Definition at line 3145 of file imgui_draw.cc.

◆ ImFontAtlasBuildRender8bppRectFromString()

void 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 
)

Definition at line 3135 of file imgui_draw.cc.

◆ ImFontAtlasBuildSetupFont()

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

Definition at line 3092 of file imgui_draw.cc.

Referenced by ImFontAtlasBuildWithFreeTypeEx().

◆ ImFontAtlasUpdateConfigDataPointers()

void ImFontAtlasUpdateConfigDataPointers ( ImFontAtlas *  atlas)

Definition at line 3078 of file imgui_draw.cc.

Variable Documentation

◆ FONT_ATLAS_DEFAULT_TEX_DATA_H

const int FONT_ATLAS_DEFAULT_TEX_DATA_H = 27

Definition at line 2385 of file imgui_draw.cc.

Referenced by ImFontAtlasBuildInit().

◆ FONT_ATLAS_DEFAULT_TEX_DATA_W

const int FONT_ATLAS_DEFAULT_TEX_DATA_W = 122

Definition at line 2384 of file imgui_draw.cc.

Referenced by ImFontAtlasBuildInit().