Blender V5.3
BKE_studiolight.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2006-2007 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
12
13#include <string>
14
15#include "DNA_listBase.h"
16
17#include "BLI_sys_types.hh"
18
19#include "BLI_path_utils.hh"
20
21#include "DNA_userdef_types.h" /* for #SolidLight */
22
23namespace blender {
24
25struct ImBuf;
26
27#define STUDIOLIGHT_ICON_ID_TYPE_RADIANCE (1 << 0)
28#define STUDIOLIGHT_ICON_ID_TYPE_IRRADIANCE (1 << 1)
29#define STUDIOLIGHT_ICON_ID_TYPE_MATCAP (1 << 2)
30#define STUDIOLIGHT_ICON_ID_TYPE_MATCAP_FLIPPED (1 << 3)
31
32#define STUDIOLIGHT_MAX_LIGHT 4
33
34#define STUDIOLIGHT_ICON_SIZE 96
35
36namespace gpu {
37class Texture;
38} // namespace gpu
39struct StudioLight;
40
58
59#define STUDIOLIGHT_FLAG_ALL (STUDIOLIGHT_INTERNAL | STUDIOLIGHT_EXTERNAL_FILE)
60#define STUDIOLIGHT_FLAG_ORIENTATIONS \
61 (STUDIOLIGHT_TYPE_STUDIO | STUDIOLIGHT_TYPE_WORLD | STUDIOLIGHT_TYPE_MATCAP)
62#define STUDIOLIGHT_ORIENTATIONS_MATERIAL_MODE (STUDIOLIGHT_TYPE_WORLD)
63#define STUDIOLIGHT_ORIENTATIONS_SOLID (STUDIOLIGHT_INTERNAL | STUDIOLIGHT_TYPE_STUDIO)
64
65typedef void StudioLightFreeFunction(struct StudioLight *, void *data);
66
71
74
75 int index;
76 int flag;
89 float light_ambient[3];
90
91 /*
92 * Free function to clean up the running icons previews (wmJob) the usage is in
93 * interface_icons. Please be aware that this was build to handle only one free function
94 * that cleans up all icons. just to keep the code simple.
95 */
98};
99
100/* API */
101
104void BKE_studiolight_default(SolidLight lights[4], float light_ambient[3]);
105struct StudioLight *BKE_studiolight_find(const char *name, int flag);
106struct StudioLight *BKE_studiolight_findindex(int index, int flag);
108void BKE_studiolight_preview(uint *icon_buffer, StudioLight *sl, int icon_id_type);
109ListBaseT<StudioLight> &BKE_studiolight_listbase();
113void BKE_studiolight_ensure_flag(StudioLight *sl, int flag);
115StudioLight *BKE_studiolight_load(const char *filepath, int type);
116StudioLight *BKE_studiolight_create(const char *filepath,
117 const SolidLight light[4],
118 const float light_ambient[3]);
125 StudioLightFreeFunction *free_function,
126 void *data);
127void BKE_studiolight_unset_icon_id(StudioLight *sl, int icon_id);
128
129} // namespace blender
#define STUDIOLIGHT_MAX_LIGHT
#define FILE_MAXFILE
#define FILE_MAX
These structs are the foundation for all linked lists in the library system.
BMesh Iterators.
void BKE_studiolight_preview(uint *icon_buffer, StudioLight *sl, int icon_id_type)
StudioLight * BKE_studiolight_create(const char *filepath, const SolidLight light[4], const float light_ambient[3])
@ STUDIOLIGHT_INTERNAL
@ STUDIOLIGHT_EXTERNAL_FILE
@ STUDIOLIGHT_USER_DEFINED
@ STUDIOLIGHT_TYPE_MATCAP
@ STUDIOLIGHT_MATCAP_SPECULAR_GPUTEXTURE
@ STUDIOLIGHT_TYPE_STUDIO
@ STUDIOLIGHT_MATCAP_DIFFUSE_GPUTEXTURE
@ STUDIOLIGHT_EQUIRECT_RADIANCE_GPUTEXTURE
@ STUDIOLIGHT_SPECULAR_HIGHLIGHT_PASS
@ STUDIOLIGHT_TYPE_WORLD
@ STUDIOLIGHT_EXTERNAL_IMAGE_LOADED
void BKE_studiolight_init()
unsigned int uint
Definition BKE_text.h:55
void BKE_studiolight_ensure_flag(StudioLight *sl, int flag)
void BKE_studiolight_refresh()
void BKE_studiolight_free()
void BKE_studiolight_unset_icon_id(StudioLight *sl, int icon_id)
void BKE_studiolight_set_free_function(StudioLight *sl, StudioLightFreeFunction *free_function, void *data)
void BKE_studiolight_default(SolidLight lights[4], float light_ambient[3])
struct StudioLight * BKE_studiolight_findindex(int index, int flag)
struct StudioLight * BKE_studiolight_find(const char *name, int flag)
ListBaseT< StudioLight > & BKE_studiolight_listbase()
BMesh const char void * data
void BKE_studiolight_remove(StudioLight *sl)
struct StudioLight * BKE_studiolight_find_default(int flag)
void StudioLightFreeFunction(struct StudioLight *, void *data)
StudioLight * BKE_studiolight_load(const char *filepath, int type)
StudioLight * BKE_studiolight_studio_edit_get()
StudioLightImage matcap_specular
struct StudioLight * prev
StudioLightImage matcap_diffuse
std::string equirect_working_space
char name[FILE_MAXFILE]
gpu::Texture * equirect_radiance_gputexture
struct ImBuf * equirect_radiance_buffer
SolidLight light[STUDIOLIGHT_MAX_LIGHT]
struct StudioLight * next
StudioLightFreeFunction * free_function
char filepath[FILE_MAX]