30#include "RNA_prototypes.hh"
57#include <fmt/format.h>
70 void (*)(
float x,
float y,
float w,
float h,
float alpha,
const uchar mono_rgba[4]);
72#define ICON_TYPE_PREVIEW 0
73#define ICON_TYPE_SVG_COLOR 1
74#define ICON_TYPE_SVG_MONO 2
75#define ICON_TYPE_BUFFER 3
76#define ICON_TYPE_IMBUF 4
77#define ICON_TYPE_VECTOR 5
78#define ICON_TYPE_GEOM 6
79#define ICON_TYPE_EVENT 7
80#define ICON_TYPE_GPLAYER 8
81#define ICON_TYPE_BLANK 9
120# define DEF_ICON(name) {ICON_TYPE_SVG_MONO, 0},
121# define DEF_ICON_COLOR(name) {ICON_TYPE_SVG_COLOR, 0},
122# define DEF_ICON_SCENE(name) {ICON_TYPE_SVG_MONO, TH_ICON_SCENE},
123# define DEF_ICON_COLLECTION(name) {ICON_TYPE_SVG_MONO, TH_ICON_COLLECTION},
124# define DEF_ICON_OBJECT(name) {ICON_TYPE_SVG_MONO, TH_ICON_OBJECT},
125# define DEF_ICON_OBJECT_DATA(name) {ICON_TYPE_SVG_MONO, TH_ICON_OBJECT_DATA},
126# define DEF_ICON_MODIFIER(name) {ICON_TYPE_SVG_MONO, TH_ICON_MODIFIER},
127# define DEF_ICON_SHADING(name) {ICON_TYPE_SVG_MONO, TH_ICON_SHADING},
128# define DEF_ICON_FOLDER(name) {ICON_TYPE_SVG_MONO, TH_ICON_FOLDER},
129# define DEF_ICON_FUND(name) {ICON_TYPE_SVG_MONO, TH_ICON_FUND},
130# define DEF_ICON_VECTOR(name) {ICON_TYPE_VECTOR, 0},
131# define DEF_ICON_BLANK(name) {ICON_TYPE_BLANK, 0},
138 ImBuf *bbuf,
int icon_id,
int xofs,
int yofs,
int size,
int type,
int theme_color)
142 new_icon->
obj =
nullptr;
163 if (
size == bbuf->
x &&
size == bbuf->
y && xofs == 0 && yofs == 0) {
172 size * 4 *
sizeof(uint8_t));
191 new_icon->
obj =
nullptr;
207 float x,
float y,
float w,
float h,
const float color[4],
float bg_alpha)
210 const float color_bg[4] = {color[0], color[1], color[2], bg_alpha};
216 float x,
float y,
float w,
float h,
const char *
str,
const uchar mono_rgba[4])
219 const size_t len = strlen(
str);
223 const float pos_x =
x + (
w - width) / 2.0f;
224 const float pos_y =
y + (h - height) / 2.0f;
231 float x,
float y,
float w,
float h,
float alpha,
const uchar mono_rgba[4])
233 const float color[4] = {0.5f, 0.0f, 0.0f, 1.0f * alpha};
240 float x,
float y,
float w,
float h,
float alpha,
const uchar mono_rgba[4])
242 const float color[4] = {0.0f, 0.4f, 0.0f, 1.0f * alpha};
249 float x,
float y,
float w,
float h,
float alpha,
const uchar mono_rgba[4])
251 const float color[4] = {0.0f, 0.0f, 1.0f, 1.0f * alpha};
265 const short handle_type)
276 const float xco =
x + (
w / 2.0f);
277 const float yco =
y + (h / 2.0f);
282 format,
"pos", blender::gpu::VertAttrType::SFLOAT_32_32);
284 format,
"size", blender::gpu::VertAttrType::SFLOAT_32);
286 format,
"color", blender::gpu::VertAttrType::UNORM_8_8_8_8);
288 format,
"outlineColor", blender::gpu::VertAttrType::UNORM_8_8_8_8);
290 format,
"flags", blender::gpu::VertAttrType::UINT_32);
324 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
330 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
336 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
342 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
348 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
354 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
360 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
366 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
372 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
378 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
384 float x,
float y,
float w,
float h,
float alpha,
const uchar * )
390 int socket_type,
float x,
float y,
float w,
float h,
float )
396 const float socket_radius =
w * 0.5f * size_factor;
399 center.x - socket_radius,
400 center.x + socket_radius,
401 center.y - socket_radius,
402 center.y + socket_radius,
405 float color_inner[4];
408 float color_outer[4] = {0};
410 color_outer[3] = 1.0f;
426 const int a =
x +
w / 3;
427 const int b =
x +
w / 3 * 2;
450# define DEF_ICON_VECTOR_COLORSET_DRAW_NTH(prefix, index) \
451 static void vicon_colorset_draw_##prefix( \
452 float x, float y, float w, float h, float alpha, const uchar * ) \
454 vicon_colorset_draw(index, int(x), int(y), int(w), int(h), alpha); \
478# undef DEF_ICON_VECTOR_COLORSET_DRAW_NTH
481 short color_tag,
float x,
float y,
float w,
float ,
float )
499# define DEF_ICON_STRIP_COLOR_DRAW(index, color) \
500 static void vicon_strip_color_draw_##index( \
501 float x, float y, float w, float h, float alpha, const uchar * ) \
503 vicon_strip_color_draw(color, x, y, w, h, alpha); \
516# undef DEF_ICON_STRIP_COLOR_DRAW
518# define ICON_INDIRECT_DATA_ALPHA 0.6f
521 float x,
float y,
float w,
float ,
float alpha,
const uchar * )
527 ICON_LIBRARY_DATA_DIRECT,
537 float x,
float y,
float w,
float ,
float alpha,
const uchar * )
543 ICON_LIBRARY_DATA_OVERRIDE,
553 short color_tag,
float x,
float y,
float w,
float ,
float )
562 ICON_GREASEPENCIL_LAYER_GROUP,
566 layergroup_color->
color,
571# define DEF_ICON_LAYERGROUP_COLOR_DRAW(index, color) \
572 static void vicon_layergroup_color_draw_##index( \
573 float x, float y, float w, float h, float alpha, const uchar * ) \
575 vicon_layergroup_color_draw(color, x, y, w, h, alpha); \
587# undef DEF_ICON_LAYERGROUP_COLOR_DRAW
589# define DEF_ICON_NODE_SOCKET_DRAW(name, socket_type) \
590 static void icon_node_socket_draw_##name( \
591 float x, float y, float w, float h, float alpha, const uchar * ) \
593 icon_node_socket_draw(socket_type, x, y, w, h, alpha); \
660 return ICON_MOUSE_LMB_2X;
662 return (event_value ==
KM_PRESS_DRAG) ? ICON_MOUSE_LMB_DRAG : ICON_MOUSE_LMB;
665 return (event_value ==
KM_PRESS_DRAG) ? ICON_MOUSE_MMB_DRAG : ICON_MOUSE_MMB;
668 return (event_value ==
KM_PRESS_DRAG) ? ICON_MOUSE_MMB_DRAG : ICON_MOUSE_RMB;
677 memset(r_icon_mod, 0x0,
sizeof(
int[
KM_MOD_NUM]));
680 r_icon_mod[
i++] = ICON_EVENT_CTRL;
683 r_icon_mod[
i++] = ICON_EVENT_ALT;
686 r_icon_mod[
i++] = ICON_EVENT_SHIFT;
689 r_icon_mod[
i++] = ICON_EVENT_OS;
692 r_icon_mod[
i++] = ICON_EVENT_HYPER;
702# define INIT_EVENT_ICON(icon_id, type, value) \
704 DrawInfo *di = def_internal_icon(nullptr, icon_id, 0, 0, w, ICON_TYPE_EVENT, 0); \
705 di->data.input.event_type = type; \
706 di->data.input.event_value = value; \
707 di->data.input.icon = icon_id; \
708 di->data.input.next = di_next; \
890# undef INIT_EVENT_ICON
904 if (bbuf->
x != iimg->
h && bbuf->
y != iimg->
w) {
916 for (
int x = ICON_NONE;
x < ICON_BLANK_LAST_SVG_ITEM;
x++) {
1019 if (di ==
nullptr) {
1045 const int icon_data_type = icon->
obj_type;
1085 if (icon ==
nullptr) {
1095#ifndef WITH_HEADLESS
1121 CLOG_WARN(&
LOG,
"%s, error: requested preview image does not exist", __func__);
1128 prv_img->
w[
size] = render_size;
1129 prv_img->
h[
size] = render_size;
1152 icon->
obj =
nullptr;
1160 if (wm ==
nullptr) {
1191 if (icon ==
nullptr) {
1197 if (di ==
nullptr) {
1203 ID *
id = (icon->
id_type != 0) ?
static_cast<ID *
>(icon->
obj) :
nullptr;
1213 if (
id || prv->
runtime->deferred_loading_data) {
1237 "Generating StudioLight icon...",
1257 if (icon ==
nullptr) {
1267 const ID *
id = (icon->
id_type != 0) ?
static_cast<ID *
>(icon->
obj) :
nullptr;
1295 CLOG_WARN(&
LOG,
"%s: no preview image for this ID: %s", __func__, id->
name);
1305 const bool delay = prv_img->
rect[
size] !=
nullptr;
1325 if (icon ==
nullptr) {
1331 if (di ==
nullptr) {
1355 prv->
w[0] = bbuf->
x;
1356 prv->
h[0] = bbuf->
y;
1373 const uint8_t *rect,
1375 const float desaturate)
1384 if (
w <= 0 || h <= 0 || w > 2000 || h > 2000) {
1385 printf(
"%s: icons are %i x %i pixels?\n", __func__,
w, h);
1390 const float col[4] = {alpha, alpha, alpha, alpha};
1392 float scale_x = 1.0f;
1393 float scale_y = 1.0f;
1395 if (rw !=
w || rh != h) {
1399 draw_h = int((
float(rh) /
float(rw)) *
float(
w));
1400 draw_y += (h - draw_h) / 2;
1403 draw_w = int((
float(rw) /
float(rh)) *
float(h));
1405 draw_x += (
w - draw_w) / 2;
1407 scale_x = draw_w /
float(rw);
1408 scale_y = draw_h /
float(rh);
1414 if (desaturate != 0.0f) {
1431 blender::gpu::TextureFormat::UNORM_8_8_8_8,
1455 const std::string &
name,
1461 uchar white[] = {255, 255, 255, 255};
1462 uchar black[] = {0, 0, 0, 255};
1463 uchar logo_orange[] = {232, 125, 13, 255};
1464 uchar logo_blue[] = {38, 87, 135, 255};
1467 uchar tool_add[] = {117, 255, 175, 255};
1468 uchar tool_remove[] = {245, 107, 91, 255};
1469 uchar tool_select[] = {255, 176, 43, 255};
1470 uchar tool_transform[] = {217, 175, 245, 255};
1471 uchar tool_white[] = {255, 255, 255, 255};
1472 uchar tool_red[] = {214, 45, 48, 255};
1474 const struct ColorItem {
1480 {
"blender_white", white},
1481 {
"blender_black", black},
1482 {
"blender_logo_orange", logo_orange},
1483 {
"blender_logo_blue", logo_blue},
1486 {
"blender_back",
nullptr,
TH_BACK},
1487 {
"blender_text",
nullptr,
TH_TEXT},
1489 {
"blender_red_alert",
nullptr,
TH_ERROR},
1490 {
"blender_error",
nullptr,
TH_ERROR},
1492 {
"blender_info",
nullptr,
TH_INFO},
1510 {
"blender_tool_add", tool_add},
1511 {
"blender_tool_remove", tool_remove},
1512 {
"blender_tool_select", tool_select},
1513 {
"blender_tool_transform", tool_transform},
1514 {
"blender_tool_white", tool_white},
1515 {
"blender_tool_red", tool_red},
1516 {
"blender_bevel",
nullptr,
TH_BEVEL},
1518 {
"blender_seam",
nullptr,
TH_SEAM},
1519 {
"blender_sharp",
nullptr,
TH_SHARP},
1522 for (
const ColorItem &item : items) {
1523 if (
name != item.name) {
1529 memcpy(color, item.col,
sizeof(color));
1543 std::string hexcolor = fmt::format(
1544 "{:02x}{:02x}{:02x}{:02x}", color[0], color[1], color[2], color[3]);
1546 size_t att_start = start;
1549 att_start = svg.
find(key, att_start);
1550 if (att_start == std::string::npos || att_start > end) {
1553 const size_t att_end = svg.find(
"\"", att_start + key.
size());
1554 if (att_end != std::string::npos && att_end < end) {
1555 svg.replace(att_start, att_end - att_start, key +
"#" + hexcolor);
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 - att_start < end) {
1569 svg.replace(att_start, att_end - att_start, key +
"#" + hexcolor);
1585 const size_t id_start = svg.
find(key +
"blender_", g_start);
1586 if (id_start == std::string::npos) {
1591 g_start = svg.rfind(
"<g", id_start);
1592 if (g_start == std::string::npos) {
1598 const size_t g_end = svg.find(
"</g>", id_start);
1599 if (g_end == std::string::npos) {
1605 const size_t id_end = svg.find(
"\"", id_start + key.
size());
1606 if (id_end != std::string::npos) {
1607 std::string id_name = svg.substr(id_start + key.
size(), id_end - id_start - key.
size());
1623 const float desaturate,
1624 const uchar mono_rgba[4],
1625 const bool mono_border,
1627 const bool inverted =
false)
1629 if (icon_id == ICON_NONE) {
1634 const float fdraw_size =
float(draw_size);
1638 if (icon ==
nullptr) {
1640 CLOG_WARN(&
LOG,
"%s: Internal error, no icon for icon ID: %d", __func__, icon_id);
1642 icon_id = ICON_NOT_FOUND;
1652 int w = int(fdraw_size / aspect + 0.5f);
1653 int h = int(fdraw_size / aspect + 0.5f);
1671 x,
y,
float(draw_size) / aspect,
float(draw_size) / aspect, alpha, mono_rgba);
1674#ifdef USE_UI_TOOLBAR_HACK
1679 y = (
y + (h / 2)) - ((h * scale) / 2);
1692 if ((ibuf ==
nullptr) || (ibuf->
x !=
w) || (ibuf->
y != h) || (
invert != geom_inverted)) {
1696 if (
invert != geom_inverted) {
1713 const float outline_intensity = mono_border ?
1722 if (icon_id == ICON_NOT_FOUND) {
1725 else if (mono_rgba) {
1738 float(draw_size) / aspect,
1748 float(draw_size) / aspect,
1755 if (text_overlay && text_overlay->
text[0] !=
'\0') {
1757 uchar text_color[4];
1758 if (text_overlay->
color[3]) {
1767 fstyle_small.
points *= zoom_factor * 0.8f;
1769 fstyle_small.
shadx = 0;
1770 fstyle_small.
shady = 0;
1776 sizeof(text_overlay->
text),
1785#ifndef WITH_HEADLESS
1801 if (!pi->rect[
size]) {
1814 reinterpret_cast<const uint8_t *
>(pi->rect[
size]),
1824#ifndef WITH_HEADLESS
1856 if (pi ==
nullptr) {
1860 ID *id_to_render = id;
1866 id_to_render =
static_cast<ID *
>(ob->
data);
1931 return ICON_PACKAGE;
1934 return ICON_LIBRARY_DATA_BROKEN;
1937 return ICON_LIBRARY_DATA_INDIRECT;
1939 return ICON_LIBRARY_DATA_DIRECT;
1945 return ICON_LIBRARY_DATA_OVERRIDE_NONEDITABLE;
1947 return ICON_LIBRARY_DATA_OVERRIDE;
1950 return ICON_ASSET_MANAGER;
1981 return ICON_SHADING_TEXTURE;
1984 return ICON_OUTLINER_DATA_MESH;
1987 return ICON_FILE_IMAGE;
2007 return icon ? icon : rnaicon;
2019 return ICON_ARMATURE_DATA;
2021 return ICON_BRUSH_DATA;
2023 return ICON_CAMERA_DATA;
2027 return ICON_CURVE_DATA;
2029 return ICON_OUTLINER_DATA_GREASEPENCIL;
2033 return ICON_IMAGE_DATA;
2035 return ICON_LIGHT_DATA;
2037 return ICON_LINE_DATA;
2039 return ICON_LATTICE_DATA;
2041 return ICON_MATERIAL_DATA;
2043 return ICON_META_DATA;
2045 return ICON_TRACKER;
2047 return ICON_MESH_DATA;
2049 return ICON_MOD_MASK;
2051 return ICON_NODETREE;
2053 return ICON_OBJECT_DATA;
2055 return ICON_PARTICLE_DATA;
2059 return ICON_CURVE_BEZCURVE;
2061 return ICON_OUTLINER_DATA_LIGHTPROBE;
2063 return ICON_SCENE_DATA;
2065 return ICON_SPEAKER;
2069 return ICON_TEXTURE_DATA;
2073 return ICON_FONT_DATA;
2075 return ICON_CURVES_DATA;
2077 return ICON_POINTCLOUD_DATA;
2079 return ICON_VOLUME_DATA;
2081 return ICON_WORLD_DATA;
2083 return ICON_WORKSPACE;
2085 return ICON_OUTLINER_DATA_GREASEPENCIL;
2087 return ICON_SHAPEKEY_DATA;
2102 return ICON_OBJECT_DATAMODE;
2105 return ICON_EDITMODE_HLT;
2109 return ICON_SCULPTMODE_HLT;
2112 return ICON_VPAINT_HLT;
2115 return ICON_WPAINT_HLT;
2117 return ICON_TPAINT_HLT;
2119 return ICON_PARTICLEMODE;
2121 return ICON_POSE_HLT;
2123 return ICON_GREASEPENCIL;
2130 int icon = ICON_OUTLINER_COLLECTION;
2133 icon = ICON_COLLECTION_COLOR_01 + collection->
color_tag;
2172 const uchar mono_color[4],
2173 const bool mono_border,
2175 const bool inverted)
2194 if (icon_id >= ICON_BLANK_LAST_SVG_ITEM) {
2198 ImBuf *ibuf =
nullptr;
2225 const int icon_indicator_number)
2228 if (icon_indicator_number < 2) {
2229 text_overlay->
text[0] =
'\0';
2244 int icon_id = ICON_NONE;
2247 icon_id = ICON_WARNING_LARGE;
2250 icon_id = ICON_QUESTION_LARGE;
2253 icon_id = ICON_CANCEL_LARGE;
2256 icon_id = ICON_INFO_LARGE;
2259 icon_id = ICON_NONE;
2262 if (icon_id == ICON_NONE) {
void immDrawPixelsTexScaledFullSize(const IMMDrawPixelsTexState *state, float x, float y, int img_w, int img_h, blender::gpu::TextureFormat 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)
MINLINE 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)
#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)
@ 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(GPUBlend 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_GetThemeColorType4fv(int colorid, int spacetype, float 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
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
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)
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[]
#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_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(*)(float x, float y, float w, float h, float alpha, const uchar mono_rgba[4]) VectorDrawFunc
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)
struct DrawInfo::@174343100143157136005247000270365301316323002374::@310267162073377360366245154224166162202333214210 input
struct DrawInfo::@174343100143157136005247000270365301316323002374::@070253270022005015164200324257300377317141001225 geom
struct DrawInfo::@174343100143157136005247000270365301316323002374::@244254267001110344015224177260156342176164254057 vector
struct DrawInfo::@174343100143157136005247000270365301316323002374::@326304104246373005324033123270167073171034006264 texture
struct DrawInfo::@174343100143157136005247000270365301316323002374::@231007212013237070324244017363001002354036144376 buffer
union DrawInfo::@174343100143157136005247000270365301316323002374 data
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))