31#include "RNA_prototypes.hh"
57#include <fmt/format.h>
68 void (*)(
float x,
float y,
float w,
float h,
float alpha,
const uchar mono_rgba[4]);
70#define ICON_TYPE_PREVIEW 0
71#define ICON_TYPE_SVG_COLOR 1
72#define ICON_TYPE_SVG_MONO 2
73#define ICON_TYPE_BUFFER 3
74#define ICON_TYPE_IMBUF 4
75#define ICON_TYPE_VECTOR 5
76#define ICON_TYPE_GEOM 6
77#define ICON_TYPE_EVENT 7
78#define ICON_TYPE_GPLAYER 8
79#define ICON_TYPE_BLANK 9
118# define DEF_ICON(name) {ICON_TYPE_SVG_MONO, 0},
119# define DEF_ICON_COLOR(name) {ICON_TYPE_SVG_COLOR, 0},
120# define DEF_ICON_SCENE(name) {ICON_TYPE_SVG_MONO, TH_ICON_SCENE},
121# define DEF_ICON_COLLECTION(name) {ICON_TYPE_SVG_MONO, TH_ICON_COLLECTION},
122# define DEF_ICON_OBJECT(name) {ICON_TYPE_SVG_MONO, TH_ICON_OBJECT},
123# define DEF_ICON_OBJECT_DATA(name) {ICON_TYPE_SVG_MONO, TH_ICON_OBJECT_DATA},
124# define DEF_ICON_MODIFIER(name) {ICON_TYPE_SVG_MONO, TH_ICON_MODIFIER},
125# define DEF_ICON_SHADING(name) {ICON_TYPE_SVG_MONO, TH_ICON_SHADING},
126# define DEF_ICON_FOLDER(name) {ICON_TYPE_SVG_MONO, TH_ICON_FOLDER},
127# define DEF_ICON_FUND(name) {ICON_TYPE_SVG_MONO, TH_ICON_FUND},
128# define DEF_ICON_VECTOR(name) {ICON_TYPE_VECTOR, 0},
129# define DEF_ICON_BLANK(name) {ICON_TYPE_BLANK, 0},
136 ImBuf *bbuf,
int icon_id,
int xofs,
int yofs,
int size,
int type,
int theme_color)
140 new_icon->
obj =
nullptr;
161 if (
size == bbuf->
x &&
size == bbuf->
y && xofs == 0 && yofs == 0) {
170 size * 4 *
sizeof(uint8_t));
189 new_icon->
obj =
nullptr;
205 float x,
float y,
float w,
float h,
const float color[4],
float bg_alpha)
208 const float color_bg[4] = {color[0], color[1], color[2], bg_alpha};
214 float x,
float y,
float w,
float h,
const char *
str,
const uchar mono_rgba[4])
217 const size_t len = strlen(
str);
221 const float pos_x =
x + (
w - width) / 2.0f;
222 const float pos_y =
y + (h - height) / 2.0f;
229 float x,
float y,
float w,
float h,
float alpha,
const uchar mono_rgba[4])
231 const float color[4] = {0.5f, 0.0f, 0.0f, 1.0f * alpha};
233 const char *text =
TIP_(
"R");
238 float x,
float y,
float w,
float h,
float alpha,
const uchar mono_rgba[4])
240 const float color[4] = {0.0f, 0.4f, 0.0f, 1.0f * alpha};
242 const char *text =
TIP_(
"G");
247 float x,
float y,
float w,
float h,
float alpha,
const uchar mono_rgba[4])
249 const float color[4] = {0.0f, 0.0f, 1.0f, 1.0f * alpha};
251 const char *text =
TIP_(
"B");
263 const short handle_type)
274 const float xco =
x + (
w / 2.0f) + 0.5f;
275 const float yco =
y + (h / 2.0f) + 0.5f;
319 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
325 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
331 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
337 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
343 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
349 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
355 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
361 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
367 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
373 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
379 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
385 int socket_type,
float x,
float y,
float w,
float h,
float )
391 const float socket_radius =
w * 0.5f * size_factor;
394 center.x - socket_radius,
395 center.x + socket_radius,
396 center.y - socket_radius,
397 center.y + socket_radius,
400 float color_inner[4];
403 float color_outer[4] = {0.0f, 0.0f, 0.0f, 1.0f};
419 const int a =
x +
w / 3;
420 const int b =
x +
w / 3 * 2;
442# define DEF_ICON_VECTOR_COLORSET_DRAW_NTH(prefix, index) \
443 static void vicon_colorset_draw_##prefix( \
444 float x, float y, float w, float h, float alpha, const uchar * ) \
446 vicon_colorset_draw(index, int(x), int(y), int(w), int(h), alpha); \
470# undef DEF_ICON_VECTOR_COLORSET_DRAW_NTH
473 short color_tag,
float x,
float y,
float w,
float ,
float )
482 ICON_OUTLINER_COLLECTION,
486 collection_color->
color,
491# define DEF_ICON_COLLECTION_COLOR_DRAW(index, color) \
492 static void vicon_collection_color_draw_##index( \
493 float x, float y, float w, float h, float alpha, const uchar * ) \
495 vicon_collection_color_draw(color, x, y, w, h, alpha); \
507# undef DEF_ICON_COLLECTION_COLOR_DRAW
510 short color_tag,
float x,
float y,
float w,
float ,
float )
528# define DEF_ICON_STRIP_COLOR_DRAW(index, color) \
529 static void vicon_strip_color_draw_##index( \
530 float x, float y, float w, float h, float alpha, const uchar * ) \
532 vicon_strip_color_draw(color, x, y, w, h, alpha); \
545# undef DEF_ICON_STRIP_COLOR_DRAW
547# define ICON_INDIRECT_DATA_ALPHA 0.6f
550 float x,
float y,
float w,
float ,
float alpha,
const uchar * )
556 ICON_LIBRARY_DATA_DIRECT,
566 float x,
float y,
float w,
float ,
float alpha,
const uchar * )
572 ICON_LIBRARY_DATA_OVERRIDE,
582 short color_tag,
float x,
float y,
float w,
float ,
float )
591 ICON_GREASEPENCIL_LAYER_GROUP,
595 layergroup_color->
color,
600# define DEF_ICON_LAYERGROUP_COLOR_DRAW(index, color) \
601 static void vicon_layergroup_color_draw_##index( \
602 float x, float y, float w, float h, float alpha, const uchar * ) \
604 vicon_layergroup_color_draw(color, x, y, w, h, alpha); \
616# undef DEF_ICON_LAYERGROUP_COLOR_DRAW
618# define DEF_ICON_NODE_SOCKET_DRAW(name, socket_type) \
619 static void icon_node_socket_draw_##name( \
620 float x, float y, float w, float h, float alpha, const uchar * ) \
622 icon_node_socket_draw(socket_type, x, y, w, h, alpha); \
688 return ICON_MOUSE_LMB_2X;
690 return (event_value ==
KM_CLICK_DRAG) ? ICON_MOUSE_LMB_DRAG : ICON_MOUSE_LMB;
693 return (event_value ==
KM_CLICK_DRAG) ? ICON_MOUSE_MMB_DRAG : ICON_MOUSE_MMB;
696 return (event_value ==
KM_CLICK_DRAG) ? ICON_MOUSE_MMB_DRAG : ICON_MOUSE_RMB;
705 memset(r_icon_mod, 0x0,
sizeof(
int[
KM_MOD_NUM]));
708 r_icon_mod[
i++] = ICON_EVENT_CTRL;
711 r_icon_mod[
i++] = ICON_EVENT_ALT;
714 r_icon_mod[
i++] = ICON_EVENT_SHIFT;
717 r_icon_mod[
i++] = ICON_EVENT_OS;
720 r_icon_mod[
i++] = ICON_EVENT_HYPER;
730# define INIT_EVENT_ICON(icon_id, type, value) \
732 DrawInfo *di = def_internal_icon(nullptr, icon_id, 0, 0, w, ICON_TYPE_EVENT, 0); \
733 di->data.input.event_type = type; \
734 di->data.input.event_value = value; \
735 di->data.input.icon = icon_id; \
736 di->data.input.next = di_next; \
918# undef INIT_EVENT_ICON
932 if (bbuf->
x != iimg->
h && bbuf->
y != iimg->
w) {
944 for (
int x = ICON_NONE;
x < ICON_BLANK_LAST_SVG_ITEM;
x++) {
1056 if (di ==
nullptr) {
1082 const int icon_data_type = icon->
obj_type;
1122 if (icon ==
nullptr) {
1132#ifndef WITH_HEADLESS
1158 printf(
"%s, error: requested preview image does not exist", __func__);
1165 prv_img->
w[
size] = render_size;
1166 prv_img->
h[
size] = render_size;
1189 icon->
obj =
nullptr;
1197 if (wm ==
nullptr) {
1228 if (icon ==
nullptr) {
1234 if (di ==
nullptr) {
1240 ID *
id = (icon->
id_type != 0) ?
static_cast<ID *
>(icon->
obj) :
nullptr;
1250 if (
id || prv->
runtime->deferred_loading_data) {
1294 if (icon ==
nullptr) {
1304 const ID *
id = (icon->
id_type != 0) ?
static_cast<ID *
>(icon->
obj) :
nullptr;
1332 printf(
"%s: no preview image for this ID: %s\n", __func__, id->
name);
1342 const bool delay = prv_img->
rect[
size] !=
nullptr;
1362 if (icon ==
nullptr) {
1368 if (di ==
nullptr) {
1392 prv->
w[0] = bbuf->
x;
1393 prv->
h[0] = bbuf->
y;
1410 const uint8_t *rect,
1412 const float desaturate)
1421 if (
w <= 0 || h <= 0 || w > 2000 || h > 2000) {
1422 printf(
"%s: icons are %i x %i pixels?\n", __func__,
w, h);
1427 const float col[4] = {alpha, alpha, alpha, alpha};
1429 float scale_x = 1.0f;
1430 float scale_y = 1.0f;
1432 if (rw !=
w || rh != h) {
1436 draw_h = int((
float(rh) /
float(rw)) *
float(
w));
1437 draw_y += (h - draw_h) / 2;
1440 draw_w = int((
float(rw) /
float(rh)) *
float(h));
1442 draw_x += (
w - draw_w) / 2;
1444 scale_x = draw_w / float(rw);
1445 scale_y = draw_h / float(rh);
1451 if (desaturate != 0.0f) {
1464 &
state, draw_x, draw_y, rw, rh,
GPU_RGBA8,
true, rect, scale_x, scale_y, 1.0f, 1.0f,
col);
1481 const std::string &name,
1487 uchar white[] = {255, 255, 255, 255};
1488 uchar black[] = {0, 0, 0, 255};
1489 uchar logo_orange[] = {232, 125, 13, 255};
1490 uchar logo_blue[] = {38, 87, 135, 255};
1493 uchar tool_add[] = {117, 255, 175, 255};
1494 uchar tool_remove[] = {245, 107, 91, 255};
1495 uchar tool_select[] = {255, 176, 43, 255};
1496 uchar tool_transform[] = {217, 175, 245, 255};
1497 uchar tool_white[] = {255, 255, 255, 255};
1498 uchar tool_red[] = {214, 45, 48, 255};
1500 const struct ColorItem {
1506 {
"blender_white", white},
1507 {
"blender_black", black},
1508 {
"blender_logo_orange", logo_orange},
1509 {
"blender_logo_blue", logo_blue},
1512 {
"blender_back",
nullptr,
TH_BACK},
1513 {
"blender_text",
nullptr,
TH_TEXT},
1515 {
"blender_red_alert",
nullptr,
TH_ERROR},
1516 {
"blender_error",
nullptr,
TH_ERROR},
1518 {
"blender_info",
nullptr,
TH_INFO},
1528 {
"blender_tool_add", tool_add},
1529 {
"blender_tool_remove", tool_remove},
1530 {
"blender_tool_select", tool_select},
1531 {
"blender_tool_transform", tool_transform},
1532 {
"blender_tool_white", tool_white},
1533 {
"blender_tool_red", tool_red},
1536 for (
const ColorItem &item : items) {
1537 if (name != item.name) {
1543 memcpy(color, item.col,
sizeof(color));
1557 std::string hexcolor = fmt::format(
1558 "{:02x}{:02x}{:02x}{:02x}", color[0], color[1], color[2], color[3]);
1560 size_t att_start = start;
1563 att_start = svg.
find(key, att_start);
1564 if (att_start == std::string::npos || att_start > end) {
1567 const size_t att_end = svg.find(
"\"", att_start + key.
size());
1568 if (att_end != std::string::npos && att_end < end) {
1569 svg.replace(att_start, att_end - att_start, key +
"#" + hexcolor);
1577 att_start = svg.
find(key, att_start);
1578 if (att_start == std::string::npos || att_start > end) {
1581 const size_t att_end = svg.find(
";", att_start + key.
size());
1582 if (att_end != std::string::npos && att_end - att_start < end) {
1583 svg.replace(att_start, att_end - att_start, key +
"#" + hexcolor);
1599 const size_t id_start = svg.
find(key +
"blender_", g_start);
1600 if (id_start == std::string::npos) {
1605 g_start = svg.rfind(
"<g", id_start);
1606 if (g_start == std::string::npos) {
1612 const size_t g_end = svg.find(
"</g>", id_start);
1613 if (g_end == std::string::npos) {
1619 const size_t id_end = svg.find(
"\"", id_start + key.
size());
1620 if (id_end != std::string::npos) {
1621 std::string
id_name = svg.substr(id_start + key.
size(), id_end - id_start - key.
size());
1637 const float desaturate,
1638 const uchar mono_rgba[4],
1639 const bool mono_border,
1641 const bool inverted =
false)
1643 if (icon_id == ICON_NONE) {
1648 const float fdraw_size = float(draw_size);
1652 if (icon ==
nullptr) {
1654 printf(
"%s: Internal error, no icon for icon ID: %d\n", __func__, icon_id);
1656 icon_id = ICON_NOT_FOUND;
1666 int w = int(fdraw_size / aspect + 0.5f);
1667 int h = int(fdraw_size / aspect + 0.5f);
1685 x,
y,
float(draw_size) / aspect,
float(draw_size) / aspect, alpha, mono_rgba);
1688#ifdef USE_UI_TOOLBAR_HACK
1693 y = (
y + (h / 2)) - ((h * scale) / 2);
1706 if ((ibuf ==
nullptr) || (ibuf->
x !=
w) || (ibuf->
y != h) || (
invert != geom_inverted)) {
1710 if (
invert != geom_inverted) {
1730 outline_intensity *= alpha;
1733 if (icon_id == ICON_NOT_FOUND) {
1736 else if (mono_rgba) {
1749 float(draw_size) / aspect,
1759 float(draw_size) / aspect,
1766 if (text_overlay && text_overlay->
text[0] !=
'\0') {
1768 uchar text_color[4];
1769 if (text_overlay->
color[3]) {
1778 fstyle_small.
points *= zoom_factor * 0.8f;
1780 fstyle_small.
shadx = 0;
1781 fstyle_small.
shady = 0;
1787 sizeof(text_overlay->
text),
1796#ifndef WITH_HEADLESS
1812 if (!pi->rect[
size]) {
1825 reinterpret_cast<const uint8_t *
>(pi->rect[
size]),
1835#ifndef WITH_HEADLESS
1867 if (pi ==
nullptr) {
1871 ID *id_to_render = id;
1877 id_to_render =
static_cast<ID *
>(ob->
data);
1942 return ICON_LIBRARY_DATA_BROKEN;
1945 return ICON_LIBRARY_DATA_INDIRECT;
1947 return ICON_LIBRARY_DATA_DIRECT;
1953 return ICON_LIBRARY_DATA_OVERRIDE_NONEDITABLE;
1955 return ICON_LIBRARY_DATA_OVERRIDE;
1958 return ICON_ASSET_MANAGER;
1989 return ICON_SHADING_TEXTURE;
1992 return ICON_OUTLINER_DATA_MESH;
1995 return ICON_FILE_IMAGE;
2015 return icon ? icon : rnaicon;
2027 return ICON_ARMATURE_DATA;
2029 return ICON_BRUSH_DATA;
2031 return ICON_CAMERA_DATA;
2035 return ICON_CURVE_DATA;
2037 return ICON_OUTLINER_DATA_GREASEPENCIL;
2039 return ICON_OUTLINER_COLLECTION;
2041 return ICON_IMAGE_DATA;
2043 return ICON_LIGHT_DATA;
2045 return ICON_LINE_DATA;
2047 return ICON_LATTICE_DATA;
2049 return ICON_MATERIAL_DATA;
2051 return ICON_META_DATA;
2053 return ICON_TRACKER;
2055 return ICON_MESH_DATA;
2057 return ICON_MOD_MASK;
2059 return ICON_NODETREE;
2061 return ICON_OBJECT_DATA;
2063 return ICON_PARTICLE_DATA;
2067 return ICON_CURVE_BEZCURVE;
2069 return ICON_OUTLINER_DATA_LIGHTPROBE;
2071 return ICON_SCENE_DATA;
2073 return ICON_SPEAKER;
2077 return ICON_TEXTURE_DATA;
2081 return ICON_FONT_DATA;
2083 return ICON_CURVES_DATA;
2085 return ICON_POINTCLOUD_DATA;
2087 return ICON_VOLUME_DATA;
2089 return ICON_WORLD_DATA;
2091 return ICON_WORKSPACE;
2093 return ICON_OUTLINER_DATA_GREASEPENCIL;
2095 return ICON_SHAPEKEY_DATA;
2111 return ICON_OBJECT_DATAMODE;
2114 return ICON_EDITMODE_HLT;
2118 return ICON_SCULPTMODE_HLT;
2121 return ICON_VPAINT_HLT;
2124 return ICON_WPAINT_HLT;
2126 return ICON_TPAINT_HLT;
2128 return ICON_PARTICLEMODE;
2130 return ICON_POSE_HLT;
2132 return ICON_GREASEPENCIL;
2139 int icon = ICON_OUTLINER_COLLECTION;
2142 icon = ICON_COLLECTION_COLOR_01 + collection->
color_tag;
2181 const uchar mono_color[4],
2182 const bool mono_border,
2184 const bool inverted)
2203 if (icon_id >= ICON_BLANK_LAST_SVG_ITEM) {
2207 ImBuf *ibuf =
nullptr;
2234 const int icon_indicator_number)
2237 if (icon_indicator_number < 2) {
2238 text_overlay->
text[0] =
'\0';
2253 int icon_id = ICON_NONE;
2256 icon_id = ICON_WARNING_LARGE;
2259 icon_id = ICON_QUESTION_LARGE;
2262 icon_id = ICON_CANCEL_LARGE;
2265 icon_id = ICON_INFO_LARGE;
2268 icon_id = ICON_NONE;
2271 if (icon_id == ICON_NONE) {
void immDrawPixelsTexScaledFullSize(const IMMDrawPixelsTexState *state, float x, float y, int img_w, int img_h, eGPUTextureFormat gpu_format, bool use_filter, const void *rect, float scaleX, float scaleY, float xzoom, float yzoom, const float color[4])
IMMDrawPixelsTexState immDrawPixelsTexSetup(int builtin)
wmWindow * CTX_wm_window(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
#define ICON_RENDER_DEFAULT_HEIGHT
void BKE_icon_set(int icon_id, struct Icon *icon)
void BKE_icons_free(void)
struct Icon * BKE_icon_get(int icon_id)
struct ImBuf * BKE_icon_geom_rasterize(const struct Icon_Geom *geom, unsigned int size_x, unsigned int size_y)
void BKE_icon_geom_invert_lightness(struct Icon_Geom *geom)
int BKE_icon_id_ensure(struct ID *id)
PreviewImage * BKE_previewimg_id_get(const ID *id)
PreviewImage * BKE_previewimg_create()
bool BKE_previewimg_id_supports_jobs(const ID *id)
PreviewImage * BKE_previewimg_id_ensure(ID *id)
bool BKE_previewimg_is_invalid(const PreviewImage *prv)
void BKE_preview_images_free()
PreviewImage * BKE_previewimg_copy(const PreviewImage *prv)
@ STUDIOLIGHT_TYPE_MATCAP
@ STUDIOLIGHT_TYPE_STUDIO
#define STUDIOLIGHT_ICON_SIZE
void BKE_studiolight_set_free_function(StudioLight *sl, StudioLightFreeFunction *free_function, void *data)
#define STUDIOLIGHT_FLAG_ORIENTATIONS
void BKE_studiolight_preview(uint *icon_buffer, StudioLight *sl, int icon_id_type)
void BLF_draw_svg_icon(uint icon_id, float x, float y, float size, const float color[4]=nullptr, float outline_alpha=1.0f, bool multicolor=false, blender::FunctionRef< void(std::string &)> edit_source_cb=nullptr)
void BLF_size(int fontid, float size)
void BLF_width_and_height(int fontid, const char *str, size_t str_len, float *r_width, float *r_height) ATTR_NONNULL()
blender::Array< uchar > BLF_svg_icon_bitmap(uint icon_id, float size, int *r_width, int *r_height, bool multicolor=false, blender::FunctionRef< void(std::string &)> edit_source_cb=nullptr)
void BLF_draw(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_NONNULL(2)
void BLF_color4ubv(int fontid, const unsigned char rgba[4])
void BLF_position(int fontid, float x, float y, float z)
#define BLI_assert_msg(a, msg)
MINLINE int round_fl_to_int(float a)
void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4])
MINLINE unsigned char srgb_to_grayscale_byte(const unsigned char rgb[3])
MINLINE void copy_v4_v4_uchar(unsigned char r[4], const unsigned char a[4])
void BLI_str_format_integer_unit(char dst[BLI_STR_FORMAT_INT32_INTEGER_UNIT_SIZE], int number_to_format) ATTR_NONNULL(1)
@ LIBOVERRIDE_FLAG_SYSTEM_DEFINED
Object groups, one object can be in many groups at once.
@ MOD_DPAINT_SURFACE_F_PTEX
@ MOD_DPAINT_SURFACE_F_VERTEX
@ MOD_DPAINT_SURFACE_F_IMAGESEQ
@ SOCK_DISPLAY_SHAPE_CIRCLE
@ OB_MODE_VERTEX_GREASE_PENCIL
@ OB_MODE_EDIT_GPENCIL_LEGACY
@ OB_MODE_PAINT_GREASE_PENCIL
@ OB_MODE_SCULPT_GREASE_PENCIL
@ OB_MODE_WEIGHT_GREASE_PENCIL
@ KEYFRAME_HANDLE_AUTO_CLAMP
@ KEYFRAME_HANDLE_ALIGNED
bool ED_preview_id_is_supported(const ID *id, const char **r_disabled_hint=nullptr)
void ED_preview_icon_job(const bContext *C, PreviewImage *prv_img, ID *id, enum eIconSizes icon_size, bool delay)
void ED_preview_icon_render(const bContext *C, Scene *scene, PreviewImage *prv_img, ID *id, enum eIconSizes icon_size)
bool ED_preview_use_image_size(const PreviewImage *preview, eIconSizes size)
@ GPU_SHADER_KEYFRAME_SHAPE
@ GPU_SHADER_2D_IMAGE_DESATURATE_COLOR
@ GPU_SHADER_3D_UNIFORM_COLOR
@ GPU_SHADER_3D_IMAGE_COLOR
void GPU_program_point_size(bool enable)
@ GPU_BLEND_ALPHA_PREMULT
void GPU_blend(eGPUBlend blend)
void IMB_flipy(ImBuf *ibuf)
void IMB_premultiply_alpha(ImBuf *ibuf)
ImBuf * IMB_load_image_from_memory(const unsigned char *mem, const size_t size, const int flags, const char *descr, const char *filepath=nullptr, char r_colorspace[IM_MAX_SPACE]=nullptr)
uint8_t * IMB_steal_byte_buffer(ImBuf *ibuf)
ImBuf * IMB_allocFromBuffer(const uint8_t *byte_buffer, const float *float_buffer, unsigned int w, unsigned int h, unsigned int channels)
void IMB_freeImBuf(ImBuf *ibuf)
bool IMB_scale(ImBuf *ibuf, unsigned int newx, unsigned int newy, IMBScaleFilter filter, bool threaded=true)
#define PREVIEW_RENDER_DEFAULT_HEIGHT
Read Guarded memory(de)allocation.
void UI_draw_roundbox_4fv_ex(const rctf *rect, const float inner1[4], const float inner2[4], float shade_dir, const float outline[4], float outline_width, float rad)
void UI_draw_roundbox_corner_set(int type)
void UI_fontstyle_draw(const uiFontStyle *fs, const rcti *rect, const char *str, size_t str_len, const uchar col[4], const uiFontStyleDraw_Params *fs_params)
void UI_widgetbase_draw_cache_flush()
void UI_icons_free_drawinfo(void *drawinfo)
#define ICON_DEFAULT_HEIGHT
#define ICON_DEFAULT_HEIGHT_TOOLBAR
#define PREVIEW_DEFAULT_HEIGHT
#define UI_NO_ICON_OVERLAY_TEXT
#define ICON_DEFAULT_WIDTH
void UI_Theme_Store(bThemeState *theme_state)
void UI_Theme_Restore(const bThemeState *theme_state)
void UI_GetThemeColorType4ubv(int colorid, int spacetype, unsigned char col[4])
void UI_GetThemeColor4fv(int colorid, float col[4])
bool UI_GetIconThemeColor4ubv(int colorid, unsigned char col[4])
void UI_SetTheme(int spacetype, int regionid)
void UI_GetThemeColor4ubv(int colorid, unsigned char col[4])
@ WM_JOB_TYPE_STUDIOLIGHT
BMesh const char void * data
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
constexpr int64_t find(char c, int64_t pos=0) const
constexpr int64_t size() const
std::string id_name(void *id)
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
#define ID_IS_OVERRIDE_LIBRARY_REAL(_id)
#define ID_IS_LINKED(_id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
bool ui_icon_is_preview_deferred_loading(const int icon_id, const bool big)
static void vicon_rgb_red_draw(float x, float y, float w, float h, float alpha, const uchar mono_rgba[4])
void UI_icons_free_drawinfo(void *drawinfo)
static void vicon_handletype_aligned_draw(float x, float y, float w, float h, float alpha, const uchar *)
int UI_icon_from_object_mode(const int mode)
static void vicon_handletype_auto_clamp_draw(float x, float y, float w, float h, float alpha, const uchar *)
static void init_event_icons()
static void vicon_strip_color_draw(short color_tag, float x, float y, float w, float, float)
static void ui_id_preview_image_render_size(const bContext *C, Scene *scene, ID *id, PreviewImage *pi, int size, const bool use_job)
#define DEF_ICON_VECTOR_COLORSET_DRAW_NTH(prefix, index)
int UI_icon_from_keymap_item(const wmKeyMapItem *kmi, int r_icon_mod[KM_MOD_NUM])
PreviewImage * UI_icon_to_preview(int icon_id)
#define DEF_ICON_COLLECTION_COLOR_DRAW(index, color)
void UI_icon_text_overlay_init_from_count(IconTextOverlay *text_overlay, const int icon_indicator_number)
int UI_icon_from_rnaptr(const bContext *C, PointerRNA *ptr, int rnaicon, const bool big)
static void vicon_keytype_extreme_draw(float x, float y, float w, float h, float alpha, const uchar *)
static void vicon_rgb_green_draw(float x, float y, float w, float h, float alpha, const uchar mono_rgba[4])
static void vicon_strip_color_draw_library_data_indirect(float x, float y, float w, float, float alpha, const uchar *)
static DrawInfo * icon_ensure_drawinfo(Icon *icon)
static DrawInfo * def_internal_icon(ImBuf *bbuf, int icon_id, int xofs, int yofs, int size, int type, int theme_color)
ImBuf * UI_svg_icon_bitmap(uint icon_id, float size, bool multicolor)
void ui_icon_ensure_deferred(const bContext *C, const int icon_id, const bool big)
static const IconType icontypes[]
void(*)(float x, float y, float w, float h, float alpha, const uchar mono_rgba[4]) VectorDrawFunc
#define ICON_INDIRECT_DATA_ALPHA
int UI_icon_from_idcode(const int idcode)
void UI_icon_draw_alpha(float x, float y, int icon_id, float alpha)
static void init_internal_icons()
static void vicon_rgb_color_draw(float x, float y, float w, float h, const float color[4], float bg_alpha)
static void vicon_collection_color_draw(short color_tag, float x, float y, float w, float, float)
static void vicon_gplayer_color_draw(Icon *icon, int x, int y, int w, int h)
static void svg_replace_color_attributes(std::string &svg, const std::string &name, const size_t start, const size_t end)
static void vicon_keytype_generated_draw(float x, float y, float w, float h, float alpha, const uchar *)
void UI_icon_draw(float x, float y, int icon_id)
static void icon_draw_rect(float x, float y, int w, int h, int rw, int rh, const uint8_t *rect, float alpha, const float desaturate)
#define ICON_TYPE_SVG_MONO
static void vicon_colorset_draw(int index, int x, int y, int w, int h, float)
static void vicon_handletype_free_draw(float x, float y, float w, float h, float alpha, const uchar *)
void UI_icon_draw_ex(float x, float y, int icon_id, float aspect, float alpha, float desaturate, const uchar mono_color[4], const bool mono_border, const IconTextOverlay *text_overlay, const bool inverted)
static void icon_node_socket_draw(int socket_type, float x, float y, float w, float h, float)
static void icon_verify_datatoc(IconImage *iimg)
static void ui_studiolight_icon_job_end(void *customdata)
static void vicon_keytype_moving_hold_draw(float x, float y, float w, float h, float alpha, const uchar *)
void UI_icon_render_id(const bContext *C, Scene *scene, ID *id, const enum eIconSizes size, const bool use_job)
static void vicon_rgb_blue_draw(float x, float y, float w, float h, float alpha, const uchar mono_rgba[4])
static void vicon_keytype_keyframe_draw(float x, float y, float w, float h, float alpha, const uchar *)
int ui_id_icon_get(const bContext *C, ID *id, const bool big)
#define DEF_ICON_LAYERGROUP_COLOR_DRAW(index, color)
static int ui_id_screen_get_icon(const bContext *C, ID *id)
#define DEF_ICON_NODE_SOCKET_DRAW(name, socket_type)
static void icon_create_rect(PreviewImage *prv_img, enum eIconSizes size)
static void vicon_keytype_jitter_draw(float x, float y, float w, float h, float alpha, const uchar *)
bool UI_icon_get_theme_color(int icon_id, uchar color[4])
void UI_icon_render_id_ex(const bContext *C, Scene *scene, ID *id_to_render, const enum eIconSizes size, const bool use_job, PreviewImage *r_preview_image)
static void icon_draw_size(float x, float y, int icon_id, float aspect, float alpha, enum eIconSizes size, int draw_size, const float desaturate, const uchar mono_rgba[4], const bool mono_border, const IconTextOverlay *text_overlay, const bool inverted=false)
static void vicon_keytype_breakdown_draw(float x, float y, float w, float h, float alpha, const uchar *)
static void def_internal_vicon(int icon_id, VectorDrawFunc drawFunc)
#define ICON_TYPE_SVG_COLOR
int UI_icon_from_library(const ID *id)
static void ui_studiolight_free_function(StudioLight *sl, void *data)
static void icon_source_edit_cb(std::string &svg)
static void vicon_handletype_vector_draw(float x, float y, float w, float h, float alpha, const uchar *)
int UI_icon_from_event_type(short event_type, short event_value)
int UI_icon_color_from_collection(const Collection *collection)
static void vicon_handletype_auto_draw(float x, float y, float w, float h, float alpha, const uchar *)
static DrawInfo * icon_create_drawinfo(Icon *icon)
void UI_icon_draw_preview(float x, float y, int icon_id, float aspect, float alpha, int size)
#define ICON_TYPE_GPLAYER
#define DEF_ICON_STRIP_COLOR_DRAW(index, color)
static void vicon_keytype_draw_wrapper(const float x, const float y, const float w, const float h, const float alpha, const eBezTriple_KeyframeType key_type, const short handle_type)
#define ICON_TYPE_PREVIEW
static int get_draw_size(enum eIconSizes size)
int UI_icon_preview_to_render_size(enum eIconSizes size)
ImBuf * UI_icon_alert_imbuf_get(eAlertIcon icon, float size)
static DrawInfo * g_di_event_list
static void vicon_strip_color_draw_library_data_override_noneditable(float x, float y, float w, float, float alpha, const uchar *)
static void ui_studiolight_kill_icon_preview_job(wmWindowManager *wm, int icon_id)
#define INIT_EVENT_ICON(icon_id, type, value)
static void vicon_rgb_text_draw(float x, float y, float w, float h, const char *str, const uchar mono_rgba[4])
static void vicon_layergroup_color_draw(short color_tag, float x, float y, float w, float, float)
static void ui_studiolight_icon_job_exec(void *customdata, wmJobWorkerStatus *)
static void ui_id_icon_render(const bContext *C, ID *id, bool use_jobs)
static void icon_set_image(const bContext *C, Scene *scene, ID *id, PreviewImage *prv_img, enum eIconSizes size, const bool use_job)
void icon_draw_rect_input(const float x, const float y, const int w, const int h, const int icon_id, const float aspect, const float alpha, const bool inverted)
CCL_NAMESPACE_BEGIN ccl_device float invert(const float color, const float factor)
void draw_keyframe_shape(const float x, const float y, float size, const bool sel, const eBezTriple_KeyframeType key_type, const eKeyframeShapeDrawOpts mode, const float alpha, const KeyframeShaderBindings *sh_bindings, const short handle_type, const short extreme_type)
void * MEM_calloc_arrayN(size_t len, size_t size, const char *str)
void * MEM_callocN(size_t len, const char *str)
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
void MEM_freeN(void *vmemh)
void std_node_socket_colors_get(int socket_type, float *r_color)
void node_draw_nodesocket(const rctf *rect, const float color_inner[4], const float color_outline[4], float outline_thickness, int shape, float aspect)
VecBase< float, 2 > float2
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
PointerRNA RNA_pointer_get(PointerRNA *ptr, const char *name)
bool RNA_struct_is_ID(const StructRNA *type)
int RNA_int_get(PointerRNA *ptr, const char *name)
union DrawInfo::@334257302370005261202155021066221131356374115026 data
struct DrawInfo::@334257302370005261202155021066221131356374115026::@311151113062326373263052366053124222011364023134 input
struct DrawInfo::@334257302370005261202155021066221131356374115026::@245010140123143337353162061035155373323335221122 vector
struct DrawInfo::@334257302370005261202155021066221131356374115026::@025144377161326363113154267371142042106044162216 geom
struct DrawInfo::@334257302370005261202155021066221131356374115026::@172324204356020076172353120335054302150107113315 buffer
struct DrawInfo::@334257302370005261202155021066221131356374115026::@157305323272306353171002232370334024100146167351 texture
IDOverrideLibrary * override_library
const uchar * datatoc_rect
DrawInfoFreeFP drawinfo_free
ImBufByteBuffer byte_buffer
PreviewImageRuntimeHandle * runtime
short changed_timestamp[2]
int icon_id_matcap_flipped
unsigned char vertex_select[4]
float icon_border_intensity
uiWidgetColors wcol_regular
uiWidgetColors wcol_toolbar_item
ThemeStripColor strip_color[9]
ThemeCollectionColor collection_color[8]
ccl_device_inline bool is_light(const ccl_global KernelLightTreeEmitter *kemitter)
void WM_jobs_timer(wmJob *wm_job, double time_step, uint note, uint endnote)
void WM_jobs_start(wmWindowManager *wm, wmJob *wm_job)
void WM_jobs_kill_type(wmWindowManager *wm, const void *owner, int job_type)
wmJob * WM_jobs_get(wmWindowManager *wm, wmWindow *win, const void *owner, const char *name, const eWM_JobFlag flag, const eWM_JobType job_type)
void WM_jobs_callbacks(wmJob *wm_job, wm_jobs_start_callback startjob, void(*initjob)(void *), void(*update)(void *), void(*endjob)(void *))
void WM_jobs_customdata_set(wmJob *wm_job, void *customdata, void(*free)(void *customdata))