48#define DNA_DEPRECATED_ALLOW
132 if (image->
runtime->partial_update_user !=
nullptr) {
134 image->
runtime->partial_update_user =
nullptr;
153 if (image !=
nullptr) {
159 std::optional<Library *> ,
165 const Image *image_src = (
const Image *)id_src;
177 image_dst->
cache =
nullptr;
178 image_dst->
rr =
nullptr;
182 slot->render =
nullptr;
189 for (
int eye = 0; eye < 2; eye++) {
202 image_dst->
runtime = MEM_new<blender::bke::ImageRuntime>(__func__);
217 slot->render =
nullptr;
242 function_callback(
id, &key, (
void **)&image->
cache, 0, user_data);
245 function_callback(
id, &key, &image->
anims.
first, 0, user_data);
247 function_callback(
id, &key, &image->
anims.
last, 0, user_data);
249 auto gputexture_offset = [image](
int target,
int eye) {
251 GPUTexture **first = &image->
gputexture[0][0];
252 const size_t array_offset =
sizeof(*first) * (&image->
gputexture[target][eye] - first);
253 return base_offset + array_offset;
256 for (
int eye = 0; eye < 2; eye++) {
263 function_callback(
id, &key, (
void **)&image->
gputexture[a][eye], 0, user_data);
268 function_callback(
id, &key, (
void **)&image->
rr, 0, user_data);
272 function_callback(
id, &key, (
void **)&slot->render, 0, user_data);
340 ima->
cache =
nullptr;
343 for (
int i = 0;
i < 3;
i++) {
344 for (
int j = 0; j < 2; j++) {
384 ima->packedfile =
nullptr;
406 if (!imapf->packedfile) {
411 ima->packedfile =
nullptr;
423 ima->
runtime = MEM_new<blender::bke::ImageRuntime>(__func__);
434 if (ima->
cache ==
nullptr) {
476 Image *ima,
ImageUser *iuser,
int entry,
int cfra,
bool is_sequence);
482#define IMA_NO_INDEX 0x7FEFEFEF
485#define IMA_MAKE_INDEX(entry, index) (((entry) << 10) + (index))
486#define IMA_INDEX_ENTRY(index) ((index) >> 10)
488# define IMA_INDEX_PASS(index) (index & ~1023)
512 return (a->
index !=
b->index);
528 if (image->
cache ==
nullptr) {
544 if (image->
cache ==
nullptr) {
574 image->
cache =
nullptr;
616 ima->
runtime->cache_mutex.lock();
630 ima->
runtime->cache_mutex.unlock();
647 tile->tile_number = tile_number;
672 for (
int i = 0;
i < 8;
i++) {
677 ima->
runtime = MEM_new<blender::bke::ImageRuntime>(__func__);
684 std::optional<Library *> owner_library,
709 bool *r_is_cached_empty)
741 imapf_src = imapf_src->
next)
760 if (dest && source && dest != source) {
762 std::scoped_lock lock_src(source->
runtime->cache_mutex);
763 std::scoped_lock lock_dst(dest->
runtime->cache_mutex);
765 if (source->
cache !=
nullptr) {
766 MovieCacheIter *iter;
798 return (ibuf !=
nullptr);
803 for (
int eye = 0; eye < 2; eye++) {
817 return (iuser && iuser->
tile) ? iuser->
tile :
tile->tile_number;
822 if (ima ==
nullptr) {
828 if (
ELEM(tile_number, 0, 1001)) {
838 if (
tile->tile_number == tile_number) {
854 if (r_ofs ==
nullptr) {
867 int tile_number = 1001 + 10 * iy + ix;
923 const float best_uv[2],
927 if (best_dist_sq == dist_sq) {
928 if (best_uv[0] == uv[0]) {
929 return (uv[1] > best_uv[1]);
931 return (uv[0] > best_uv[0]);
933 return (dist_sq < best_dist_sq);
938 float r_uv_offset[2])
943 int tile_number_best = -1;
946 return tile_number_best;
960 if (
floorf(co[0]) == uv_offset[0] &&
floorf(co[1]) == uv_offset[1]) {
963 return tile_number_best;
969 dist_best_sq = dist_sq;
971 tile_number_best =
tile->tile_number;
974 return tile_number_best;
979 float uv_offset_dummy[2];
1028 const char *filepath,
1029 char *r_filepath_abs)
1032 if (owner_library) {
1046 std::optional<Library *> owner_library,
1047 const char *filepath)
1088 std::optional<Library *> owner_library,
1089 const char *filepath,
1115 if (ima->
id.
lib != owner_lib) {
1147 const short gen_type = usersata->
gen_type;
1170 uchar *rect =
nullptr;
1171 float *rect_float =
nullptr;
1172 float fill_color[4];
1185 if (ibuf !=
nullptr) {
1209 if (ibuf !=
nullptr) {
1233 data.rect_float = rect_float;
1248 const float color[4],
1249 const bool stereo3d,
1261 if (ima ==
nullptr) {
1274 tile->gen_x = width;
1275 tile->gen_y = height;
1276 tile->gen_type = gen_type;
1278 tile->gen_depth = depth;
1286 for (view_id = 0; view_id < 2; view_id++) {
1290 int entry = tiled ? 1001 : 0;
1307 const char *colorspace_name =
nullptr;
1327 if (colorspace_name) {
1334 if (name ==
nullptr) {
1373 image->gen_x = ibuf->
x;
1374 image->gen_y = ibuf->
y;
1384 Image *ima,
ImBuf *ibuf,
int view,
int tile_number,
const char *filepath)
1430 int entry = is_tiled ?
tile->tile_number : 0;
1437 const char *filepath = ibuf->
filepath;
1441 filepath = tiled_filepath;
1443 else if (is_multiview) {
1512 const size_t data_len)
1516 if (tot_viewfiles != 1) {
1550 std::scoped_lock
lock(image->
runtime->cache_mutex);
1552 if (image->
cache !=
nullptr) {
1558 if (ibuf ==
nullptr) {
1578 uintptr_t
size, totsize = 0;
1586 printf(
"\ntotal image memory len: %.3f MB\n",
double(totsize) /
double(1024 * 1024));
1594 printf(
"%s len: %.3f MB\n", ima->
id.
name + 2,
double(
size) /
double(1024 * 1024));
1601 if (ibuf ==
nullptr) {
1609#undef CHECK_FREED_SIZE
1613#ifdef CHECK_FREED_SIZE
1614 uintptr_t tot_freed_size = 0;
1635#ifdef CHECK_FREED_SIZE
1641#ifdef CHECK_FREED_SIZE
1646#ifdef CHECK_FREED_SIZE
1647 printf(
"%s: freed total %lu MB\n", __func__, tot_freed_size / (1024 * 1024));
1653 if (ibuf ==
nullptr) {
1656 int except_frame = *(
int *)userdata;
1664 if (ima->
cache !=
nullptr) {
1688#define STAMP_NAME_SIZE ((MAX_ID_NAME - 2) + 16)
1722#undef STAMP_NAME_SIZE
1738 do_prefix ?
"File %s" :
"%s",
1739 (blendfile_path[0] !=
'\0') ? blendfile_path :
"<untitled>");
1742 stamp_data->
file[0] =
'\0';
1750 stamp_data->
note[0] =
'\0';
1757 "%04d/%02d/%02d %02d:%02d:%02d",
1764 SNPRINTF(stamp_data->
date, do_prefix ?
"Date %s" :
"%s", text);
1767 stamp_data->
date[0] =
'\0';
1780 SNPRINTF(stamp_data->
marker, do_prefix ?
"Marker %s" :
"%s", text);
1783 stamp_data->
marker[0] =
'\0';
1790 SNPRINTF(stamp_data->
time, do_prefix ?
"Timecode %s" :
"%s", text);
1793 stamp_data->
time[0] =
'\0';
1800 if (scene->
r.
efra > 9) {
1804 SNPRINTF(fmtstr, do_prefix ?
"Frame %%0%di" :
"%%0%di", digits);
1808 stamp_data->
frame[0] =
'\0';
1813 do_prefix ?
"Frame Range %d:%d" :
"%d:%d",
1823 do_prefix ?
"Camera %s" :
"%s",
1824 camera ? camera->
id.
name + 2 :
"<none>");
1827 stamp_data->
camera[0] =
'\0';
1848 stamp_data->
scene[0] =
'\0';
1861 SNPRINTF(stamp_data->
strip, do_prefix ?
"Strip %s" :
"%s", text);
1864 stamp_data->
strip[0] =
'\0';
1884 stamp_data->
memory[0] =
'\0';
1889 do_prefix ?
"Frame Range %d:%d" :
"%d:%d",
1900 SNPRINTF(stamp_data->
hostname, do_prefix ?
"Hostname %s" :
"%s", hostname);
1913 SNPRINTF(stamp_data->
file, do_prefix ?
"File %s" :
"%s", stamp_data_template->
file);
1916 stamp_data->
file[0] =
'\0';
1922 stamp_data->
note[0] =
'\0';
1925 SNPRINTF(stamp_data->
date, do_prefix ?
"Date %s" :
"%s", stamp_data_template->
date);
1928 stamp_data->
date[0] =
'\0';
1934 stamp_data->
marker[0] =
'\0';
1937 SNPRINTF(stamp_data->
time, do_prefix ?
"Timecode %s" :
"%s", stamp_data_template->
time);
1940 stamp_data->
time[0] =
'\0';
1943 SNPRINTF(stamp_data->
frame, do_prefix ?
"Frame %s" :
"%s", stamp_data_template->
frame);
1946 stamp_data->
frame[0] =
'\0';
1950 do_prefix ?
"Frame Range %s" :
"%s",
1960 stamp_data->
camera[0] =
'\0';
1970 SNPRINTF(stamp_data->
scene, do_prefix ?
"Scene %s" :
"%s", stamp_data_template->
scene);
1973 stamp_data->
scene[0] =
'\0';
1976 SNPRINTF(stamp_data->
strip, do_prefix ?
"Strip %s" :
"%s", stamp_data_template->
strip);
1979 stamp_data->
strip[0] =
'\0';
1983 do_prefix ?
"RenderTime %s" :
"%s",
1990 SNPRINTF(stamp_data->
memory, do_prefix ?
"Peak Memory %s" :
"%s", stamp_data_template->
memory);
1993 stamp_data->
memory[0] =
'\0';
1997 stamp_data->
hostname, do_prefix ?
"Hostname %s" :
"%s", stamp_data_template->
hostname);
2018 const char *display_device;
2029#define TEXT_SIZE_CHECK(str, w, h) \
2030 ((str[0]) && ((void)(h = h_fixed), (w = int(BLF_width(mono, str, sizeof(str))))))
2033#define TEXT_SIZE_CHECK_WORD_WRAP(str, w, h) \
2034 ((str[0]) && (BLF_boundbox(mono, str, sizeof(str), &wrap.rect, &wrap.info), \
2035 (void)(h = h_fixed * wrap.info.lines), \
2036 (w = BLI_rcti_size_x(&wrap.rect))))
2038#define BUFF_MARGIN_X 2
2039#define BUFF_MARGIN_Y 1
2041 if (!rect && !rectf) {
2049 if (stamp_data_template ==
nullptr) {
2050 stampdata(scene, camera, &stamp_data, do_prefix,
true);
2065 BLF_buffer(mono, rectf, rect, width, height, display);
2369 x = width -
w -
pad;
2389 BLF_buffer(mono,
nullptr,
nullptr, 0, 0,
nullptr);
2392#undef TEXT_SIZE_CHECK
2393#undef TEXT_SIZE_CHECK_WORD_WRAP
2416 if (!allocate_only) {
2417 stampdata(scene, camera, stamp_data, 0,
true);
2436 stampdata(scene,
nullptr, stamp_data, 0,
false);
2476 if ((callback ==
nullptr) || (stamp_data ==
nullptr)) {
2480#define CALL(member, value_str) \
2481 if (noskip || stamp_data->member[0]) { \
2482 callback(data, value_str, stamp_data->member, sizeof(stamp_data->member)); \
2491 CALL(marker,
"Marker");
2493 CALL(frame,
"Frame");
2494 CALL(frame_range,
"FrameRange");
2495 CALL(camera,
"Camera");
2496 CALL(cameralens,
"Lens");
2497 CALL(scene,
"Scene");
2498 CALL(strip,
"Strip");
2499 CALL(rendertime,
"RenderTime");
2500 CALL(memory,
"Memory");
2501 CALL(hostname,
"Hostname");
2504 if (noskip || custom_field->value[0]) {
2505 callback(
data, custom_field->key, custom_field->value, strlen(custom_field->value) + 1);
2517 std::scoped_lock
lock(image.
runtime->cache_mutex);
2541 if (stamp_data ==
nullptr) {
2549 custom_fieldn->value =
static_cast<char *
>(
MEM_dupallocN(custom_fieldn->value));
2557 if (stamp_data ==
nullptr) {
2569 const char *propname,
2579 const char *propname,
2581 int propvalue_maxncpy)
2621 if (buf[3] < 1.0f) {
2629 if (buf[3] != 255) {
2653 const char *filepath,
2655 const bool save_copy)
2657 ImBuf ibuf_back = *ibuf;
2678 const char *filepath,
2695 anim =
MOV_open_file(filepath, flags, streamindex, colorspace);
2707 anim =
MOV_open_file(filepath, flags, streamindex, colorspace);
2708 if (anim ==
nullptr) {
2713 if (ibuf ==
nullptr) {
2716 reason =
"file doesn't exist";
2719 reason =
"not an anim";
2721 CLOG_INFO(&
LOG, 1,
"unable to load anim, %s: %s", reason, filepath);
2762 if (ima->
type == type) {
2768 if (ima ==
nullptr) {
2773 if (ima->
id.
us == 0) {
2813 return image_view->
name[0] ==
'\0';
2824 if (!scene_render_view) {
2863 void callback(
Image *ima,
ID *iuser_id,
ImageUser *iuser,
void *customdata))
2865 switch (ntree->
type) {
2867 for (
bNode *node : ntree->all_nodes()) {
2872 callback(ima,
id, &tex->
iuser, customdata);
2877 callback(ima,
id, &tex->
iuser, customdata);
2883 for (
bNode *node : ntree->all_nodes()) {
2887 callback(ima,
id, iuser, customdata);
2892 for (
bNode *node : ntree->all_nodes()) {
2896 callback(ima,
id, iuser, customdata);
2903 callback(image,
id, image_user, customdata);
2915 void callback(
Image *ima,
ID *iuser_id,
ImageUser *iuser,
void *customdata))
2921 if (gpu_material_texture->iuser_available) {
2922 callback(gpu_material_texture->ima,
id, &gpu_material_texture->iuser, customdata);
2930 bool skip_nested_nodes,
2932 void callback(
Image *ima,
ID *iuser_id,
ImageUser *iuser,
void *customdata))
2968 callback(tex->
ima, &tex->
id, &tex->
iuser, customdata);
2983 callback(bgpic->ima,
nullptr, &bgpic->iuser, customdata);
2995 callback(sima->
image,
nullptr, &sima->
iuser, customdata);
3016 void callback(
Image *ima,
ID *iuser_id,
ImageUser *iuser,
void *customdata))
3019 scene =
static_cast<Scene *
>(scene->id.next))
3025 ob =
static_cast<Object *
>(ob->id.next))
3037 ma =
static_cast<Material *
>(ma->id.next))
3043 light =
static_cast<Light *
>(light->id.next))
3049 world =
static_cast<World *
>(world->id.next))
3055 tex =
static_cast<Tex *
>(tex->id.next))
3061 cam =
static_cast<Camera *
>(cam->id.next))
3075 Image *changed_image =
static_cast<Image *
>(customdata);
3089 Image *changed_image =
static_cast<Image *
>(customdata);
3091 if (ima == changed_image) {
3131 for (
int eye = 0; eye < 2; eye++) {
3142 for (
int i = 0;
i < totviews;
i++) {
3175 if (ima ==
nullptr) {
3179 ima->
runtime->cache_mutex.lock();
3200 if (base_tile->
gen_x == 0 || base_tile->
gen_y == 0) {
3203 base_tile->
gen_x = ibuf->
x;
3204 base_tile->
gen_y = ibuf->
y;
3284 imapf->packedfile =
pf;
3287 printf(
"ERROR: Image \"%s\" not available. Keeping packed image\n", imapf->filepath);
3301 ListBase new_tiles = {
nullptr,
nullptr};
3302 int new_start, new_range;
3316 int remaining_tile_number = base_tile->
tile_number;
3317 bool needs_final_cleanup =
true;
3326 if (new_tile_number == remaining_tile_number) {
3327 needs_final_cleanup =
false;
3332 if (needs_final_cleanup) {
3338 else if (ima->
filepath[0] !=
'\0') {
3365 ima->
runtime->cache_mutex.unlock();
3384 const char *rp_name =
"";
3388 if (rp_index == pass) {
3395 rp_name = rpass->
name;
3405 if (rpass_ret ==
nullptr) {
3411 *r_passindex = (rpass == rpass_ret ? rp_index : pass);
3420 const int label_maxncpy)
3423 if (ima ==
nullptr ||
tile ==
nullptr) {
3427 if (
tile->label[0]) {
3445 bool all_valid_udim =
true;
3452 for (
int i = 0;
i < dirs_num;
i++) {
3453 if (!(dirs[
i].type & S_IFREG)) {
3463 all_valid_udim =
false;
3468 min_udim =
min_ii(min_udim,
id);
3469 max_udim =
max_ii(max_udim,
id);
3477 *r_tile_start = min_udim;
3478 *r_tile_range = max_udim - min_udim + 1;
3490 if (tile_number < 1001 || tile_number >
IMA_UDIM_MAX) {
3498 next_tile = next_tile->
next)
3522 for (
int eye = 0; eye < 2; eye++) {
3553 if (new_tile_number < 1001 || new_tile_number >
IMA_UDIM_MAX) {
3557 const int old_tile_number =
tile->tile_number;
3558 tile->tile_number = new_tile_number;
3562 for (
int i = 0;
i < totviews;
i++) {
3576 for (
int eye = 0; eye < 2; eye++) {
3616 if (tile_ibuf !=
nullptr) {
3627 return strstr(filename,
"<UDIM>") !=
nullptr || strstr(filename,
"<UVTILE>") !=
nullptr;
3633 "Only the file-name component should be used!");
3639 std::string path(filename);
3645 std::regex pattern(R
"((.*[._-])([12]\d{3})([._-].*))");
3646 if (std::regex_search(path, match, pattern)) {
3647 BLI_strncpy(filename, match.format(
"$1<UDIM>$3").c_str(), filename_maxncpy);
3652 pattern = std::regex(R
"((.*)(u\d{1,2}_v\d{1,3})(\D.*))");
3653 if (std::regex_search(path, match, pattern)) {
3654 BLI_strncpy(filename, match.format(
"$1<UVTILE>$3").c_str(), filename_maxncpy);
3678 for (
int i = 0;
i < dirs_num;
i++) {
3679 if (!(dirs[
i].type & S_IFREG)) {
3703 if (filepath ==
nullptr || r_tile_format ==
nullptr) {
3707 if (strstr(filepath,
"<UDIM>") !=
nullptr) {
3711 if (strstr(filepath,
"<UVTILE>") !=
nullptr) {
3721 const char *pattern,
3725 if (filepath ==
nullptr || pattern ==
nullptr || r_tile_number ==
nullptr) {
3733 if (sscanf(filepath, pattern, &u) == 1) {
3739 if (sscanf(filepath, pattern, &u, &
v) == 2) {
3740 *r_tile_number = 1001 + (u - 1) + ((
v - 1) * 10);
3749 const char *pattern,
3753 if (filepath ==
nullptr || pattern ==
nullptr) {
3761 int u = ((tile_number - 1001) % 10);
3762 int v = ((tile_number - 1001) / 10);
3775 if (rr ==
nullptr) {
3780 short index = 0, rv_index, rl_index = 0;
3789 if (iuser->
layer == rl_index) {
3811 if ((iuser->
view < 0) ||
3863 bool modified =
false;
3864 for (; rv; rv = rv->
next, iv = iv->
next) {
3914 if (render_result) {
3932#ifdef WITH_IMAGE_OPENEXR
3963 last_slot->
render =
nullptr;
3967 if (free_current_slot) {
4004 if (left_iv ==
nullptr) {
4018#ifdef WITH_IMAGE_OPENEXR
4019static void image_create_multilayer(
Image *ima,
ImBuf *ibuf,
int framenr)
4032 if (ima->
rr !=
nullptr) {
4084 if (!is_multiview) {
4097 ImBuf *ibuf =
nullptr;
4102 if (ima->
rr ==
nullptr || frame != ima->
rr->
framenr) {
4117 printf(
"error, multi is normal image\n");
4123 if (rpass && rpass->
ibuf) {
4141 ImBuf *ibuf =
nullptr;
4146 if (ia->
anim ==
nullptr) {
4159 iuser_t.
view = view_id;
4167 if (ia->
anim && iuser && iuser->
frames == 0) {
4174 int fra = frame - 1;
4176 fra = std::max(fra, 0);
4177 fra = std::min(fra, dur - 1);
4191 ImBuf *ibuf =
nullptr;
4198 for (
int i = 0;
i < tot_viewfiles;
i++) {
4205 if (!is_multiview) {
4213 for (
int i = 0;
i < tot_viewfiles;
i++) {
4221 for (
int i = 0;
i < totviews;
i++) {
4226 ibuf = ibuf_arr[(iuser ? iuser->
multi_index : 0)];
4229 for (
int i = 0;
i < totviews;
i++) {
4230 if (ibuf_arr[
i] != ibuf) {
4243 const bool has_packed,
4244 const bool is_sequence,
4248 ImBuf *ibuf =
nullptr;
4251 *r_cache_ibuf =
true;
4255 if (has_packed && !is_sequence) {
4257 if (imapf->view == view_id && imapf->tile_number == tile_number) {
4258 if (imapf->packedfile) {
4260 imapf->packedfile->size,
4277 if (!(is_sequence || is_tiled)) {
4289 iuser_t.
view = view_id;
4298#ifdef WITH_IMAGE_OPENEXR
4303 image_create_multilayer(ima, ibuf, cfra);
4309 *r_cache_ibuf =
false;
4318 if (!is_sequence && (has_packed ==
false) && (
G.fileflags &
G_FILE_AUTOPACK)) {
4323 imapf->
view = view_id;
4338 Image *ima,
ImageUser *iuser,
int entry,
int cfra,
bool is_sequence)
4340 ImBuf *ibuf =
nullptr;
4346 if (!(is_sequence || is_tiled)) {
4352 if (!is_sequence && has_packed) {
4360 if (!is_multiview) {
4362 ibuf =
load_image_single(ima, iuser, cfra, 0, has_packed, is_sequence, &put_in_cache);
4364 const int index = (is_sequence || is_tiled) ? 0 :
IMA_NO_INDEX;
4375 for (
int i = 0;
i < tot_viewfiles;
i++) {
4377 ima, iuser, cfra,
i, has_packed, is_sequence, &cache_ibuf_arr[
i]);
4382 tot_viewfiles == 1 && totviews >= 2)
4389 ibuf = ibuf_arr[ibuf_index];
4391 for (
int i = 0;
i < totviews;
i++) {
4392 if (cache_ibuf_arr[
i]) {
4398 for (
int i = 0;
i < totviews;
i++) {
4399 if (ibuf_arr[
i] != ibuf) {
4410 ImBuf *ibuf =
nullptr;
4412 if (ima->
rr ==
nullptr) {
4422 if (rpass && rpass->
ibuf) {
4444 ImBuf *pass_ibuf =
nullptr;
4448 if (!(iuser && iuser->
scene)) {
4459 const int layer = iuser->
layer;
4460 const int pass = iuser->
pass;
4461 int actview = iuser->
view;
4492 if (rv ==
nullptr) {
4498 if (rv ==
nullptr) {
4499 pass_ibuf = rres.
ibuf;
4502 pass_ibuf = rv->
ibuf;
4520 pass_ibuf = rpass->
ibuf;
4540 if (ima->
cache ==
nullptr) {
4555 pass_ibuf->
dither = dither;
4565 pass_ibuf->
x = rres.
rectx;
4566 pass_ibuf->
y = rres.
recty;
4579 if (is_multilayer) {
4626 Image *ima,
ImageUser *iuser,
int *r_entry,
int *r_index,
bool *r_is_cached_empty)
4628 ImBuf *ibuf =
nullptr;
4684 if (ima ==
nullptr) {
4689 if (
tile ==
nullptr) {
4703 ImBuf *ibuf =
nullptr;
4704 int entry = 0, index = 0;
4715 bool is_cached_empty =
false;
4717 if (is_cached_empty) {
4721 if (ibuf ==
nullptr) {
4761 ima, iuser, 0, entry,
false);
4773 if (base_tile->
gen_x == 0) {
4774 base_tile->
gen_x = 1024;
4776 if (base_tile->
gen_y == 0) {
4777 base_tile->
gen_y = 1024;
4828 if (ima ==
nullptr) {
4838 const char *view_name)
4844 const int view_image = image_user.
view;
4845 const bool is_allview = (view_image == 0);
4857 return view_image - 1;
4863 const char *pass_name,
4864 const char *view_name)
4866 std::scoped_lock
lock(image.
runtime->cache_mutex);
4903 if (
lock !=
nullptr) {
4939 return ibuf !=
nullptr;
4946 if (image_ibuf ==
nullptr) {
4951 float scale = float(max_size) / float(std::max(image_ibuf->
x, image_ibuf->
y));
4953 *r_width = image_ibuf->
x;
4956 *r_height = image_ibuf->
y;
4989 ImagePool *pool = MEM_new<ImagePool>(__func__);
5003 if (item->ibuf !=
nullptr) {
5004 std::scoped_lock
lock(item->image->runtime->cache_mutex);
5015 ImagePool *pool,
Image *image,
int entry,
int index,
bool *r_found)
5018 if (item->image == image && item->entry == entry && item->index == index) {
5038 if (pool ==
nullptr) {
5070 item->
entry = entry;
5071 item->
index = index;
5085 if (pool ==
nullptr) {
5094 if (r_is_in_range) {
5095 *r_is_in_range =
false;
5103 cfra = cfra - iuser->
sfra + 1;
5107 cfra = ((cfra) %
len);
5115 if (r_is_in_range) {
5116 *r_is_in_range =
true;
5123 else if (cfra >
len) {
5127 if (r_is_in_range) {
5128 *r_is_in_range =
true;
5134 framenr = std::min(framenr, iuser->
frames);
5137 framenr = ((framenr) %
len);
5138 while (framenr < 0) {
5147 framenr += iuser->
offset;
5197 int cfra = *(
int *)customdata;
5218 *(
bool *)customdata =
true;
5226 bool has_animation =
false;
5227 bool skip_nested_nodes =
true;
5229 return has_animation;
5238 Depsgraph *
depsgraph = (Depsgraph *)customdata;
5257 bool skip_nested_nodes =
true;
5270 const bool resolve_udim,
5271 const bool resolve_multiview)
5296 else if (resolve_udim) {
5313 const int planes = (ibuf ? ibuf->
planes : 0);
5316 if (
ELEM(planes, 32, 16)) {
5325 ImBuf *ibuf =
nullptr;
5328 if (image !=
nullptr) {
5332 if (ibuf && ibuf->
x > 0 && ibuf->
y > 0) {
5334 *r_height = ibuf->
y;
5337 iuser->
scene !=
nullptr)
5346 if (image !=
nullptr) {
5356 r_size[0] = float(width);
5357 r_size[1] = float(height);
5366 *r_aspy = image->
aspy / image->
aspx;
5379 uchar *pixels =
nullptr;
5409 float *pixels =
nullptr;
5467 bool is_dirty =
false;
5468 bool is_writable =
false;
5470 std::scoped_lock
lock(image->
runtime->cache_mutex);
5471 if (image->
cache !=
nullptr) {
5486 if (r_is_writable) {
5487 *r_is_writable = is_writable;
5513 std::scoped_lock
lock(image->
runtime->cache_mutex);
5514 if (image->
cache !=
nullptr) {
5519 if (ibuf !=
nullptr) {
5531 bool has_loaded_ibuf =
false;
5533 std::scoped_lock
lock(image->
runtime->cache_mutex);
5534 if (image->
cache !=
nullptr) {
5539 if (ibuf !=
nullptr) {
5540 has_loaded_ibuf =
true;
5548 return has_loaded_ibuf;
5554 ImBuf *ibuf =
nullptr;
5556 std::scoped_lock
lock(image->
runtime->cache_mutex);
5557 if (image->
cache !=
nullptr) {
5562 if (current_ibuf !=
nullptr &&
STREQ(current_ibuf->
filepath, filepath)) {
5563 ibuf = current_ibuf;
5577 ImBuf *ibuf =
nullptr;
5579 std::scoped_lock
lock(image->
runtime->cache_mutex);
5580 if (image->
cache !=
nullptr) {
5585 if (ibuf !=
nullptr) {
5606 if (!is_multiview) {
5612 for (
int i = 0;
i < 2;
i++) {
5621 const char *ext =
nullptr;
5625 if (prefix[0] ==
'\0') {
5634 SNPRINTF(filepath_view,
"%s%s%s", prefix, srv->suffix, ext);
5678 if (name && name[0]) {
5693 if (
G.is_rendering) {
5699 if (slot >= num_slots || num_slots == 1) {
5710 if (current_slot == remove_slot) {
5715 next_slot = current_slot;
5720 if (remove_slot == current_last_slot) {
5724 if (current_slot == remove_slot) {
5725 next_last_slot = next_slot;
5728 next_last_slot = current_slot;
5731 if (iuser ==
nullptr || iuser->
scene ==
nullptr) {
5735 if (re !=
nullptr) {
5739 current_last_slot = next_last_slot;
5742 current_slot = next_slot;
5749 if (remove_slot->
render) {
5763 if (
G.is_rendering) {
5778 if (render_slot->
render) {
5780 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)
@ IDTYPE_FLAGS_APPEND_IS_REUSABLE
@ IDTYPE_FLAGS_NO_ANIMDATA
void(*)(ID *id, const IDCacheKey *cache_key, void **cache_p, uint flags, void *user_data) IDTypeForeachCacheFunctionCallback
@ 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 CMP_NODE_CRYPTOMATTE
#define SH_NODE_TEX_ENVIRONMENT
void BKE_ntree_update(Main &bmain, std::optional< blender::Span< bNodeTree * > > modified_trees=std::nullopt, const NodeTreeUpdateExtraParams ¶ms={})
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_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, const ColorManagedDisplay *display)
void BLF_disable(int fontid, int option)
void BLF_buffer_col(int fontid, const float rgba[4]) ATTR_NONNULL(2)
void BLF_wordwrap(int fontid, int wrap_width, BLFWrapMode mode=BLFWrapMode::Minimal)
blender::ocio::Display ColorManagedDisplay
void BLF_enable(int fontid, int option)
int BLF_height_max(int fontid) ATTR_WARN_UNUSED_RESULT
void BLF_position(int fontid, float x, float y, float z)
#define BLI_assert_msg(a, msg)
File and directory operations.
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)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
LinkData * BLI_genericNodeN(void *data)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE void BLI_listbase_clear(ListBase *lb)
void * BLI_findstring(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
void void BLI_freelistN(ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_insertlinkafter(ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
int BLI_listbase_count_at_most(const ListBase *listbase, int count_max) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_addhead(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_findstringindex(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void void BLI_listbase_sort(ListBase *listbase, int(*cmp)(const void *, const void *)) ATTR_NONNULL(1
BLI_INLINE bool BLI_listbase_count_is_equal_to(const ListBase *listbase, const int count_cmp)
int BLI_listbase_count(const ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void void void void void void BLI_duplicatelist(ListBase *dst, const ListBase *src) ATTR_NONNULL(1
void BLI_insertlinkbefore(ListBase *listbase, void *vnextlink, void *vnewlink) ATTR_NONNULL(1)
void void BLI_INLINE bool BLI_listbase_is_single(const ListBase *lb)
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 copy_v2_v2_db(double r[2], const double a[2])
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 SNPRINTF(dst, format,...)
size_t BLI_snprintf_rlen(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char * STRNCPY(char(&dst)[N], const char *src)
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
#define STRNCPY_UTF8(dst, src)
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_thread_lock(int type)
int BLI_thread_is_main(void)
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 DNA_struct_default_get(struct_name)
@ IMA_ALPHA_CHANNEL_PACKED
@ IMA_USER_FRAME_IN_RANGE
@ CMP_NODE_CRYPTOMATTE_SOURCE_IMAGE
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
ListBase GPU_material_textures(GPUMaterial *material)
void GPU_texture_free(GPUTexture *texture)
void IMB_colormanagement_assign_byte_colorspace(ImBuf *ibuf, 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)
@ COLOR_ROLE_DEFAULT_FLOAT
@ COLOR_ROLE_DEFAULT_BYTE
const char * IMB_colormanagement_role_colorspace_name_get(int role)
const ColorManagedDisplay * IMB_colormanagement_display_get_named(const char *name)
ImBuf * IMB_load_image_from_filepath(const char *filepath, const int flags, char r_colorspace[IM_MAX_SPACE]=nullptr)
ImBuf * IMB_dupImBuf(const ImBuf *ibuf1)
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)
ImBuf * IMB_makeSingleUser(ImBuf *ibuf)
void buf_rectfill_area(unsigned char *rect, float *rectf, int width, int height, const float col[4], const ColorManagedDisplay *display, int x1, int y1, int x2, int y2)
void IMB_ImBufFromStereo3d(const Stereo3dFormat *s3d, ImBuf *ibuf_stereo3d, ImBuf **r_ibuf_left, ImBuf **r_ibuf_right)
void IMB_byte_from_float(ImBuf *ibuf)
void IMB_freeImBuf(ImBuf *ibuf)
size_t IMB_get_pixel_count(const ImBuf *ibuf)
Get the length of the data of the given image buffer in pixels.
ImBuf * IMB_allocImBuf(unsigned int x, unsigned int y, unsigned char planes, unsigned int flags)
void IMB_refImBuf(ImBuf *ibuf)
uint8_t * IMB_steal_encoded_buffer(ImBuf *ibuf)
bool IMB_save_image(ImBuf *ibuf, const char *filepath, const int flags)
bool IMB_scale(ImBuf *ibuf, unsigned int newx, unsigned int newy, IMBScaleFilter filter, bool threaded=true)
size_t IMB_get_size_in_memory(const ImBuf *ibuf)
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.
int pad[32 - sizeof(int)]
BMesh const char void * data
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.
void colormanage_imbuf_make_linear(ImBuf *ibuf, const char *from_colorspace)
CCL_NAMESPACE_BEGIN struct Options options
#define pf(_x, _i)
Prefetch 64.
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
#define IMAGE_GPU_PASS_NONE
#define IMAGE_GPU_LAYER_NONE
#define ID_BLEND_PATH_FROM_GLOBAL(_id)
#define ID_BLEND_PATH(_bmain, _id)
#define IMAGE_GPU_FRAME_NONE
#define ID_IS_OVERRIDE_LIBRARY(_id)
#define IMAGE_GPU_VIEW_NONE
ccl_gpu_kernel_postfix ccl_global KernelWorkTile * tiles
const ccl_global KernelWorkTile * tile
void * MEM_mallocN(size_t len, const char *str)
void * MEM_callocN(size_t len, const char *str)
void * MEM_dupallocN(const void *vmemh)
void MEM_freeN(void *vmemh)
void MOV_close(MovieReader *anim)
MovieReader * MOV_open_file(const char *filepath, int ib_flags, int streamindex, char colorspace[IM_MAX_SPACE])
int MOV_get_duration_frames(MovieReader *anim, IMB_Timecode_Type tc)
ImBuf * MOV_decode_frame(MovieReader *anim, int position, IMB_Timecode_Type tc, IMB_Proxy_Size preview_size)
const Strip * strip_topmost_get(const Scene *scene, int frame)
float wrap(float value, float max, float min)
bool RE_HasCombinedLayer(const RenderResult *result)
bool RE_RenderResult_is_stereo(const RenderResult *result)
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))
static void image_gpu_runtime_reset(Image *ima)
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)
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)
MovieReader * openanim_noload(const char *filepath, int flags, int streamindex, char colorspace[IMA_MAX_SPACE])
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[]
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 bool image_views_match_render_views(const Image *image, const RenderData *render_data)
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)
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))
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)
MovieReader * openanim(const char *filepath, int flags, int streamindex, char colorspace[IMA_MAX_SPACE])
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)
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
const ColorSpace * colorspace
const ColorSpace * colorspace
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 MovieReader * anim
struct PackedFile * packedfile
struct ImagePackedFile * next
BLI_mempool * memory_pool
struct MovieCache * cache
struct ListBase packedfiles
struct PreviewImage * preview
ColorManagedColorspaceSettings colorspace_settings
struct GPUTexture * gputexture[3][2]
struct Stereo3dFormat * stereo3d_format
ImageRuntimeHandle * runtime
LibraryRuntimeHandle * 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
struct bNodeTree * nodetree
void * BKE_image_free_buffers
void * BKE_image_get_tile_from_iuser
void * BKE_image_get_tile