Blender V5.3
BKE_icons.hh File Reference
#include <optional>
#include "BLI_compiler_attrs.hh"
#include "BLI_span.hh"
#include "BLI_sys_types.hh"
#include "DNA_ID_enums.h"

Go to the source code of this file.

Classes

struct  blender::Icon
struct  blender::Icon_Geom
struct  blender::IconBufferRef

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define ICON_RENDER_DEFAULT_HEIGHT   32

Typedefs

typedef void(*) blender::DrawInfoFreeFP(void *drawinfo)

Enumerations

enum  {
  blender::ICON_DATA_ID = 0 , blender::ICON_DATA_IMBUF , blender::ICON_DATA_PREVIEW , blender::ICON_DATA_GEOM ,
  blender::ICON_DATA_STUDIOLIGHT , blender::ICON_DATA_GPLAYER
}

Functions

void blender::BKE_icons_init (int first_dyn_id)
int blender::BKE_icon_id_ensure (ID *id)
int blender::BKE_icon_gplayer_color_ensure (bGPDlayer *gpl)
int blender::BKE_icon_preview_ensure (ID *id, PreviewImage *preview)
int blender::BKE_icon_imbuf_create (ImBuf *ibuf) ATTR_WARN_UNUSED_RESULT
ImBuf * blender::BKE_icon_imbuf_get_buffer (int icon_id) ATTR_WARN_UNUSED_RESULT
bool blender::BKE_icon_is_imbuf (int icon_id) ATTR_WARN_UNUSED_RESULT
std::optional< IconBufferRef > blender::BKE_icon_get_buffer (int icon_id, eIconSizes size)
Icon * blender::BKE_icon_get (int icon_id)
void blender::BKE_icon_set (int icon_id, Icon *icon)
void blender::BKE_icon_id_delete (ID *id)
bool blender::BKE_icon_delete (int icon_id)
bool blender::BKE_icon_delete_unmanaged (int icon_id)
void blender::BKE_icon_changed (int icon_id)
void blender::BKE_icons_free ()
void blender::BKE_icons_deferred_free ()
ImBuf * blender::BKE_icon_geom_rasterize (const Icon_Geom *geom, unsigned int size_x, unsigned int size_y)
void blender::BKE_icon_geom_invert_lightness (Icon_Geom *geom)
Geometry Icon
int blender::BKE_icon_geom_ensure (Icon_Geom *geom)
Icon_Geom * blender::BKE_icon_geom_from_memory (uchar *data, size_t data_len)
Icon_Geom * blender::BKE_icon_geom_from_file (const char *filename)
Studio Light Icon
int blender::BKE_icon_ensure_studio_light (StudioLight *sl, int id_type)

Detailed Description

Resizable Icons for Blender

There is some thread safety for this API but it is rather weak. Registering or unregistering icons is thread safe, changing data of icons from multiple threads is not. Practically this should be fine since only the main thread modifies icons. Should that change, more locks or a different design need to be introduced.

Definition in file BKE_icons.hh.

Macro Definition Documentation

◆ ICON_RENDER_DEFAULT_HEIGHT

#define ICON_RENDER_DEFAULT_HEIGHT   32