From 1287fa3f7c5a0dc4484aa7e94267d21cc8b0b1f0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 23 Apr 2018 20:16:32 +0200 Subject: UI: option to load icon from file --- source/blender/blenkernel/BKE_icons.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel/BKE_icons.h') diff --git a/source/blender/blenkernel/BKE_icons.h b/source/blender/blenkernel/BKE_icons.h index fb40e5be281..ffcbd231524 100644 --- a/source/blender/blenkernel/BKE_icons.h +++ b/source/blender/blenkernel/BKE_icons.h @@ -65,8 +65,11 @@ struct Icon { struct Icon_Geom { int icon_id; int coords_len; + int coords_range[2]; const unsigned char (*coords)[2]; const unsigned char (*colors)[4]; + /* when not NULL, the memory of coords and colors is a sub-region of this pointer. */ + const void *mem; }; typedef struct Icon Icon; @@ -84,8 +87,6 @@ int BKE_icon_id_ensure(struct ID *id); int BKE_icon_preview_ensure(struct ID *id, struct PreviewImage *preview); -int BKE_icon_geom_ensure(struct Icon_Geom *geom); - /* retrieve icon for id */ struct Icon *BKE_icon_get(const int icon_id); @@ -149,6 +150,9 @@ struct PreviewImage *BKE_previewimg_cached_thumbnail_read( void BKE_previewimg_cached_release(const char *name); void BKE_previewimg_cached_release_pointer(struct PreviewImage *prv); +int BKE_icon_geom_ensure(struct Icon_Geom *geom); +struct Icon_Geom *BKE_icon_geom_from_file(const char *filename); + struct ImBuf *BKE_icon_geom_rasterize( const struct Icon_Geom *geom, const unsigned int size_x, const unsigned int size_y); -- cgit v1.2.3