40#define DNA_DEPRECATED_ALLOW
123 memset(&
image->runtime, 0,
sizeof(
image->runtime));
134 image->runtime.partial_update_register =
nullptr;
135 image->runtime.partial_update_user =
nullptr;
137 image->runtime.backdrop_offset[0] = 0.0f;
138 image->runtime.backdrop_offset[1] = 0.0f;
145 image->runtime.cache_mutex =
nullptr;
147 if (
image->runtime.partial_update_user !=
nullptr) {
149 image->runtime.partial_update_user =
nullptr;
158 if (
image !=
nullptr) {
164 std::optional<Library *> ,
170 const Image *image_src = (
const Image *)id_src;
182 image_dst->
cache =
nullptr;
183 image_dst->
rr =
nullptr;
187 slot->render =
nullptr;
195 for (
int eye = 0; eye < 2; eye++) {
223 slot->render =
nullptr;
248 function_callback(
id, &key, (
void **)&
image->cache, 0, user_data);
251 function_callback(
id, &key, (
void **)&
image->anims.first, 0, user_data);
253 function_callback(
id, &key, (
void **)&
image->anims.last, 0, user_data);
255 auto gputexture_offset = [
image](
int target,
int eye) {
257 GPUTexture **first = &
image->gputexture[0][0];
258 const size_t array_offset =
sizeof(*first) * (&
image->gputexture[target][eye] - first);
259 return base_offset + array_offset;
262 for (
int eye = 0; eye < 2; eye++) {
269 function_callback(
id, &key, (
void **)&
image->gputexture[a][eye], 0, user_data);
274 function_callback(
id, &key, (
void **)&
image->rr, 0, user_data);
278 function_callback(
id, &key, (
void **)&slot->render, 0, user_data);
347 ima->
cache =
nullptr;
352 for (
int i = 0; i < 3; i++) {
353 for (
int j = 0; j < 2; j++) {
393 ima->packedfile =
nullptr;
415 if (!imapf->packedfile) {
420 ima->packedfile =
nullptr;
445 if (ima->
cache ==
nullptr) {
487 Image *ima,
ImageUser *iuser,
int entry,
int cfra,
bool is_sequence);
493#define IMA_NO_INDEX 0x7FEFEFEF
496#define IMA_MAKE_INDEX(entry, index) (((entry) << 10) + (index))
497#define IMA_INDEX_ENTRY(index) ((index) >> 10)
499# define IMA_INDEX_PASS(index) (index & ~1023)
523 return (a->
index !=
b->index);
539 if (
image->cache ==
nullptr) {
555 if (
image->cache ==
nullptr) {
585 image->cache =
nullptr;
658 tile->tile_number = tile_number;
683 for (
int i = 0; i < 8; i++) {
691 ima->
stereo3d_format = MEM_cnew<Stereo3dFormat>(
"Image Stereo Format");
695 std::optional<Library *> owner_library,
720 bool *r_is_cached_empty)
752 imapf_src = imapf_src->
next)
772 if (dest && source && dest != source) {
776 if (source->
cache !=
nullptr) {
777 MovieCacheIter *iter;
812 return (ibuf !=
nullptr);
817 for (
int eye = 0; eye < 2; eye++) {
831 return (iuser && iuser->
tile) ? iuser->
tile :
tile->tile_number;
836 if (ima ==
nullptr) {
842 if (
ELEM(tile_number, 0, 1001)) {
852 if (
tile->tile_number == tile_number) {
868 if (r_ofs ==
nullptr) {
881 int tile_number = 1001 + 10 * iy + ix;
937 const float best_uv[2],
941 if (best_dist_sq == dist_sq) {
942 if (best_uv[0] == uv[0]) {
943 return (uv[1] > best_uv[1]);
945 return (uv[0] > best_uv[0]);
947 return (dist_sq < best_dist_sq);
952 float r_uv_offset[2])
957 int tile_number_best = -1;
960 return tile_number_best;
974 if (
floorf(co[0]) == uv_offset[0] &&
floorf(co[1]) == uv_offset[1]) {
977 return tile_number_best;
983 dist_best_sq = dist_sq;
985 tile_number_best =
tile->tile_number;
988 return tile_number_best;
993 float uv_offset_dummy[2];
1041 const char *filepath,
1042 char *r_filepath_abs)
1045 if (owner_library) {
1059 std::optional<Library *> owner_library,
1060 const char *filepath)
1101 std::optional<Library *> owner_library,
1102 const char *filepath,
1128 if (ima->
id.
lib != owner_lib) {
1160 const short gen_type = usersata->
gen_type;
1183 uchar *rect =
nullptr;
1184 float *rect_float =
nullptr;
1185 float fill_color[4];
1198 if (ibuf !=
nullptr) {
1222 if (ibuf !=
nullptr) {
1246 data.rect_float = rect_float;
1261 const float color[4],
1262 const bool stereo3d,
1274 if (ima ==
nullptr) {
1287 tile->gen_x = width;
1288 tile->gen_y = height;
1289 tile->gen_type = gen_type;
1291 tile->gen_depth = depth;
1299 for (view_id = 0; view_id < 2; view_id++) {
1303 int entry = tiled ? 1001 : 0;
1320 const char *colorspace_name =
nullptr;
1340 if (colorspace_name) {
1341 STRNCPY(
image->colorspace_settings.name, colorspace_name);
1347 if (name ==
nullptr) {
1397 Image *ima,
ImBuf *ibuf,
int view,
int tile_number,
const char *filepath)
1443 int entry = is_tiled ?
tile->tile_number : 0;
1450 const char *filepath = ibuf->
filepath;
1454 filepath = tiled_filepath;
1456 else if (is_multiview) {
1526 const size_t data_len)
1530 if (tot_viewfiles != 1) {
1531 BKE_report(reports,
RPT_ERROR,
"Cannot pack multiview images from raw data currently...");
1563 if (
image->cache !=
nullptr) {
1569 if (ibuf ==
nullptr) {
1599 printf(
"\ntotal image memory len: %.3f MB\n",
double(totsize) /
double(1024 * 1024));
1607 printf(
"%s len: %.3f MB\n", ima->
id.
name + 2,
double(
size) /
double(1024 * 1024));
1614 if (ibuf ==
nullptr) {
1622#undef CHECK_FREED_SIZE
1626#ifdef CHECK_FREED_SIZE
1648#ifdef CHECK_FREED_SIZE
1654#ifdef CHECK_FREED_SIZE
1659#ifdef CHECK_FREED_SIZE
1660 printf(
"%s: freed total %lu MB\n", __func__, tot_freed_size / (1024 * 1024));
1666 if (ibuf ==
nullptr) {
1669 int except_frame = *(
int *)userdata;
1677 if (ima->
cache !=
nullptr) {
1702#define STAMP_NAME_SIZE ((MAX_ID_NAME - 2) + 16)
1736#undef STAMP_NAME_SIZE
1752 do_prefix ?
"File %s" :
"%s",
1753 (blendfile_path[0] !=
'\0') ? blendfile_path :
"<untitled>");
1756 stamp_data->
file[0] =
'\0';
1764 stamp_data->
note[0] =
'\0';
1771 "%04d/%02d/%02d %02d:%02d:%02d",
1778 SNPRINTF(stamp_data->
date, do_prefix ?
"Date %s" :
"%s", text);
1781 stamp_data->
date[0] =
'\0';
1794 SNPRINTF(stamp_data->
marker, do_prefix ?
"Marker %s" :
"%s", text);
1797 stamp_data->
marker[0] =
'\0';
1804 SNPRINTF(stamp_data->
time, do_prefix ?
"Timecode %s" :
"%s", text);
1807 stamp_data->
time[0] =
'\0';
1814 if (scene->
r.
efra > 9) {
1818 SNPRINTF(fmtstr, do_prefix ?
"Frame %%0%di" :
"%%0%di", digits);
1822 stamp_data->
frame[0] =
'\0';
1827 do_prefix ?
"Frame Range %d:%d" :
"%d:%d",
1837 do_prefix ?
"Camera %s" :
"%s",
1841 stamp_data->
camera[0] =
'\0';
1862 stamp_data->
scene[0] =
'\0';
1875 SNPRINTF(stamp_data->
strip, do_prefix ?
"Strip %s" :
"%s", text);
1878 stamp_data->
strip[0] =
'\0';
1898 stamp_data->
memory[0] =
'\0';
1903 do_prefix ?
"Frame Range %d:%d" :
"%d:%d",
1914 SNPRINTF(stamp_data->
hostname, do_prefix ?
"Hostname %s" :
"%s", hostname);
1927 SNPRINTF(stamp_data->
file, do_prefix ?
"File %s" :
"%s", stamp_data_template->
file);
1930 stamp_data->
file[0] =
'\0';
1936 stamp_data->
note[0] =
'\0';
1939 SNPRINTF(stamp_data->
date, do_prefix ?
"Date %s" :
"%s", stamp_data_template->
date);
1942 stamp_data->
date[0] =
'\0';
1948 stamp_data->
marker[0] =
'\0';
1951 SNPRINTF(stamp_data->
time, do_prefix ?
"Timecode %s" :
"%s", stamp_data_template->
time);
1954 stamp_data->
time[0] =
'\0';
1957 SNPRINTF(stamp_data->
frame, do_prefix ?
"Frame %s" :
"%s", stamp_data_template->
frame);
1960 stamp_data->
frame[0] =
'\0';
1964 do_prefix ?
"Frame Range %s" :
"%s",
1974 stamp_data->
camera[0] =
'\0';
1984 SNPRINTF(stamp_data->
scene, do_prefix ?
"Scene %s" :
"%s", stamp_data_template->
scene);
1987 stamp_data->
scene[0] =
'\0';
1990 SNPRINTF(stamp_data->
strip, do_prefix ?
"Strip %s" :
"%s", stamp_data_template->
strip);
1993 stamp_data->
strip[0] =
'\0';
1997 do_prefix ?
"RenderTime %s" :
"%s",
2004 SNPRINTF(stamp_data->
memory, do_prefix ?
"Peak Memory %s" :
"%s", stamp_data_template->
memory);
2007 stamp_data->
memory[0] =
'\0';
2011 stamp_data->
hostname, do_prefix ?
"Hostname %s" :
"%s", stamp_data_template->
hostname);
2032 const char *display_device;
2043#define TEXT_SIZE_CHECK(str, w, h) \
2044 ((str[0]) && ((void)(h = h_fixed), (w = int(BLF_width(mono, str, sizeof(str))))))
2047#define TEXT_SIZE_CHECK_WORD_WRAP(str, w, h) \
2048 ((str[0]) && (BLF_boundbox(mono, str, sizeof(str), &wrap.rect, &wrap.info), \
2049 (void)(h = h_fixed * wrap.info.lines), \
2050 (w = BLI_rcti_size_x(&wrap.rect))))
2052#define BUFF_MARGIN_X 2
2053#define BUFF_MARGIN_Y 1
2055 if (!rect && !rectf) {
2063 if (stamp_data_template ==
nullptr) {
2079 BLF_buffer(mono, rectf, rect, width, height, display);
2383 x = width -
w -
pad;
2403 BLF_buffer(mono,
nullptr,
nullptr, 0, 0,
nullptr);
2406#undef TEXT_SIZE_CHECK
2407#undef TEXT_SIZE_CHECK_WORD_WRAP
2424 stamp_data = MEM_cnew<StampData>(
"RenderResult.stamp_data");
2430 if (!allocate_only) {
2449 stamp_data = MEM_cnew<StampData>(__func__);
2450 stampdata(scene,
nullptr, stamp_data, 0,
false);
2490 if ((callback ==
nullptr) || (stamp_data ==
nullptr)) {
2494#define CALL(member, value_str) \
2495 if (noskip || stamp_data->member[0]) { \
2496 callback(data, value_str, stamp_data->member, sizeof(stamp_data->member)); \
2505 CALL(marker,
"Marker");
2507 CALL(frame,
"Frame");
2508 CALL(frame_range,
"FrameRange");
2510 CALL(cameralens,
"Lens");
2511 CALL(scene,
"Scene");
2512 CALL(strip,
"Strip");
2513 CALL(rendertime,
"RenderTime");
2514 CALL(memory,
"Memory");
2515 CALL(hostname,
"Hostname");
2518 if (noskip || custom_field->value[0]) {
2519 callback(
data, custom_field->key, custom_field->value, strlen(custom_field->value) + 1);
2547 rr->
stamp_data = MEM_cnew<StampData>(
"RenderResult.stamp_data");
2559 if (stamp_data ==
nullptr) {
2567 custom_fieldn->value =
static_cast<char *
>(
MEM_dupallocN(custom_fieldn->value));
2575 if (stamp_data ==
nullptr) {
2587 const char *propname,
2597 const char *propname,
2599 int propvalue_maxncpy)
2625 rr->
stamp_data = MEM_cnew<StampData>(
"RenderResult.stamp_data");
2639 for (tot = ibuf->
x * ibuf->
y; tot--; buf += 4) {
2640 if (buf[3] < 1.0f) {
2647 for (tot = ibuf->
x * ibuf->
y; tot--; buf += 4) {
2648 if (buf[3] != 255) {
2672 const char *filepath,
2674 const bool save_copy)
2676 ImBuf ibuf_back = *ibuf;
2697 const char *filepath,
2714 anim =
IMB_open_anim(filepath, flags, streamindex, colorspace);
2726 anim =
IMB_open_anim(filepath, flags, streamindex, colorspace);
2727 if (anim ==
nullptr) {
2732 if (ibuf ==
nullptr) {
2735 reason =
"file doesn't exist";
2738 reason =
"not an anim";
2740 CLOG_INFO(&
LOG, 1,
"unable to load anim, %s: %s", reason, filepath);
2781 if (ima->
type == type) {
2787 if (ima ==
nullptr) {
2792 if (ima->
id.
us == 0) {
2829 if (is_multiview && !do_reset) {
2859 void callback(
Image *ima,
ID *iuser_id,
ImageUser *iuser,
void *customdata))
2861 switch (ntree->
type) {
2863 for (
bNode *node : ntree->all_nodes()) {
2868 callback(ima,
id, &tex->
iuser, customdata);
2873 callback(ima,
id, &tex->
iuser, customdata);
2879 for (
bNode *node : ntree->all_nodes()) {
2883 callback(ima,
id, iuser, customdata);
2888 for (
bNode *node : ntree->all_nodes()) {
2892 callback(ima,
id, iuser, customdata);
2903 void callback(
Image *ima,
ID *iuser_id,
ImageUser *iuser,
void *customdata))
2909 if (gpu_material_texture->iuser_available) {
2910 callback(gpu_material_texture->ima,
id, &gpu_material_texture->iuser, customdata);
2918 bool skip_nested_nodes,
2920 void callback(
Image *ima,
ID *iuser_id,
ImageUser *iuser,
void *customdata))
2947 if (
world->nodetree &&
world->use_nodes && !skip_nested_nodes) {
2956 callback(tex->
ima, &tex->
id, &tex->
iuser, customdata);
2971 callback(bgpic->ima,
nullptr, &bgpic->iuser, customdata);
2983 callback(sima->
image,
nullptr, &sima->
iuser, customdata);
3004 void callback(
Image *ima,
ID *iuser_id,
ImageUser *iuser,
void *customdata))
3007 scene =
static_cast<Scene *
>(scene->id.next))
3013 ob =
static_cast<Object *
>(ob->id.next))
3025 ma =
static_cast<Material *
>(ma->id.next))
3031 light =
static_cast<Light *
>(light->id.next))
3043 tex =
static_cast<Tex *
>(tex->id.next))
3049 cam =
static_cast<Camera *
>(cam->id.next))
3063 Image *changed_image =
static_cast<Image *
>(customdata);
3077 Image *changed_image =
static_cast<Image *
>(customdata);
3079 if (ima == changed_image) {
3119 for (
int eye = 0; eye < 2; eye++) {
3130 for (
int i = 0; i < totviews; i++) {
3163 if (ima ==
nullptr) {
3188 if (base_tile->
gen_x == 0 || base_tile->
gen_y == 0) {
3191 base_tile->
gen_x = ibuf->
x;
3192 base_tile->
gen_y = ibuf->
y;
3272 imapf->packedfile =
pf;
3275 printf(
"ERROR: Image \"%s\" not available. Keeping packed image\n", imapf->filepath);
3289 ListBase new_tiles = {
nullptr,
nullptr};
3290 int new_start, new_range;
3304 int remaining_tile_number = base_tile->
tile_number;
3305 bool needs_final_cleanup =
true;
3314 if (new_tile_number == remaining_tile_number) {
3315 needs_final_cleanup =
false;
3320 if (needs_final_cleanup) {
3326 else if (ima->
filepath[0] !=
'\0') {
3370 const char *rp_name =
"";
3374 if (rp_index == pass) {
3381 rp_name = rpass->
name;
3391 if (rpass_ret ==
nullptr) {
3397 *r_passindex = (rpass == rpass_ret ? rp_index : pass);
3406 const int label_maxncpy)
3409 if (ima ==
nullptr ||
tile ==
nullptr) {
3413 if (
tile->label[0]) {
3431 bool all_valid_udim =
true;
3438 for (
int i = 0; i < dirs_num; i++) {
3439 if (!(dirs[i].type & S_IFREG)) {
3449 all_valid_udim =
false;
3454 min_udim =
min_ii(min_udim,
id);
3455 max_udim =
max_ii(max_udim,
id);
3463 *r_tile_start = min_udim;
3464 *r_tile_range = max_udim - min_udim + 1;
3476 if (tile_number < 1001 || tile_number >
IMA_UDIM_MAX) {
3484 next_tile = next_tile->
next)
3508 for (
int eye = 0; eye < 2; eye++) {
3539 if (new_tile_number < 1001 || new_tile_number >
IMA_UDIM_MAX) {
3543 const int old_tile_number =
tile->tile_number;
3544 tile->tile_number = new_tile_number;
3548 for (
int i = 0; i < totviews; i++) {
3562 for (
int eye = 0; eye < 2; eye++) {
3602 if (tile_ibuf !=
nullptr) {
3613 return strstr(filename,
"<UDIM>") !=
nullptr || strstr(filename,
"<UVTILE>") !=
nullptr;
3619 "Only the file-name component should be used!");
3625 std::string path(filename);
3631 std::regex pattern(R
"((.*[._-])([12]\d{3})([._-].*))");
3632 if (std::regex_search(path, match, pattern)) {
3633 BLI_strncpy(filename, match.format(
"$1<UDIM>$3").c_str(), filename_maxncpy);
3638 pattern = std::regex(R
"((.*)(u\d{1,2}_v\d{1,3})(\D.*))");
3639 if (std::regex_search(path, match, pattern)) {
3640 BLI_strncpy(filename, match.format(
"$1<UVTILE>$3").c_str(), filename_maxncpy);
3664 for (
int i = 0; i < dirs_num; i++) {
3665 if (!(dirs[i].type & S_IFREG)) {
3689 if (filepath ==
nullptr || r_tile_format ==
nullptr) {
3693 if (strstr(filepath,
"<UDIM>") !=
nullptr) {
3697 if (strstr(filepath,
"<UVTILE>") !=
nullptr) {
3707 const char *pattern,
3711 if (filepath ==
nullptr || pattern ==
nullptr || r_tile_number ==
nullptr) {
3719 if (sscanf(filepath, pattern, &u) == 1) {
3725 if (sscanf(filepath, pattern, &u, &
v) == 2) {
3726 *r_tile_number = 1001 + (u - 1) + ((
v - 1) * 10);
3735 const char *pattern,
3739 if (filepath ==
nullptr || pattern ==
nullptr) {
3747 int u = ((tile_number - 1001) % 10);
3748 int v = ((tile_number - 1001) / 10);
3761 if (rr ==
nullptr) {
3766 short index = 0, rv_index, rl_index = 0;
3775 if (iuser->
layer == rl_index) {
3797 if ((iuser->
view < 0) ||
3849 bool modified =
false;
3850 for (; rv; rv = rv->
next, iv = iv->
next) {
3862 ImageView *iv = MEM_cnew<ImageView>(
"Viewer Image View");
3901 if (render_result) {
3951 last_slot->
render =
nullptr;
3955 if (free_current_slot) {
3992 if (left_iv ==
nullptr) {
4007static void image_create_multilayer(
Image *ima,
ImBuf *ibuf,
int framenr)
4020 if (ima->
rr !=
nullptr) {
4072 if (!is_multiview) {
4085 ImBuf *ibuf =
nullptr;
4090 if (ima->
rr ==
nullptr || frame != ima->
rr->
framenr) {
4105 printf(
"error, multi is normal image\n");
4111 if (rpass && rpass->
ibuf) {
4128 ImBuf *ibuf =
nullptr;
4133 if (ia->
anim ==
nullptr) {
4146 iuser_t.
view = view_id;
4154 if (ia->
anim && iuser && iuser->
frames == 0) {
4161 int fra = frame - 1;
4166 if (fra > (dur - 1)) {
4181 ImBuf *ibuf =
nullptr;
4188 for (
int i = 0; i < tot_viewfiles; i++) {
4190 ImageAnim *ia = MEM_cnew<ImageAnim>(
"Image Anim");
4195 if (!is_multiview) {
4203 for (
int i = 0; i < tot_viewfiles; i++) {
4211 for (
int i = 0; i < totviews; i++) {
4216 ibuf = ibuf_arr[(iuser ? iuser->
multi_index : 0)];
4219 for (
int i = 0; i < totviews; i++) {
4220 if (ibuf_arr[i] != ibuf) {
4233 const bool has_packed,
4234 const bool is_sequence,
4238 ImBuf *ibuf =
nullptr;
4241 *r_cache_ibuf =
true;
4245 if (has_packed && !is_sequence) {
4247 if (imapf->view == view_id && imapf->tile_number == tile_number) {
4248 if (imapf->packedfile) {
4250 imapf->packedfile->size,
4266 if (!(is_sequence || is_tiled)) {
4278 iuser_t.
view = view_id;
4292 image_create_multilayer(ima, ibuf, cfra);
4298 *r_cache_ibuf =
false;
4307 if (!is_sequence && (has_packed ==
false) && (
G.fileflags &
G_FILE_AUTOPACK)) {
4313 imapf->
view = view_id;
4328 Image *ima,
ImageUser *iuser,
int entry,
int cfra,
bool is_sequence)
4330 ImBuf *ibuf =
nullptr;
4336 if (!(is_sequence || is_tiled)) {
4342 if (!is_sequence && has_packed) {
4350 if (!is_multiview) {
4352 ibuf =
load_image_single(ima, iuser, cfra, 0, has_packed, is_sequence, &put_in_cache);
4354 const int index = (is_sequence || is_tiled) ? 0 :
IMA_NO_INDEX;
4365 for (
int i = 0; i < tot_viewfiles; i++) {
4367 ima, iuser, cfra, i, has_packed, is_sequence, &cache_ibuf_arr[i]);
4372 tot_viewfiles == 1 && totviews >= 2)
4379 ibuf = ibuf_arr[ibuf_index];
4381 for (
int i = 0; i < totviews; i++) {
4382 if (cache_ibuf_arr[i]) {
4388 for (
int i = 0; i < totviews; i++) {
4389 if (ibuf_arr[i] != ibuf) {
4400 ImBuf *ibuf =
nullptr;
4402 if (ima->
rr ==
nullptr) {
4412 if (rpass && rpass->
ibuf) {
4433 ImBuf *pass_ibuf =
nullptr;
4437 if (!(iuser && iuser->
scene)) {
4448 const int layer = iuser->
layer;
4449 const int pass = iuser->
pass;
4450 int actview = iuser->
view;
4481 if (rv ==
nullptr) {
4487 if (rv ==
nullptr) {
4488 pass_ibuf = rres.
ibuf;
4491 pass_ibuf = rv->
ibuf;
4509 pass_ibuf = rpass->
ibuf;
4529 if (ima->
cache ==
nullptr) {
4544 pass_ibuf->
dither = dither;
4554 pass_ibuf->
x = rres.
rectx;
4555 pass_ibuf->
y = rres.
recty;
4568 if (is_multilayer) {
4615 Image *ima,
ImageUser *iuser,
int *r_entry,
int *r_index,
bool *r_is_cached_empty)
4617 ImBuf *ibuf =
nullptr;
4673 if (ima ==
nullptr) {
4678 if (
tile ==
nullptr) {
4692 ImBuf *ibuf =
nullptr;
4693 int entry = 0, index = 0;
4704 bool is_cached_empty =
false;
4706 if (is_cached_empty) {
4710 if (ibuf ==
nullptr) {
4750 ima, iuser, 0, entry,
false);
4762 if (base_tile->
gen_x == 0) {
4763 base_tile->
gen_x = 1024;
4765 if (base_tile->
gen_y == 0) {
4766 base_tile->
gen_y = 1024;
4817 if (ima ==
nullptr) {
4834 const char *view_name)
4840 const int view_image = image_user.
view;
4841 const bool is_allview = (view_image == 0);
4853 return view_image - 1;
4859 const char *pass_name,
4860 const char *view_name)
4905 if (
lock !=
nullptr) {
4944 return ibuf !=
nullptr;
4951 if (image_ibuf ==
nullptr) {
4956 float scale =
float(max_size) /
float(std::max(image_ibuf->
x, image_ibuf->
y));
4958 *r_width = image_ibuf->
x;
4961 *r_height = image_ibuf->
y;
4994 ImagePool *pool = MEM_cnew<ImagePool>(
"Image Pool");
5010 if (item->ibuf !=
nullptr) {
5029 if (item->image ==
image && item->entry == entry && item->index == index) {
5049 if (pool ==
nullptr) {
5081 item->
entry = entry;
5082 item->
index = index;
5098 if (pool ==
nullptr) {
5107 if (r_is_in_range) {
5108 *r_is_in_range =
false;
5116 cfra = cfra - iuser->
sfra + 1;
5120 cfra = ((cfra) %
len);
5128 if (r_is_in_range) {
5129 *r_is_in_range =
true;
5136 else if (cfra >
len) {
5140 if (r_is_in_range) {
5141 *r_is_in_range =
true;
5147 if (framenr > iuser->
frames) {
5152 framenr = ((framenr) %
len);
5153 while (framenr < 0) {
5162 framenr += iuser->
offset;
5210 int cfra = *(
int *)customdata;
5231 *(
bool *)customdata =
true;
5239 bool has_animation =
false;
5240 bool skip_nested_nodes =
true;
5242 return has_animation;
5251 Depsgraph *
depsgraph = (Depsgraph *)customdata;
5270 bool skip_nested_nodes =
true;
5283 const bool resolve_udim,
5284 const bool resolve_multiview)
5309 else if (resolve_udim) {
5326 const int planes = (ibuf ? ibuf->
planes : 0);
5329 if (
ELEM(planes, 32, 16)) {
5338 ImBuf *ibuf =
nullptr;
5341 if (
image !=
nullptr) {
5345 if (ibuf && ibuf->
x > 0 && ibuf->
y > 0) {
5347 *r_height = ibuf->
y;
5350 iuser->
scene !=
nullptr)
5359 if (
image !=
nullptr) {
5369 r_size[0] =
float(width);
5370 r_size[1] =
float(height);
5392 uchar *pixels =
nullptr;
5422 float *pixels =
nullptr;
5480 bool is_dirty =
false;
5481 bool is_writable =
false;
5484 if (
image->cache !=
nullptr) {
5500 if (r_is_writable) {
5501 *r_is_writable = is_writable;
5528 if (
image->cache !=
nullptr) {
5533 if (ibuf !=
nullptr) {
5546 bool has_loaded_ibuf =
false;
5549 if (
image->cache !=
nullptr) {
5554 if (ibuf !=
nullptr) {
5555 has_loaded_ibuf =
true;
5564 return has_loaded_ibuf;
5570 ImBuf *ibuf =
nullptr;
5573 if (
image->cache !=
nullptr) {
5578 if (current_ibuf !=
nullptr &&
STREQ(current_ibuf->
filepath, filepath)) {
5579 ibuf = current_ibuf;
5594 ImBuf *ibuf =
nullptr;
5597 if (
image->cache !=
nullptr) {
5602 if (ibuf !=
nullptr) {
5624 if (!is_multiview) {
5630 for (
int i = 0; i < 2; i++) {
5639 const char *ext =
nullptr;
5643 if (prefix[0] ==
'\0') {
5652 SNPRINTF(filepath_view,
"%s%s%s", prefix, srv->suffix, ext);
5695 RenderSlot *slot = MEM_cnew<RenderSlot>(
"Image new Render Slot");
5696 if (name && name[0]) {
5711 if (
G.is_rendering) {
5717 if (slot >= num_slots || num_slots == 1) {
5728 if (current_slot == remove_slot) {
5733 next_slot = current_slot;
5738 if (remove_slot == current_last_slot) {
5742 if (current_slot == remove_slot) {
5743 next_last_slot = next_slot;
5746 next_last_slot = current_slot;
5749 if (iuser ==
nullptr || iuser->
scene ==
nullptr) {
5753 if (re !=
nullptr) {
5757 current_last_slot = next_last_slot;
5760 current_slot = next_slot;
5767 if (remove_slot->
render) {
5781 if (
G.is_rendering) {
5796 if (render_slot->
render) {
5798 render_slot->
render =
nullptr;
bool BKE_bpath_foreach_path_fixed_process(BPathForeachPathData *bpath_data, char *path, size_t path_maxncpy)
@ BKE_BPATH_FOREACH_PATH_SKIP_PACKED
@ BKE_BPATH_FOREACH_PATH_RESOLVE_TOKEN
@ BKE_BPATH_FOREACH_PATH_RELOAD_EDITED
void BKE_icon_id_delete(struct ID *id)
void BKE_icon_changed(int icon_id)
int BKE_icon_id_ensure(struct ID *id)
void(*)(ID *id, const IDCacheKey *cache_key, void **cache_p, uint flags, void *user_data) IDTypeForeachCacheFunctionCallback
@ IDTYPE_FLAGS_APPEND_IS_REUSABLE
@ IDTYPE_FLAGS_NO_ANIMDATA
@ UDIM_TILE_FORMAT_UVTILE
void StampCallback(void *data, const char *propname, char *propvalue, int propvalue_maxncpy)
void BKE_image_partial_update_free(PartialUpdateUser *user)
free a partial update user.
void BKE_image_buf_fill_checker_color(unsigned char *rect, float *rect_float, int width, int height)
void BKE_image_buf_fill_checker(unsigned char *rect, float *rect_float, int width, int height)
#define IMA_SIGNAL_COLORMANAGE
void BKE_image_free_gputextures(Image *ima)
#define IMA_SIGNAL_SRC_CHANGE
#define IMA_SIGNAL_USER_NEW_IMAGE
#define IMA_SIGNAL_RELOAD
void BKE_image_buf_fill_color(unsigned char *rect, float *rect_float, int width, int height, const float color[4])
void BKE_image_partial_update_mark_full_update(Image *image)
Mark the whole image to be updated.
void BKE_image_partial_update_register_free(Image *image)
void BKE_id_free(Main *bmain, void *idv)
void id_us_ensure_real(ID *id)
void * BKE_libblock_alloc_in_lib(Main *bmain, std::optional< Library * > owner_library, short type, const char *name, int flag) ATTR_WARN_UNUSED_RESULT
void BKE_id_blend_write(BlendWriter *writer, ID *id)
const char * BKE_main_blendfile_path(const Main *bmain) ATTR_NONNULL()
const char * BKE_main_blendfile_path_from_global()
#define SH_NODE_TEX_IMAGE
#define SH_NODE_TEX_ENVIRONMENT
void BKE_ntree_update_main(Main *bmain, NodeTreeUpdateExtraParams *params)
void BKE_ntree_update_tag_id_changed(Main *bmain, ID *id)
PackedFile * BKE_packedfile_duplicate(const PackedFile *pf_src)
void BKE_packedfile_free(PackedFile *pf)
PackedFile * BKE_packedfile_new_from_memory(const void *mem, int memlen, const blender::ImplicitSharingInfo *sharing_info=nullptr)
void BKE_packedfile_blend_write(BlendWriter *writer, const PackedFile *pf)
void BKE_packedfile_blend_read(BlendDataReader *reader, PackedFile **pf_p, blender::StringRefNull filepath)
PackedFile * BKE_packedfile_new(ReportList *reports, const char *filepath_rel, const char *basepath)
void BKE_previewimg_blend_write(BlendWriter *writer, const PreviewImage *prv)
void BKE_previewimg_free(PreviewImage **prv)
void BKE_previewimg_blend_read(BlendDataReader *reader, PreviewImage *prv)
void BKE_previewimg_id_copy(ID *new_id, const ID *old_id)
void BKE_report(ReportList *reports, eReportType type, const char *message)
void BKE_render_resolution(const RenderData *r, const bool use_crop, int *r_width, int *r_height)
int BKE_scene_multiview_num_views_get(const RenderData *rd)
bool BKE_scene_multiview_is_render_view_active(const RenderData *rd, const SceneRenderView *srv)
void BKE_scene_multiview_view_prefix_get(Scene *scene, const char *filepath, char *r_prefix, const char **r_ext)
bool BKE_scene_multiview_is_stereo3d(const RenderData *rd)
const char * BKE_scene_find_last_marker_name(const Scene *scene, int frame)
int BKE_scene_multiview_view_id_get(const RenderData *rd, const char *viewname)
bScreen * BKE_workspace_active_screen_get(const WorkSpaceInstanceHook *hook) GETTER_ATTRS
void BLF_size(int fontid, float size)
int BLF_descender(int fontid) ATTR_WARN_UNUSED_RESULT
int BLF_width_max(int fontid) ATTR_WARN_UNUSED_RESULT
void BLF_draw_buffer(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_NONNULL(2)
void BLF_disable(int fontid, int option)
void BLF_buffer_col(int fontid, const float rgba[4]) ATTR_NONNULL(2)
void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, ColorManagedDisplay *display)
void BLF_enable(int fontid, int option)
int BLF_height_max(int fontid) ATTR_WARN_UNUSED_RESULT
void BLF_wordwrap(int fontid, int wrap_width)
void BLF_position(int fontid, float x, float y, float z)
#define BLI_assert_msg(a, msg)
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
unsigned int BLI_filelist_dir_contents(const char *dirname, struct direntry **r_filelist)
void BLI_filelist_free(struct direntry *filelist, unsigned int nrentries)
int BLI_open(const char *filepath, int oflag, int pmode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
bool BLI_file_ensure_parent_dir_exists(const char *filepath) ATTR_NONNULL(1)
unsigned int BLI_ghashutil_strhash_p(const void *ptr)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void * BLI_findstring(const struct ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
void void void void void void BLI_duplicatelist(struct ListBase *dst, const struct ListBase *src) ATTR_NONNULL(1
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void BLI_insertlinkafter(struct ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count_at_most(const struct ListBase *listbase, int count_max) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
BLI_INLINE bool BLI_listbase_count_is_equal_to(const struct ListBase *listbase, const int count_cmp)
void void BLI_INLINE bool BLI_listbase_is_single(const struct ListBase *lb)
void void BLI_listbase_sort(struct ListBase *listbase, int(*cmp)(const void *, const void *)) ATTR_NONNULL(1
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_insertlinkbefore(struct ListBase *listbase, void *vnextlink, void *vnewlink) ATTR_NONNULL(1)
int BLI_findstringindex(const struct ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
struct LinkData * BLI_genericNodeN(void *data)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int min_ii(int a, int b)
MINLINE int max_ii(int a, int b)
MINLINE int integer_digits_i(int i)
MINLINE void srgb_to_linearrgb_v4(float linear[4], const float srgb[4])
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE float len_squared_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v2_v2(float r[2], const float a[2])
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void zero_v2(float r[2])
void * BLI_mempool_alloc(BLI_mempool *pool) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL ATTR_NONNULL(1)
BLI_mempool * BLI_mempool_create(unsigned int esize, unsigned int elem_num, unsigned int pchunk, unsigned int flag) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
void BLI_mempool_destroy(BLI_mempool *pool) ATTR_NONNULL(1)
bool BLI_path_abs(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1
bool bool BLI_path_suffix(char *path, size_t path_maxncpy, const char *suffix, const char *sep) ATTR_NONNULL(1
void void void const char * BLI_path_basename(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
bool BLI_path_extension_check_array(const char *path, const char **ext_array) ATTR_NONNULL(1
#define BLI_path_join(...)
void void void BLI_path_split_file_part(const char *filepath, char *file, size_t file_maxncpy) ATTR_NONNULL(1
void BLI_path_split_dir_file(const char *filepath, char *dir, size_t dir_maxncpy, char *file, size_t file_maxncpy) ATTR_NONNULL(1
bool BLI_path_is_rel(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
bool BLI_path_extension_check(const char *path, const char *ext) ATTR_NONNULL(1
const char * BLI_path_slash_find(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
int BLI_path_sequence_decode(const char *path, char *head, size_t head_maxncpy, char *tail, size_t tail_maxncpy, unsigned short *r_digits_len)
void void BLI_path_split_dir_part(const char *filepath, char *dir, size_t dir_maxncpy) ATTR_NONNULL(1
bool void BLI_path_rel(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1)
bool BLI_path_extension_check_n(const char *path,...) ATTR_NONNULL(1) ATTR_SENTINEL(0)
void BLI_path_sequence_encode(char *path, size_t path_maxncpy, const char *head, const char *tail, unsigned short numlen, int pic)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
#define STRNCPY(dst, src)
#define SNPRINTF(dst, format,...)
size_t BLI_snprintf_rlen(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
size_t BLI_snprintf(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char char size_t BLI_strncpy_rlen(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
char * BLI_string_replaceN(const char *__restrict str, const char *__restrict substr_old, const char *__restrict substr_new) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
void BLI_hostname_get(char *buffer, size_t bufsize)
void BLI_task_isolate(void(*func)(void *userdata), void *userdata)
void BLI_thread_unlock(int type)
void BLI_mutex_end(ThreadMutex *mutex)
void BLI_thread_lock(int type)
void BLI_mutex_init(ThreadMutex *mutex)
int BLI_thread_is_main(void)
void BLI_mutex_lock(ThreadMutex *mutex)
void BLI_mutex_unlock(ThreadMutex *mutex)
pthread_mutex_t ThreadMutex
Platform independent time functions.
long int BLI_time_now_seconds_i(void)
size_t BLI_timecode_string_from_time_simple(char *str, size_t maxncpy, double time_seconds) ATTR_NONNULL()
size_t BLI_timecode_string_from_time(char *str, size_t maxncpy, int brevity_level, float time_seconds, double fps, short timecode_style) ATTR_NONNULL()
#define POINTER_FROM_INT(i)
#define UNUSED_VARS_NDEBUG(...)
#define POINTER_AS_INT(i)
#define MEMCMP_STRUCT_AFTER_IS_ZERO(struct_var, member)
#define MEMCPY_STRUCT_AFTER(struct_dst, struct_src, member)
const char * dirname(char *path)
bool BLO_read_data_is_undo(BlendDataReader *reader)
#define BLO_write_id_struct(writer, struct_name, id_address, id)
#define BLO_write_struct(writer, struct_name, data_ptr)
#define BLO_read_struct_list(reader, struct_name, list)
#define BLO_write_struct_list(writer, struct_name, list_ptr)
#define BLO_read_struct(reader, struct_name, ptr_p)
bool BLO_write_is_undo(BlendWriter *writer)
#define BLT_I18NCONTEXT_ID_IMAGE
#define CLOG_STR_ERROR(clg_ref, str)
#define CLOG_INFO(clg_ref, level,...)
void DEG_id_tag_update(ID *id, unsigned int flags)
float DEG_get_ctime(const Depsgraph *graph)
eEvaluationMode DEG_get_mode(const Depsgraph *graph)
#define ID_BLEND_PATH_FROM_GLOBAL(_id)
#define ID_BLEND_PATH(_bmain, _id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
#define DNA_struct_default_get(struct_name)
@ IMA_ALPHA_CHANNEL_PACKED
@ IMA_USER_FRAME_IN_RANGE
Object is a sort of wrapper for general info.
#define STEREO_LEFT_SUFFIX
#define STEREO_RIGHT_NAME
#define STEREO_RIGHT_SUFFIX
#define IMG_SIZE_FALLBACK
@ USER_TIMECODE_SMPTE_FULL
void DRW_drawdata_free(ID *id)
ListBase GPU_material_textures(GPUMaterial *material)
void GPU_texture_free(GPUTexture *texture)
@ COLOR_ROLE_DEFAULT_FLOAT
@ COLOR_ROLE_DEFAULT_BYTE
void IMB_colormanagement_assign_byte_colorspace(ImBuf *ibuf, const char *name)
ColorManagedDisplay * IMB_colormanagement_display_get_named(const char *name)
void IMB_colormanagement_check_is_data(ImBuf *ibuf, const char *name)
bool IMB_colormanagement_space_name_is_data(const char *name)
const char * IMB_colormanagement_colorspace_get_name(const ColorSpace *colorspace)
const char * IMB_colormanagement_role_colorspace_name_get(int role)
ImBuf * IMB_dupImBuf(const ImBuf *ibuf1)
ImBuf * IMB_anim_absolute(ImBufAnim *anim, int position, IMB_Timecode_Type tc, IMB_Proxy_Size preview_size)
void IMB_rect_from_float(ImBuf *ibuf)
void buf_rectfill_area(unsigned char *rect, float *rectf, int width, int height, const float col[4], ColorManagedDisplay *display, int x1, int y1, int x2, int y2)
ImBuf * IMB_makeSingleUser(ImBuf *ibuf)
void IMB_ImBufFromStereo3d(const Stereo3dFormat *s3d, ImBuf *ibuf_stereo3d, ImBuf **r_ibuf_left, ImBuf **r_ibuf_right)
ImBuf * IMB_loadiffname(const char *filepath, int flags, char colorspace[IM_MAX_SPACE])
void IMB_free_anim(ImBufAnim *anim)
void IMB_refImBuf(ImBuf *ibuf)
uint8_t * IMB_steal_encoded_buffer(ImBuf *ibuf)
ImBufAnim * IMB_open_anim(const char *filepath, int ib_flags, int streamindex, char colorspace[IM_MAX_SPACE])
size_t IMB_get_size_in_memory(ImBuf *ibuf)
int IMB_anim_get_duration(ImBufAnim *anim, IMB_Timecode_Type tc)
bool IMB_scale(ImBuf *ibuf, unsigned int newx, unsigned int newy, IMBScaleFilter filter, bool threaded=true)
Contains defines and structs used throughout the imbuf module.
const char * imb_ext_movie[]
#define IMB_MIPMAP_LEVELS
@ IB_alphamode_channel_packed
MovieCacheIter * IMB_moviecacheIter_new(MovieCache *cache)
void * IMB_moviecacheIter_getUserKey(MovieCacheIter *iter)
void IMB_moviecache_free(MovieCache *cache)
void IMB_moviecache_cleanup(MovieCache *cache, bool(cleanup_check_cb)(ImBuf *ibuf, void *userkey, void *userdata), void *userdata)
ImBuf * IMB_moviecache_get(MovieCache *cache, void *userkey, bool *r_is_cached_empty)
void IMB_moviecacheIter_free(MovieCacheIter *iter)
bool IMB_moviecacheIter_done(MovieCacheIter *iter)
void IMB_moviecache_put(MovieCache *cache, void *userkey, ImBuf *ibuf)
void IMB_moviecache_set_getdata_callback(MovieCache *cache, MovieCacheGetKeyDataFP getdatafp)
void IMB_moviecacheIter_step(MovieCacheIter *iter)
ImBuf * IMB_moviecacheIter_getImBuf(MovieCacheIter *iter)
MovieCache * IMB_moviecache_create(const char *name, int keysize, GHashHashFP hashfp, GHashCmpFP cmpfp)
void IMB_moviecache_remove(MovieCache *cache, void *userkey)
bool IMB_exr_has_multilayer(void *handle)
void IMB_exr_close(void *handle)
Read Guarded memory(de)allocation.
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between world
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Brightness Control the brightness and contrast of the input color Vector Map input vector components with curves Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert Invert a color
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between camera
int pad[32 - sizeof(int)]
ATTR_WARN_UNUSED_RESULT const BMVert * v
BPy_StructRNA * depsgraph
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
input_tx image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "preview_img") .compute_source("compositor_compute_preview.glsl") .do_static_compilation(true)
local_group_size(16, 16) .push_constant(Type b
local_group_size(16, 16) .push_constant(Type texture
CCL_NAMESPACE_BEGIN struct Options options
draw_view in_light_buf[] float
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
#define pf(_x, _i)
Prefetch 64.
struct ImBuf * IMB_ibImageFromMemory(const unsigned char *, size_t, int, char[IM_MAX_SPACE], const char *)
struct ImBuf * IMB_allocImBuf(unsigned int, unsigned int, unsigned char, unsigned int)
bool IMB_saveiff(struct ImBuf *, const char *, int)
void IMB_freeImBuf(ImBuf *)
ccl_gpu_kernel_postfix ccl_global KernelWorkTile * tiles
ccl_global const KernelWorkTile * tile
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
float wrap(float value, float max, float min)
bool RE_HasCombinedLayer(const RenderResult *result)
bool RE_RenderResult_is_stereo(const RenderResult *result)
const Sequence * SEQ_get_topmost_sequence(const Scene *scene, int frame)
void BKE_imbuf_stamp_info(const RenderResult *rr, ImBuf *ibuf)
Image * BKE_image_load_exists_in_lib(Main *bmain, std::optional< Library * > owner_library, const char *filepath, bool *r_exists)
static bool nearest_udim_tile_tie_break(const float best_dist_sq, const float best_uv[2], const float dist_sq, const float uv[2])
int BKE_image_get_tile_from_pos(Image *ima, const float uv[2], float r_uv[2], float r_ofs[2])
RenderSlot * BKE_image_get_renderslot(Image *ima, int index)
static void image_init_color_management(Image *ima)
ImBuf * BKE_image_acquire_ibuf(Image *ima, ImageUser *iuser, void **r_lock)
static void image_free_tile(Image *ima, ImageTile *tile)
static void image_abs_path(Main *bmain, Library *owner_library, const char *filepath, char *r_filepath_abs)
bool BKE_image_is_multilayer(const Image *ima)
bool BKE_image_has_alpha(Image *image)
static void image_init_after_load(Image *ima, ImageUser *iuser, ImBuf *)
void BKE_image_ensure_viewer_views(const RenderData *rd, Image *ima, ImageUser *iuser)
static void image_walk_ntree_all_users(bNodeTree *ntree, ID *id, void *customdata, void callback(Image *ima, ID *iuser_id, ImageUser *iuser, void *customdata))
void BKE_image_user_frame_calc(Image *ima, ImageUser *iuser, int cfra)
char * BKE_image_get_tile_strformat(const char *filepath, eUDIM_TILE_FORMAT *r_tile_format)
Image * BKE_image_load(Main *bmain, const char *filepath)
static int image_num_viewfiles(Image *ima)
BLI_INLINE bool image_quick_test(Image *ima, const ImageUser *iuser)
void BKE_stamp_info_from_imbuf(RenderResult *rr, ImBuf *ibuf)
void BKE_image_alpha_mode_from_extension(Image *image)
Image * BKE_image_load_exists(Main *bmain, const char *filepath, bool *r_exists)
bool BKE_image_scale(Image *image, int width, int height, ImageUser *iuser)
static void image_viewer_create_views(const RenderData *rd, Image *ima)
BLI_INLINE ImBuf * image_pool_find_item(ImagePool *pool, Image *image, int entry, int index, bool *r_found)
static ImBuf * image_get_cached_ibuf_for_index_entry(Image *ima, int index, int entry, bool *r_is_cached_empty)
void BKE_image_get_size_fl(Image *image, ImageUser *iuser, float r_size[2])
void BKE_image_free_buffers_ex(Image *ima, bool do_lock)
static void stampdata(const Scene *scene, Object *camera, StampData *stamp_data, int do_prefix, bool use_dynamic)
bool BKE_image_user_id_has_animation(ID *id)
bool BKE_image_has_filepath(const Image *ima)
void BKE_image_mark_dirty(Image *, ImBuf *ibuf)
void BKE_image_set_filepath_from_tile_number(char *filepath, const char *pattern, eUDIM_TILE_FORMAT tile_format, int tile_number)
void BKE_image_multilayer_stamp_info_callback(void *data, const Image &image, StampCallback callback, bool noskip)
void BKE_image_get_aspect(Image *image, float *r_aspx, float *r_aspy)
StampData * BKE_stamp_data_copy(const StampData *stamp_data)
ImBufAnim * openanim_noload(const char *filepath, int flags, int streamindex, char colorspace[IMA_MAX_SPACE])
static ImBuf * add_ibuf_for_tile(Image *ima, ImageTile *tile)
ImBuf * BKE_image_acquire_multilayer_view_ibuf(const RenderData &render_data, Image &image, const ImageUser &image_user, const char *pass_name, const char *view_name)
static void imagecache_keydata(void *userkey, int *framenr, int *proxy, int *render_flags)
static void metadata_copy_custom_fields(const char *field, const char *value, void *rr_v)
bool BKE_image_is_openexr(Image *ima)
bool BKE_image_has_multiple_ibufs(Image *image)
Image * BKE_image_ensure_viewer(Main *bmain, int type, const char *name)
static int tile_sort_cb(const void *a, const void *b)
static void image_remove_ibuf(Image *ima, int index, int entry)
RenderPass * BKE_image_multilayer_index(RenderResult *rr, ImageUser *iuser)
static void image_get_entry_and_index(Image *ima, ImageUser *iuser, int *r_entry, int *r_index)
static void image_init_data(ID *id)
bool BKE_image_fill_tile(Image *ima, ImageTile *tile)
void BKE_image_release_ibuf(Image *ima, ImBuf *ibuf, void *lock)
void BKE_image_free_data(Image *ima)
Image * BKE_image_add_generated(Main *bmain, uint width, uint height, const char *name, int depth, int floatbuf, short gen_type, const float color[4], const bool stereo3d, const bool is_data, const bool tiled)
RenderSlot * BKE_image_add_renderslot(Image *ima, const char *name)
StampData * BKE_stamp_info_from_scene_static(const Scene *scene)
static uintptr_t image_mem_size(Image *image)
static void image_tag_reload(Image *ima, ID *iuser_id, ImageUser *iuser, void *customdata)
static float distance_squared_to_udim(const float co[2], const float udim[2])
void BKE_image_user_file_path(const ImageUser *iuser, const Image *ima, char *filepath)
void BKE_image_tag_time(Image *ima)
static void image_init_multilayer_multiview(Image *ima, RenderResult *rr)
void BKE_image_merge(Main *bmain, Image *dest, Image *source)
bool BKE_image_memorypack(Image *ima)
void BKE_image_packfiles(ReportList *reports, Image *ima, const char *basepath)
static int get_multilayer_view_index(const Image &image, const ImageUser &image_user, const char *view_name)
#define IMA_MAKE_INDEX(entry, index)
void BKE_image_packfiles_from_mem(ReportList *reports, Image *ima, char *data, const size_t data_len)
static ImBuf * image_load_image_file(Image *ima, ImageUser *iuser, int entry, int cfra, bool is_sequence)
static ImBuf * image_load_movie_file(Image *ima, ImageUser *iuser, int frame)
bool BKE_image_is_dirty(Image *image)
static const char * stamp_metadata_fields[]
static void image_runtime_reset(Image *image)
void BKE_stamp_data_free(StampData *stamp_data)
void BKE_image_free_anim_ibufs(Image *ima, int except_frame)
static ImBuf * imagecache_get(Image *image, int index, bool *r_is_cached_empty)
void BKE_image_release_renderresult(Scene *scene, Image *ima, RenderResult *render_result)
void BKE_image_pool_free(ImagePool *pool)
int BKE_image_user_frame_get(const ImageUser *iuser, int cfra, bool *r_is_in_range)
static void image_tag_frame_recalc(Image *ima, ID *iuser_id, ImageUser *iuser, void *customdata)
static void image_foreach_path(ID *id, BPathForeachPathData *bpath_data)
static void stampdata_from_template(StampData *stamp_data, const Scene *scene, const StampData *stamp_data_template, bool do_prefix)
#define CALL(member, value_str)
void BKE_image_free_packedfiles(Image *ima)
static void image_runtime_free_data(Image *image)
ImBuf * BKE_image_pool_acquire_ibuf(Image *ima, ImageUser *iuser, ImagePool *pool)
Image * BKE_image_add_from_imbuf(Main *bmain, ImBuf *ibuf, const char *name)
static void image_walk_id_all_users(ID *id, bool skip_nested_nodes, void *customdata, void callback(Image *ima, ID *iuser_id, ImageUser *iuser, void *customdata))
static void image_user_id_has_animation(Image *ima, ID *, ImageUser *, void *customdata)
static void image_foreach_cache(ID *id, IDTypeForeachCacheFunctionCallback function_callback, void *user_data)
void BKE_image_sort_tiles(Image *ima)
uchar * BKE_image_get_pixels_for_frame(Image *image, int frame, int tile)
static ImBuf * load_movie_single(Image *ima, ImageUser *iuser, int frame, const int view_id)
void BKE_image_backup_render(Scene *scene, Image *ima, bool free_current_slot)
static uint imagecache_hashhash(const void *key_v)
static ImBuf * load_image_single(Image *ima, ImageUser *iuser, int cfra, const int view_id, const bool has_packed, const bool is_sequence, bool *r_cache_ibuf)
static Image * image_alloc(Main *bmain, std::optional< Library * > owner_library, const char *name, short source, short type)
static void image_runtime_reset_on_copy(Image *image)
void BKE_image_user_file_path_ex(const Main *bmain, const ImageUser *iuser, const Image *ima, char *filepath, const bool resolve_udim, const bool resolve_multiview)
bool BKE_image_get_tile_number_from_filepath(const char *filepath, const char *pattern, eUDIM_TILE_FORMAT tile_format, int *r_tile_number)
bool BKE_image_has_opengl_texture(Image *ima)
static void image_free_anims(Image *ima)
void BKE_image_ensure_tile_token_filename_only(char *filename, size_t filename_maxncpy)
static void image_remove_all_tiles(Image *ima)
void BKE_image_get_tile_uv(const Image *ima, const int tile_number, float r_uv[2])
static ImBuf * image_get_cached_ibuf(Image *ima, ImageUser *iuser, int *r_entry, int *r_index, bool *r_is_cached_empty)
static ImBuf * image_get_ibuf_multilayer(Image *ima, ImageUser *iuser)
ImagePool * BKE_image_pool_new()
bool BKE_imbuf_alpha_test(ImBuf *ibuf)
static void image_assign_ibuf(Image *ima, ImBuf *ibuf, int index, int entry)
static void image_walk_gpu_materials(ID *id, ListBase *gpu_materials, void *customdata, void callback(Image *ima, ID *iuser_id, ImageUser *iuser, void *customdata))
ImBufAnim * openanim(const char *filepath, int flags, int streamindex, char colorspace[IMA_MAX_SPACE])
static int image_get_tile_number_from_iuser(const Image *ima, const ImageUser *iuser)
void BKE_imageuser_default(ImageUser *iuser)
bool BKE_image_has_anim(Image *ima)
#define TEXT_SIZE_CHECK(str, w, h)
Image * BKE_image_load_in_lib(Main *bmain, std::optional< Library * > owner_library, const char *filepath)
int BKE_image_get_tile_label(const Image *ima, const ImageTile *tile, char *label, const int label_maxncpy)
void BKE_render_result_stamp_info(Scene *scene, Object *camera, RenderResult *rr, bool allocate_only)
static void image_copy_data(Main *, std::optional< Library * >, ID *id_dst, const ID *id_src, const int flag)
static ImBuf * image_acquire_ibuf(Image *ima, ImageUser *iuser, void **r_lock)
void BKE_image_free_all_textures(Main *bmain)
static ImBuf * image_load_sequence_multilayer(Image *ima, ImageUser *iuser, int entry, int frame)
void BKE_stamp_info_callback(void *data, StampData *stamp_data, StampCallback callback, bool noskip)
static int imbuf_alpha_flags_for_image(Image *ima)
static bool image_remove_tile(Image *ima, ImageTile *tile)
int BKE_image_sequence_guess_offset(Image *image)
static void metadata_get_field(void *data, const char *propname, char *propvalue, int propvalue_maxncpy)
bool BKE_image_is_stereo(const Image *ima)
bool BKE_image_is_multiview(const Image *ima)
bool BKE_imbuf_write(ImBuf *ibuf, const char *filepath, const ImageFormatData *imf)
void BKE_image_get_size(Image *image, ImageUser *iuser, int *r_width, int *r_height)
static void imagecache_put(Image *image, int index, ImBuf *ibuf)
void BKE_image_ensure_tile_token(char *filepath, size_t filepath_maxncpy)
static void image_free_data(ID *id)
ImBuf * BKE_image_get_ibuf_with_name(Image *image, const char *filepath)
static bool imagecache_check_dirty(ImBuf *ibuf, void *, void *)
static bool image_memorypack_imbuf(Image *ima, ImBuf *ibuf, int view, int tile_number, const char *filepath)
static void image_update_views_format(Image *ima, ImageUser *iuser)
bool BKE_image_get_tile_info(char *filepath, ListBase *tiles, int *r_tile_start, int *r_tile_range)
static float distance_to_unit_interval(float x)
static void image_free_packedfiles(Image *ima)
char BKE_image_alpha_mode_from_extension_ex(const char *filepath)
void BKE_image_free_views(Image *image)
static void image_editors_update_frame(Image *ima, ID *, ImageUser *iuser, void *customdata)
void BKE_image_all_free_anim_ibufs(Main *bmain, int cfra)
void BKE_image_walk_all_users(const Main *mainp, void *customdata, void callback(Image *ima, ID *iuser_id, ImageUser *iuser, void *customdata))
bool BKE_image_remove_renderslot(Image *ima, ImageUser *iuser, int slot)
void BKE_image_signal(Main *bmain, Image *ima, ImageUser *iuser, int signal)
void BKE_image_reassign_tile(Image *ima, ImageTile *tile, int new_tile_number)
static void image_colorspace_from_imbuf(Image *image, const ImBuf *ibuf)
void BKE_render_result_stamp_data(RenderResult *rr, const char *key, const char *value)
static void image_blend_read_data(BlendDataReader *reader, ID *id)
bool BKE_image_is_animated(Image *image)
bool BKE_stamp_is_known_field(const char *field_name)
bool BKE_image_clear_renderslot(Image *ima, ImageUser *iuser, int slot)
bool BKE_image_is_filename_tokenized(char *filepath)
int BKE_image_find_nearest_tile_with_offset(const Image *image, const float co[2], float r_uv_offset[2])
static bool imagecache_hashcmp(const void *a_v, const void *b_v)
static void imagecache_remove(Image *image, int index)
void BKE_image_user_id_eval_animation(Depsgraph *depsgraph, ID *id)
int BKE_image_find_nearest_tile(const Image *image, const float co[2])
bool BKE_imbuf_write_stamp(const Scene *scene, const RenderResult *rr, ImBuf *ibuf, const char *filepath, const ImageFormatData *imf)
void BKE_image_editors_update_frame(const Main *bmain, int cfra)
void BKE_image_replace_imbuf(Image *image, ImBuf *ibuf)
void BKE_image_init_imageuser(Image *ima, ImageUser *iuser)
void BKE_image_pool_release_ibuf(Image *ima, ImBuf *ibuf, ImagePool *pool)
#define IMA_INDEX_ENTRY(index)
#define TEXT_SIZE_CHECK_WORD_WRAP(str, w, h)
static void image_buf_fill_isolated(void *usersata_v)
ImBuf * BKE_image_preview(Image *ima, const short max_size, short *r_width, short *r_height)
constexpr IDTypeInfo get_type_info()
RenderResult * BKE_image_acquire_renderresult(Scene *scene, Image *ima)
ImageTile * BKE_image_add_tile(Image *ima, int tile_number, const char *label)
static ImageTile * imagetile_alloc(int tile_number)
static RenderPass * image_render_pass_get(RenderLayer *rl, const int pass, const int view, int *r_passindex)
ImBuf * BKE_image_get_first_ibuf(Image *image)
static void image_blend_write(BlendWriter *writer, ID *id, const void *id_address)
static void image_free_cached_frames(Image *image)
static void metadata_set_field(void *data, const char *propname, char *propvalue, int)
static void copy_image_packedfiles(ListBase *lb_dst, const ListBase *lb_src)
void BKE_image_file_format_set(Image *image, int ftype, const ImbFormatOptions *options)
static bool imagecache_check_free_anim(ImBuf *ibuf, void *, void *userdata)
static ImBuf * image_get_render_result(Image *ima, ImageUser *iuser, void **r_lock)
bool BKE_image_remove_tile(Image *ima, ImageTile *tile)
static int image_get_multiview_index(Image *ima, ImageUser *iuser)
static void image_add_view(Image *ima, const char *viewname, const char *filepath)
static void image_user_id_eval_animation(Image *ima, ID *, ImageUser *iuser, void *customdata)
bool BKE_image_has_ibuf(Image *ima, ImageUser *iuser)
float * BKE_image_get_float_pixels_for_frame(Image *image, int frame, int tile)
bool BKE_image_has_packedfile(const Image *ima)
void BKE_image_stamp_buf(Scene *scene, Object *camera, const StampData *stamp_data_template, uchar *rect, float *rectf, int width, int height)
bool BKE_imbuf_write_as(ImBuf *ibuf, const char *filepath, const ImageFormatData *imf, const bool save_copy)
void BKE_image_multiview_index(const Image *ima, ImageUser *iuser)
bool BKE_image_has_loaded_ibuf(Image *image)
bool BKE_image_tile_filepath_exists(const char *filepath)
void BKE_image_print_memlist(Main *bmain)
bool BKE_image_is_dirty_writable(Image *image, bool *r_is_writable)
static void image_init(Image *ima, short source, short type)
static void image_blend_read_after_liblink(BlendLibReader *, ID *id)
bool BKE_image_buffer_format_writable(ImBuf *ibuf)
RenderResult * RE_MultilayerConvert(void *exrhandle, const char *colorspace, bool predivide, int rectx, int recty)
void RE_ReleaseResultImage(Render *re)
void RE_AcquireResultImage(Render *re, RenderResult *rr, const int view_id)
void RE_ClearResult(Render *re)
void RE_SwapResult(Render *re, RenderResult **rr)
void RE_FreeRenderResult(RenderResult *rr)
void RE_ReferenceRenderResult(RenderResult *rr)
RenderResult * RE_AcquireResultRead(Render *re)
void RE_ReleaseResult(Render *re)
Render * RE_GetSceneRender(const Scene *scene)
RenderStats * RE_GetStats(Render *re)
_W64 unsigned int uintptr_t
struct ListBase bg_images
unsigned int id_session_uid
IDTypeBlendReadUndoPreserve blend_read_undo_preserve
uint64_t dependencies_id_types
IDTypeForeachIDFunction foreach_id
IDTypeCopyDataFunction copy_data
IDTypeInitDataFunction init_data
IDTypeForeachCacheFunction foreach_cache
IDTypeBlendWriteFunction blend_write
IDTypeBlendReadDataFunction blend_read_data
IDTypeFreeDataFunction free_data
IDTypeMakeLocalFunction make_local
AssetTypeInfo * asset_type_info
IDTypeLibOverrideApplyPost lib_override_apply_post
IDTypeForeachPathFunction foreach_path
const char * translation_context
IDTypeBlendReadAfterLiblinkFunction blend_read_after_liblink
IDTypeEmbeddedOwnerPointerGetFunction owner_pointer_get
char filepath[IMB_FILEPATH_SIZE]
ImBufFloatBuffer float_buffer
ImbFormatOptions foptions
ImBufByteBuffer byte_buffer
ImBuf * mipmap[IMB_MIPMAP_LEVELS]
ImBufByteBuffer encoded_buffer
unsigned int encoded_size
struct PackedFile * packedfile
struct ImagePackedFile * next
BLI_mempool * memory_pool
struct PartialUpdateUser * partial_update_user
Partial update user for GPUTextures stored inside the Image.
struct PartialUpdateRegister * partial_update_register
Register containing partial updates.
struct MovieCache * cache
struct ListBase packedfiles
struct PreviewImage * preview
ColorManagedColorspaceSettings colorspace_settings
struct GPUTexture * gputexture[3][2]
struct Stereo3dFormat * stereo3d_format
struct Library_Runtime runtime
struct bNodeTree * nodetree
struct bNodeTree * nodetree
struct RenderLayer * next
struct StampData * stamp_data
struct RenderResult * render
struct bNodeTree * nodetree
ColorManagedDisplaySettings display_settings
StampDataCustomField * prev
StampDataCustomField * next
char memory[STAMP_NAME_SIZE]
char strip[STAMP_NAME_SIZE]
char rendertime[STAMP_NAME_SIZE]
char camera[STAMP_NAME_SIZE]
char cameralens[STAMP_NAME_SIZE]
char scene[STAMP_NAME_SIZE]
struct bNodeTree * nodetree
void * BKE_image_free_buffers
void * BKE_image_get_tile_from_iuser
void * BKE_image_get_tile