32#include "RNA_prototypes.hh"
59#include <fmt/format.h>
74 void (*)(
float x,
float y,
float w,
float h,
float alpha,
const uchar mono_rgba[4]);
76#define ICON_TYPE_PREVIEW 0
77#define ICON_TYPE_SVG_COLOR 1
78#define ICON_TYPE_SVG_MONO 2
79#define ICON_TYPE_BUFFER 3
80#define ICON_TYPE_IMBUF 4
81#define ICON_TYPE_VECTOR 5
82#define ICON_TYPE_GEOM 6
83#define ICON_TYPE_EVENT 7
84#define ICON_TYPE_GPLAYER 8
85#define ICON_TYPE_BLANK 9
124# define DEF_ICON(name) {ICON_TYPE_SVG_MONO, 0},
125# define DEF_ICON_COLOR(name) {ICON_TYPE_SVG_COLOR, 0},
126# define DEF_ICON_SCENE(name) {ICON_TYPE_SVG_MONO, TH_ICON_SCENE},
127# define DEF_ICON_COLLECTION(name) {ICON_TYPE_SVG_MONO, TH_ICON_COLLECTION},
128# define DEF_ICON_OBJECT(name) {ICON_TYPE_SVG_MONO, TH_ICON_OBJECT},
129# define DEF_ICON_OBJECT_DATA(name) {ICON_TYPE_SVG_MONO, TH_ICON_OBJECT_DATA},
130# define DEF_ICON_MODIFIER(name) {ICON_TYPE_SVG_MONO, TH_ICON_MODIFIER},
131# define DEF_ICON_SHADING(name) {ICON_TYPE_SVG_MONO, TH_ICON_SHADING},
132# define DEF_ICON_FOLDER(name) {ICON_TYPE_SVG_MONO, TH_ICON_FOLDER},
133# define DEF_ICON_FUND(name) {ICON_TYPE_SVG_MONO, TH_ICON_FUND},
134# define DEF_ICON_VECTOR(name) {ICON_TYPE_VECTOR, 0},
135# define DEF_ICON_BLANK(name) {ICON_TYPE_BLANK, 0},
142 ImBuf *bbuf,
int icon_id,
int xofs,
int yofs,
int size,
int type,
int theme_color)
146 new_icon->
obj =
nullptr;
153 di->
data.texture.theme_color = theme_color;
167 if (size == bbuf->
x && size == bbuf->
y && xofs == 0 && yofs == 0) {
174 for (
y = 0;
y < size;
y++) {
175 memcpy(&iimg->
rect[
y * size],
176 &
data[(
y + yofs) * imgsize + xofs],
181 di->
data.buffer.image = iimg;
196 new_icon->
obj =
nullptr;
201 di->
data.vector.func = drawFunc;
212 float x,
float y,
float w,
float h,
const float color[4],
float bg_alpha)
221 float x,
float y,
float w,
float h,
const char *
str,
const uchar mono_rgba[4])
224 const size_t len = strlen(
str);
228 const float pos_x =
x + (
w - width) / 2.0f;
229 const float pos_y =
y + (h - height) / 2.0f;
236 float x,
float y,
float w,
float h,
float alpha,
const uchar mono_rgba[4])
238 const float color[4] = {0.5f, 0.0f, 0.0f, 1.0f * alpha};
245 float x,
float y,
float w,
float h,
float alpha,
const uchar mono_rgba[4])
247 const float color[4] = {0.0f, 0.4f, 0.0f, 1.0f * alpha};
254 float x,
float y,
float w,
float h,
float alpha,
const uchar mono_rgba[4])
256 const float color[4] = {0.0f, 0.0f, 1.0f, 1.0f * alpha};
270 const short handle_type)
281 const float xco =
x + (
w / 2.0f);
282 const float yco =
y + (h / 2.0f);
289 format,
"color", gpu::VertAttrType::UNORM_8_8_8_8);
291 format,
"outlineColor", gpu::VertAttrType::UNORM_8_8_8_8);
326 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
332 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
338 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
344 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
350 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
356 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
362 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
368 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
374 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
380 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
386 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
392 int socket_type,
float x,
float y,
float w,
float h,
float )
398 const float socket_radius =
w * 0.5f * size_factor;
399 const float2 center = {
x + 0.5f *
w,
y + 0.5f * h};
401 center.x - socket_radius,
402 center.x + socket_radius,
403 center.y - socket_radius,
404 center.y + socket_radius,
407 float color_inner[4];
410 float color_outer[4] = {0};
412 color_outer[3] = 1.0f;
428 const int a =
x +
w / 3;
429 const int b =
x +
w / 3 * 2;
451# define DEF_ICON_VECTOR_COLORSET_DRAW_NTH(prefix, index) \
452 static void vicon_colorset_draw_##prefix( \
453 float x, float y, float w, float h, float alpha, const uchar * ) \
455 vicon_colorset_draw(index, int(x), int(y), int(w), int(h), alpha); \
479# undef DEF_ICON_VECTOR_COLORSET_DRAW_NTH
482 short color_tag,
float x,
float y,
float w,
float ,
float )
500# define DEF_ICON_STRIP_COLOR_DRAW(index, color) \
501 static void vicon_strip_color_draw_##index( \
502 float x, float y, float w, float h, float alpha, const uchar * ) \
504 vicon_strip_color_draw(color, x, y, w, h, alpha); \
517# undef DEF_ICON_STRIP_COLOR_DRAW
519# define ICON_INDIRECT_DATA_ALPHA 0.6f
522 float x,
float y,
float w,
float ,
float alpha,
const uchar * )
528 ICON_LIBRARY_DATA_DIRECT,
538 float x,
float y,
float w,
float ,
float alpha,
const uchar * )
554 float x,
float y,
float w,
float ,
float alpha,
const uchar * )
560 ICON_LIBRARY_DATA_OVERRIDE,
570 short color_tag,
float x,
float y,
float w,
float ,
float )
579 ICON_GREASEPENCIL_LAYER_GROUP,
583 layergroup_color->
color,
588# define DEF_ICON_LAYERGROUP_COLOR_DRAW(index, color) \
589 static void vicon_layergroup_color_draw_##index( \
590 float x, float y, float w, float h, float alpha, const uchar * ) \
592 vicon_layergroup_color_draw(color, x, y, w, h, alpha); \
604# undef DEF_ICON_LAYERGROUP_COLOR_DRAW
606# define DEF_ICON_NODE_SOCKET_DRAW(name, socket_type) \
607 static void icon_node_socket_draw_##name( \
608 float x, float y, float w, float h, float alpha, const uchar * ) \
610 icon_node_socket_draw(socket_type, x, y, w, h, alpha); \
675 if (di->
data.input.event_type == event_type) {
676 return di->
data.input.icon;
678 }
while ((di = di->
data.input.next));
682 return ICON_MOUSE_LMB_2X;
684 return (event_value ==
KM_PRESS_DRAG) ? ICON_MOUSE_LMB_DRAG : ICON_MOUSE_LMB;
687 return (event_value ==
KM_PRESS_DRAG) ? ICON_MOUSE_MMB_DRAG : ICON_MOUSE_MMB;
690 return (event_value ==
KM_PRESS_DRAG) ? ICON_MOUSE_MMB_DRAG : ICON_MOUSE_RMB;
699 memset(r_icon_mod, 0x0,
sizeof(
int[
KM_MOD_NUM]));
702 r_icon_mod[i++] = ICON_EVENT_CTRL;
705 r_icon_mod[i++] = ICON_EVENT_ALT;
708 r_icon_mod[i++] = ICON_EVENT_SHIFT;
711 r_icon_mod[i++] = ICON_EVENT_OS;
714 r_icon_mod[i++] = ICON_EVENT_HYPER;
724# define INIT_EVENT_ICON(icon_id, type, value) \
726 DrawInfo *di = def_internal_icon(nullptr, icon_id, 0, 0, w, ICON_TYPE_EVENT, 0); \
727 di->data.input.event_type = type; \
728 di->data.input.event_value = value; \
729 di->data.input.icon = icon_id; \
730 di->data.input.next = di_next; \
912# undef INIT_EVENT_ICON
926 if (bbuf->
x != iimg->
h && bbuf->
y != iimg->
w) {
930 const size_t size_in_bytes = size_t(bbuf->
x) * size_t(bbuf->
y) *
sizeof(
uint);
932 memcpy(iimg->
rect,
reinterpret_cast<const uint *
>(bbuf->
byte_data()), size_in_bytes);
940 for (
int x = ICON_NONE;
x < ICON_BLANK_LAST_SVG_ITEM;
x++) {
1050 if (di ==
nullptr) {
1055 if (di->
data.buffer.image) {
1056 if (di->
data.buffer.image->rect) {
1057 MEM_delete(di->
data.buffer.image->rect);
1059 MEM_delete(di->
data.buffer.image);
1063 if (di->
data.geom.image_cache) {
1076 const int icon_data_type = icon->
obj_type;
1116 if (icon ==
nullptr) {
1126#ifndef WITH_HEADLESS
1152 CLOG_WARN(&
LOG,
"%s, error: requested preview image does not exist", __func__);
1155 else if (!prv_img->
rect[size]) {
1159 prv_img->
w[size] = render_size;
1160 prv_img->
h[size] = render_size;
1171 Icon **tmp =
static_cast<Icon **
>(customdata);
1176 reinterpret_cast<uint *
>(di->
data.buffer.image->rect), sl, icon->
id_type);
1183 icon->
obj =
nullptr;
1191 if (
wm ==
nullptr) {
1212 Icon **tmp =
static_cast<Icon **
>(customdata);
1222 if (icon ==
nullptr) {
1228 if (di ==
nullptr) {
1234 ID *
id = (icon->
id_type != 0) ?
static_cast<ID *
>(icon->
obj) :
nullptr;
1239 const bool use_jobs = !
id || (
GS(
id->name) !=
ID_SCR);
1252 if (di->
data.buffer.image ==
nullptr) {
1262 memset(img->
rect, 0, size);
1263 di->
data.buffer.image = img;
1268 "Generating StudioLight icon...",
1288 if (icon ==
nullptr) {
1298 const ID *
id = (icon->
id_type != 0) ?
static_cast<ID *
>(icon->
obj) :
nullptr;
1326 CLOG_WARN(&
LOG,
"%s: no preview image for this ID: %s", __func__,
id->name);
1341 const bool delay = prv_img->
rect[size] !=
nullptr;
1361 if (icon ==
nullptr) {
1367 if (di ==
nullptr) {
1380 else if (di->
data.buffer.image) {
1384 di->
data.buffer.image->datatoc_size,
1390 const size_t size = size_t(bbuf->
x) * size_t(bbuf->
y);
1394 prv->
w[0] = bbuf->
x;
1395 prv->
h[0] = bbuf->
y;
1414 const float desaturate)
1423 if (
w <= 0 || h <= 0 || w > 2000 || h > 2000) {
1424 printf(
"%s: icons are %i x %i pixels?\n", __func__,
w, h);
1429 const float col[4] = {alpha, alpha, alpha, alpha};
1431 float scale_x = 1.0f;
1432 float scale_y = 1.0f;
1434 if (rw !=
w || rh != h) {
1438 draw_h = int((
float(rh) /
float(rw)) *
float(
w));
1439 draw_y += (h - draw_h) / 2;
1442 draw_w = int((
float(rw) /
float(rh)) *
float(h));
1444 draw_x += (
w - draw_w) / 2;
1446 scale_x = draw_w /
float(rw);
1447 scale_y = draw_h /
float(rh);
1453 if (desaturate != 0.0f) {
1469 gpu::TextureFormat::UNORM_8_8_8_8,
1491 const std::string &name,
1497 uchar white[] = {255, 255, 255, 255};
1498 uchar black[] = {0, 0, 0, 255};
1499 uchar logo_orange[] = {232, 125, 13, 255};
1500 uchar logo_blue[] = {38, 87, 135, 255};
1503 uchar tool_add[] = {117, 255, 175, 255};
1504 uchar tool_remove[] = {245, 107, 91, 255};
1505 uchar tool_select[] = {255, 176, 43, 255};
1506 uchar tool_transform[] = {217, 175, 245, 255};
1507 uchar tool_white[] = {255, 255, 255, 255};
1508 uchar tool_red[] = {214, 45, 48, 255};
1510 const struct ColorItem {
1512 const uchar *col =
nullptr;
1516 {
"blender_white", white},
1517 {
"blender_black", black},
1518 {
"blender_logo_orange", logo_orange},
1519 {
"blender_logo_blue", logo_blue},
1522 {
"blender_back",
nullptr,
TH_BACK},
1523 {
"blender_text",
nullptr,
TH_TEXT},
1525 {
"blender_red_alert",
nullptr,
TH_ERROR},
1526 {
"blender_error",
nullptr,
TH_ERROR},
1528 {
"blender_info",
nullptr,
TH_INFO},
1546 {
"blender_tool_add", tool_add},
1547 {
"blender_tool_remove", tool_remove},
1548 {
"blender_tool_select", tool_select},
1549 {
"blender_tool_transform", tool_transform},
1550 {
"blender_tool_white", tool_white},
1551 {
"blender_tool_red", tool_red},
1552 {
"blender_bevel",
nullptr,
TH_BEVEL},
1554 {
"blender_seam",
nullptr,
TH_SEAM},
1555 {
"blender_sharp",
nullptr,
TH_SHARP},
1561 for (
const ColorItem &item : items) {
1562 if (name != item.name) {
1582 std::string hexcolor = fmt::format(
1585 size_t att_start = start;
1587 constexpr static StringRef key =
"fill=\"";
1588 att_start = svg.
find(key, att_start);
1589 if (att_start == std::string::npos || att_start > end) {
1592 const size_t att_end = svg.find(
"\"", att_start + key.
size());
1593 if (att_end != std::string::npos && att_end < end) {
1594 svg.replace(att_start, att_end - att_start, key +
"#" + hexcolor);
1596 att_start +=
StringRef(key +
"#rrggbbaa\"").size();
1601 constexpr static StringRef key =
"fill:";
1602 att_start = svg.
find(key, att_start);
1603 if (att_start == std::string::npos || att_start > end) {
1606 const size_t att_end = svg.find(
";", att_start + key.
size());
1607 if (att_end != std::string::npos && att_end - att_start < end) {
1608 svg.replace(att_start, att_end - att_start, key +
"#" + hexcolor);
1610 att_start +=
StringRef(key +
"#rrggbbaa").size();
1623 constexpr static StringRef key =
"id=\"";
1624 const size_t id_start = svg.
find(key +
"blender_", g_start);
1625 if (id_start == std::string::npos) {
1630 g_start = svg.rfind(
"<g", id_start);
1631 if (g_start == std::string::npos) {
1637 const size_t g_end = svg.find(
"</g>", id_start);
1638 if (g_end == std::string::npos) {
1644 const size_t id_end = svg.find(
"\"", id_start + key.
size());
1645 if (id_end != std::string::npos) {
1646 std::string id_name = svg.substr(id_start + key.
size(), id_end - id_start - key.
size());
1662 const float desaturate,
1663 const uchar mono_rgba[4],
1664 const bool mono_border,
1668 if (icon_id == ICON_NONE) {
1673 const float fdraw_size =
float(draw_size);
1677 if (icon ==
nullptr) {
1679 CLOG_WARN(&
LOG,
"%s: Internal error, no icon for icon ID: %d", __func__, icon_id);
1681 icon_id = ICON_NOT_FOUND;
1691 int w = int(fdraw_size / aspect + 0.5f);
1692 int h = int(fdraw_size / aspect + 0.5f);
1709 di->
data.vector.func(
1710 x,
y,
float(draw_size) / aspect,
float(draw_size) / aspect, alpha, mono_rgba);
1713#ifdef USE_UI_TOOLBAR_HACK
1718 y = (
y + (h / 2)) - ((h *
scale) / 2);
1726 const bool geom_inverted = di->
data.geom.inverted;
1730 ImBuf *ibuf = di->
data.geom.image_cache;
1731 if ((ibuf ==
nullptr) || (ibuf->
x !=
w) || (ibuf->
y != h) || (
invert != geom_inverted)) {
1735 if (
invert != geom_inverted) {
1739 di->
data.geom.image_cache = ibuf;
1752 const float outline_intensity = mono_border ?
1761 if (icon_id == ICON_NOT_FOUND) {
1764 else if (mono_rgba) {
1777 float(draw_size) / aspect,
1787 float(draw_size) / aspect,
1794 if (text_overlay && text_overlay->
text[0] !=
'\0') {
1796 uchar text_color[4];
1797 if (text_overlay->
color[3]) {
1806 fstyle_small.
points *= zoom_factor * 0.8f;
1808 fstyle_small.
shadx = 0;
1809 fstyle_small.
shady = 0;
1815 sizeof(text_overlay->
text),
1824#ifndef WITH_HEADLESS
1844 if (!pi->
rect[size]) {
1845 for (
int bigger_size = size + 1; bigger_size <
NUM_ICON_SIZES; bigger_size++) {
1854 if (!pi->
rect[size]) {
1867 reinterpret_cast<const uint8_t *
>(pi->
rect[size]),
1877#ifndef WITH_HEADLESS
1919 if (pi ==
nullptr) {
1923 ID *id_to_render =
id;
1927 Object *ob = id_cast<Object *>(
id);
1929 id_to_render = ob->
data;
1967 switch (
GS(
id->name)) {
1998 return ICON_PACKAGE_INDIRECT;
2000 return ICON_PACKAGE;
2003 return ICON_LIBRARY_DATA_BROKEN;
2006 return ICON_LIBRARY_DATA_INDIRECT;
2008 return ICON_LIBRARY_DATA_DIRECT;
2014 return ICON_LIBRARY_DATA_OVERRIDE_NONEDITABLE;
2016 return ICON_LIBRARY_DATA_OVERRIDE;
2019 return ICON_ASSET_MANAGER;
2050 return ICON_SHADING_TEXTURE;
2053 return ICON_OUTLINER_DATA_MESH;
2056 return ICON_FILE_IMAGE;
2076 return icon ? icon : rnaicon;
2088 return ICON_ARMATURE_DATA;
2090 return ICON_BRUSH_DATA;
2092 return ICON_CAMERA_DATA;
2096 return ICON_CURVE_DATA;
2098 return ICON_OUTLINER_DATA_GREASEPENCIL;
2102 return ICON_IMAGE_DATA;
2104 return ICON_LIGHT_DATA;
2106 return ICON_LINE_DATA;
2108 return ICON_LATTICE_DATA;
2110 return ICON_MATERIAL_DATA;
2112 return ICON_META_DATA;
2114 return ICON_TRACKER;
2116 return ICON_MESH_DATA;
2118 return ICON_MOD_MASK;
2120 return ICON_NODETREE;
2122 return ICON_OBJECT_DATA;
2124 return ICON_PARTICLE_DATA;
2128 return ICON_CURVE_BEZCURVE;
2130 return ICON_OUTLINER_DATA_LIGHTPROBE;
2132 return ICON_SCENE_DATA;
2134 return ICON_SPEAKER;
2138 return ICON_TEXTURE_DATA;
2142 return ICON_FONT_DATA;
2144 return ICON_CURVES_DATA;
2146 return ICON_POINTCLOUD_DATA;
2148 return ICON_VOLUME_DATA;
2150 return ICON_WORLD_DATA;
2152 return ICON_WORKSPACE;
2154 return ICON_OUTLINER_DATA_GREASEPENCIL;
2156 return ICON_SHAPEKEY_DATA;
2171 return ICON_OBJECT_DATAMODE;
2174 return ICON_EDITMODE_HLT;
2178 return ICON_SCULPTMODE_HLT;
2181 return ICON_VPAINT_HLT;
2184 return ICON_WPAINT_HLT;
2186 return ICON_TPAINT_HLT;
2188 return ICON_PARTICLEMODE;
2190 return ICON_POSE_HLT;
2192 return ICON_GREASEPENCIL;
2201 return ICON_OUTLINER_OB_LIGHT;
2203 return ICON_OUTLINER_OB_MESH;
2205 return ICON_OUTLINER_OB_CAMERA;
2207 return ICON_OUTLINER_OB_CURVE;
2209 return ICON_OUTLINER_OB_META;
2211 return ICON_OUTLINER_OB_LATTICE;
2213 return ICON_OUTLINER_OB_ARMATURE;
2215 return ICON_OUTLINER_OB_FONT;
2217 return ICON_OUTLINER_OB_SURFACE;
2219 return ICON_OUTLINER_OB_SPEAKER;
2221 return ICON_OUTLINER_OB_LIGHTPROBE;
2223 return ICON_OUTLINER_OB_CURVES;
2225 return ICON_OUTLINER_OB_POINTCLOUD;
2227 return ICON_OUTLINER_OB_VOLUME;
2230 return ICON_OUTLINER_OB_GROUP_INSTANCE;
2233 return ICON_OUTLINER_OB_IMAGE;
2236 return ICON_OUTLINER_OB_FORCE_FIELD;
2239 return ICON_OUTLINER_OB_EMPTY;
2242 return ICON_OUTLINER_OB_GREASEPENCIL;
2252 int icon = ICON_OUTLINER_COLLECTION;
2255 icon = ICON_COLLECTION_COLOR_01 + int(collection->
color_tag);
2294 const uchar mono_color[4],
2295 const bool mono_border,
2317 if (icon_id >= ICON_BLANK_LAST_SVG_ITEM) {
2321 ImBuf *ibuf =
nullptr;
2348 const int icon_indicator_number)
2351 if (icon_indicator_number < 2) {
2352 text_overlay->
text[0] =
'\0';
2367 int icon_id = ICON_NONE;
2370 icon_id = ICON_WARNING_LARGE;
2373 icon_id = ICON_QUESTION_LARGE;
2376 icon_id = ICON_CANCEL_LARGE;
2379 icon_id = ICON_INFO_LARGE;
2382 icon_id = ICON_NONE;
2385 if (icon_id == ICON_NONE) {
#define ICON_RENDER_DEFAULT_HEIGHT
#define STUDIOLIGHT_ICON_SIZE
#define STUDIOLIGHT_FLAG_ORIENTATIONS
#define CTX_IFACE_(context, msgid)
#define BLT_I18NCONTEXT_COLOR
#define CLOG_WARN(clg_ref,...)
#define ID_IS_PACKED(_id)
#define ID_IS_OVERRIDE_LIBRARY_REAL(_id)
#define ID_IS_LINKED(_id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
Enumerations for DNA_ID.h.
Object groups, one object can be in many groups at once.
#define PREVIEW_RENDER_DEFAULT_HEIGHT
Read Blender memory allocation and freeing.
#define ICON_DEFAULT_HEIGHT
#define ICON_DEFAULT_HEIGHT_TOOLBAR
#define PREVIEW_DEFAULT_HEIGHT
#define UI_NO_ICON_OVERLAY_TEXT
#define ICON_DEFAULT_WIDTH
#define BLI_assert_msg(a, msg)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
void draw(float x, float y, int img_w, int img_h, gpu::TextureFormat gpu_format, bool use_filter, const void *rect, float scale_x, float scale_y, const float color[4])
constexpr int64_t size() const
constexpr int64_t find(char c, int64_t pos=0) const
#define image(slot, qualifiers, format)
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
float2x2 invert(float2x2 mat)
float3x3 scale(float3x3 mat, float2 scale)
#define DEF_ICON_VECTOR_COLORSET_DRAW_NTH(prefix, index)
#define ICON_INDIRECT_DATA_ALPHA
#define ICON_TYPE_SVG_MONO
#define DEF_ICON_NODE_SOCKET_DRAW(name, socket_type)
#define ICON_TYPE_SVG_COLOR
#define ICON_TYPE_GPLAYER
#define ICON_TYPE_PREVIEW
#define INIT_EVENT_ICON(icon_id, type, value)
ccl_device_inline dual1 len(const ccl_private dual< T > &a)
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
ccl_device_inline float3x3 inverted(const float3x3 m)
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)
void get_color_4ubv(int colorid, unsigned char col[4])
void theme_store(bThemeState *theme_state)
void theme_set(int spacetype, int regionid)
void get_color_type_4ubv(int colorid, int spacetype, unsigned char col[4])
void get_color_4fv(int colorid, float col[4])
const bTheme * theme_get()
void theme_restore(const bThemeState *theme_state)
bool get_icon_color_4ubv(int colorid, unsigned char col[4])
void get_color_type_4fv(int colorid, int spacetype, float col[4])
void icon_text_overlay_init_from_count(IconTextOverlay *text_overlay, const int icon_indicator_number)
int icon_from_event_type(short event_type, short event_value)
int icon_from_object_type(const Object *object)
static void vicon_rgb_blue_draw(float x, float y, float w, float h, float alpha, const uchar mono_rgba[4])
static void icon_verify_datatoc(IconImage *iimg)
static void vicon_keytype_extreme_draw(float x, float y, float w, float h, float alpha, const uchar *)
ImBuf * icon_alert_imbuf_get(AlertIcon icon, float size)
static void vicon_handletype_vector_draw(float x, float y, float w, float h, float alpha, const uchar *)
bool icon_is_preview_deferred_loading(const int icon_id, const bool big)
static DrawInfo * def_internal_icon(ImBuf *bbuf, int icon_id, int xofs, int yofs, int size, int type, int theme_color)
static void init_internal_icons()
static void vicon_strip_color_draw(short color_tag, float x, float y, float w, float, float)
static void vicon_strip_color_draw_library_data_override_noneditable(float x, float y, float w, float, float alpha, const uchar *)
static const IconType icontypes[]
static void vicon_keytype_breakdown_draw(float x, float y, float w, float h, float alpha, const uchar *)
static void vicon_handletype_auto_clamp_draw(float x, float y, float w, float h, float alpha, const uchar *)
static void vicon_colorset_draw(int index, int x, int y, int w, int h, float)
int icon_from_keymap_item(const wmKeyMapItem *kmi, int r_icon_mod[KM_MOD_NUM])
static void init_event_icons()
static void vicon_keytype_generated_draw(float x, float y, float w, float h, float alpha, const uchar *)
static DrawInfo * icon_ensure_drawinfo(Icon *icon)
bool icon_get_theme_color(int icon_id, unsigned char color[4])
static void vicon_rgb_green_draw(float x, float y, float w, float h, float alpha, const uchar mono_rgba[4])
void icons_free_drawinfo(void *drawinfo)
static void vicon_handletype_aligned_draw(float x, float y, float w, float h, float alpha, const uchar *)
static int id_screen_get_icon(const bContext *C, ID *id)
DEF_ICON_LAYERGROUP_COLOR_DRAW(01, LAYERGROUP_COLOR_01)
static void vicon_handletype_free_draw(float x, float y, float w, float h, float alpha, const uchar *)
static void vicon_handletype_auto_draw(float x, float y, float w, float h, float alpha, const uchar *)
int icon_from_idcode(int idcode)
static void vicon_keytype_moving_hold_draw(float x, float y, float w, float h, float alpha, const uchar *)
void icon_draw_ex(float x, float y, int icon_id, float aspect, float alpha, float desaturate, const uchar mono_color[4], bool mono_border, const IconTextOverlay *text_overlay, const bool inverted=false, float scale=1.0f)
static void id_icon_render(const bContext *C, ID *id, bool use_jobs)
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_gplayer_color_draw(Icon *icon, int x, int y, int w, int h)
static void studiolight_icon_job_exec(void *customdata, wmJobWorkerStatus *)
int id_icon_get(const bContext *C, ID *id, const bool big)
int icon_from_object_mode(int mode)
DEF_ICON_STRIP_COLOR_DRAW(01, STRIP_COLOR_01)
void fontstyle_draw(const uiFontStyle *fs, const rcti *rect, const char *str, size_t str_len, const uchar col[4], const FontStyleDrawParams *fs_params)
static void icon_node_socket_draw(int socket_type, float x, float y, float w, float h, float)
static void svg_replace_color_attributes(std::string &svg, const std::string &name, const size_t start, const size_t end)
static DrawInfo * icon_create_drawinfo(Icon *icon)
void widgetbase_draw_cache_flush()
void(*)(float x, float y, float w, float h, float alpha, const uchar mono_rgba[4]) VectorDrawFunc
void draw_roundbox_corner_set(int type)
void icon_draw_preview(float x, float y, int icon_id, float aspect, float alpha, int size)
static void studiolight_kill_icon_preview_job(wmWindowManager *wm, int icon_id)
void 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_create_rect(PreviewImage *prv_img, enum eIconSizes size)
static void icon_set_image(const bContext *C, Scene *scene, ID *id, PreviewImage *prv_img, enum eIconSizes size, const bool use_job)
static void vicon_keytype_keyframe_draw(float x, float y, float w, float h, float alpha, const uchar *)
static void def_internal_vicon(int icon_id, VectorDrawFunc drawFunc)
int icon_from_rnaptr(const bContext *C, PointerRNA *ptr, int rnaicon, bool big)
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)
void 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)
static int get_draw_size(enum eIconSizes size)
static void vicon_strip_color_draw_package_indirect(float x, float y, float w, float, float alpha, const uchar *)
static void id_preview_image_render_size(const bContext *C, Scene *scene, ID *id, PreviewImage *pi, int size, const bool use_job)
static void studiolight_free_function(StudioLight *sl, void *data)
static void vicon_strip_color_draw_library_data_indirect(float x, float y, float w, float, float alpha, const uchar *)
void icon_draw(float x, float y, int icon_id)
void icon_render_id(const bContext *C, Scene *scene, ID *id, enum eIconSizes size, bool use_job)
int icon_color_from_collection(const Collection *collection)
void icon_draw_alpha(float x, float y, int icon_id, float alpha)
static void studiolight_icon_job_end(void *customdata)
static void icon_source_edit_cb(std::string &svg)
int icon_from_library(const ID *id)
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)
static void vicon_layergroup_color_draw(short color_tag, float x, float y, float w, float, float)
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)
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 DrawInfo * g_di_event_list
void icon_ensure_deferred(const bContext *C, int icon_id, bool big)
int icon_preview_to_render_size(enum eIconSizes size)
ImBuf * svg_icon_bitmap(uint icon_id, float size, bool multicolor=false)
static void vicon_rgb_red_draw(float x, float y, float w, float h, float alpha, const uchar mono_rgba[4])
PreviewImage * icon_to_preview(int icon_id)
static void vicon_keytype_jitter_draw(float x, float y, float w, float h, float alpha, const uchar *)
static void vicon_rgb_color_draw(float x, float y, float w, float h, const float color[4], float bg_alpha)
ImBuf * BKE_icon_geom_rasterize(const Icon_Geom *geom, unsigned int size_x, unsigned int size_y)
bool ED_preview_id_render_is_supported(const ID *id, const char **r_disabled_hint=nullptr)
void BKE_studiolight_preview(uint *icon_buffer, StudioLight *sl, int icon_id_type)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
MINLINE void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4])
@ STUDIOLIGHT_TYPE_MATCAP
@ STUDIOLIGHT_TYPE_STUDIO
void BLF_position(int fontid, float x, float y, float z)
void WM_jobs_callbacks(wmJob *wm_job, wm_jobs_start_callback startjob, void(*initjob)(void *), void(*update)(void *), void(*endjob)(void *))
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
MINLINE int round_fl_to_int(float a)
MINLINE unsigned char srgb_to_grayscale_byte(const unsigned char rgb[3])
int BKE_icon_id_ensure(ID *id)
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, FunctionRef< void(std::string &)> edit_source_cb=nullptr)
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 immUniform2f(const char *name, float x, float y)
@ SOCK_DISPLAY_SHAPE_CIRCLE
bool ED_preview_use_image_size(const PreviewImage *preview, eIconSizes size)
GPUVertFormat * immVertexFormat()
@ WM_JOB_TYPE_STUDIOLIGHT
bool BKE_previewimg_is_invalid(const PreviewImage *prv, int size)
void immBegin(GPUPrimType, uint vertex_len)
void BKE_icon_set(int icon_id, Icon *icon)
int RNA_int_get(PointerRNA *ptr, const char *name)
Icon * BKE_icon_get(int icon_id)
wmWindow * CTX_wm_window(const bContext *C)
void BKE_icon_geom_invert_lightness(Icon_Geom *geom)
void WM_jobs_customdata_set(wmJob *wm_job, void *customdata, void(*free)(void *customdata))
void BKE_preview_images_free()
void BKE_studiolight_set_free_function(StudioLight *sl, StudioLightFreeFunction *free_function, void *data)
void MEM_delete_void(void *vmemh)
@ LIBOVERRIDE_FLAG_SYSTEM_DEFINED
bool BKE_previewimg_id_supports_jobs(const ID *id)
void immUniformColor3ubv(const unsigned char rgb[3])
@ GPU_BLEND_ALPHA_PREMULT
void WM_jobs_start(wmWindowManager *wm, wmJob *wm_job)
void immBindBuiltinProgram(GPUBuiltinShader shader_id)
void BLF_size(int fontid, float size)
void IMB_freeImBuf(ImBuf *ibuf)
VecBase< float, 2 > float2
void immUniform1f(const char *name, float x)
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
@ OB_MODE_VERTEX_GREASE_PENCIL
@ OB_MODE_SCULPT_GREASE_PENCIL
@ OB_MODE_EDIT_GPENCIL_LEGACY
@ OB_MODE_WEIGHT_GREASE_PENCIL
@ OB_MODE_PAINT_GREASE_PENCIL
BMesh const char void * data
@ GPU_SHADER_KEYFRAME_SHAPE
@ GPU_SHADER_3D_IMAGE_COLOR
@ GPU_SHADER_3D_UNIFORM_COLOR
@ GPU_SHADER_2D_IMAGE_DESATURATE_COLOR
wmWindowManager * CTX_wm_manager(const bContext *C)
void IMB_flipy(ImBuf *ibuf)
PreviewImage * BKE_previewimg_id_ensure(ID *id)
@ MOD_DPAINT_SURFACE_F_VERTEX
@ MOD_DPAINT_SURFACE_F_PTEX
@ MOD_DPAINT_SURFACE_F_IMAGESEQ
void GPU_program_point_size(bool enable)
MINLINE void copy_v4_v4_uchar(unsigned char r[4], const unsigned char a[4])
void BLF_draw(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_NONNULL(2)
uint GPU_vertformat_attr_add(GPUVertFormat *format, StringRef name, gpu::VertAttrType type)
PreviewImage * BKE_previewimg_id_get(const ID *id)
void BLF_color4ubv(int fontid, const unsigned char rgba[4])
PointerRNA RNA_pointer_get(PointerRNA *ptr, const char *name)
bool RNA_struct_is_ID(const StructRNA *type)
bool BKE_previewimg_is_finished(const PreviewImage *prv, int size)
PreviewImage * BKE_previewimg_create()
ImBuf * IMB_load_image_from_memory(const unsigned char *mem, size_t size, ImBufFlags flags, const char *descr, const char *filepath=nullptr, ColorManagedColorspaceSettings *colorspace_settings=nullptr)
void WM_jobs_kill_type(wmWindowManager *wm, const void *owner, int job_type)
bool BKE_previewimg_is_rendering(const PreviewImage *prv, int size)
@ KEYFRAME_HANDLE_ALIGNED
@ KEYFRAME_HANDLE_AUTO_CLAMP
wmJob * WM_jobs_get(wmWindowManager *wm, wmWindow *win, const void *owner, const char *name, const eWM_JobFlag flag, const eWM_JobType job_type)
void BLI_str_format_integer_unit(char dst[BLI_STR_FORMAT_INT32_INTEGER_UNIT_SIZE], int number_to_format) ATTR_NONNULL(1)
ImBuf * IMB_allocFromBuffer(const uint8_t *byte_buffer, const float *float_buffer, unsigned int w, unsigned int h, unsigned int channels)
ID_Type GS(const char *name)
PreviewImage * BKE_previewimg_copy(const PreviewImage *prv)
Array< uchar > BLF_svg_icon_bitmap(uint icon_id, float size, int *r_width, int *r_height, bool multicolor=false, FunctionRef< void(std::string &)> edit_source_cb=nullptr)
Scene * CTX_data_scene(const bContext *C)
void immUniformColor3fv(const float rgb[3])
void GPU_blend(GPUBlend blend)
bool IMB_scale(ImBuf *ibuf, int2 new_size, IMBScaleFilter filter, bool threaded=true)
void BLF_width_and_height(int fontid, const char *str, size_t str_len, float *r_width, float *r_height) ATTR_NONNULL()
void immRectf(uint pos, float x1, float y1, float x2, float y2)
void WM_jobs_timer(wmJob *wm_job, double time_step, uint note, uint endnote, void(*timer_step)(void *))
void ED_preview_icon_render(const bContext *C, Scene *scene, PreviewImage *prv_img, ID *id, enum eIconSizes icon_size)
void ED_preview_icon_job(const bContext *C, PreviewImage *prv_img, ID *id, enum eIconSizes icon_size, bool delay)
void * MEM_new_array_zeroed(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
void IMB_premultiply_alpha(ImBuf *ibuf)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
unsigned char anim_interpolation_constant[4]
unsigned char vertex_select[4]
unsigned char anim_interpolation_other[4]
unsigned char anim_interpolation_linear[4]
float icon_border_intensity
uiWidgetColors wcol_regular
uiWidgetColors wcol_toolbar_item
ThemeStripColor strip_color[9]
ThemeCollectionColor collection_color[8]
CollectionColorTag color_tag
eDynamicPaint_SurfaceFormat format
DrawInfoFreeFP drawinfo_free
const uint8_t * byte_data() const
bke::PreviewImageRuntime * runtime
short changed_timestamp[2]
int icon_id_matcap_flipped
std::unique_ptr< PreviewDeferredLoadingData > deferred_loading_data
union blender::ui::DrawInfo::@334326232056141106073126217337134224203025371246 data
const uchar * datatoc_rect
ccl_device_inline bool is_light(const ccl_global KernelLightTreeEmitter *kemitter)
struct blender::ui::DrawInfo::@334326232056141106073126217337134224203025371246::@374125343222203213217151275235361232147360213240 texture
struct blender::ui::DrawInfo::@334326232056141106073126217337134224203025371246::@313320217317367277317032242220231366344326253252 geom
struct blender::ui::DrawInfo::@334326232056141106073126217337134224203025371246::@364322345027076070207110134263063104142142125314 input
struct blender::ui::DrawInfo::@334326232056141106073126217337134224203025371246::@364063327322304267276054045235213143071233365241 buffer
struct blender::ui::DrawInfo::@334326232056141106073126217337134224203025371246::@051330342100043267354310071366107060070076372114 vector