Blender V4.3
BKE_image.hh File Reference
#include "BLI_compiler_attrs.h"
#include "BLI_utildefines.h"
#include "BLI_rect.h"
#include <optional>

Go to the source code of this file.

Classes

struct  ImageGPUTextures
 

Macros

#define IMA_MAX_SPACE   64
 
#define IMA_UDIM_MAX   2000
 
#define IMA_SIGNAL_RELOAD   0
 
#define IMA_SIGNAL_FREE   1
 
#define IMA_SIGNAL_SRC_CHANGE   5
 
#define IMA_SIGNAL_USER_NEW_IMAGE   6
 
#define IMA_SIGNAL_COLORMANAGE   7
 

Typedefs

typedef void StampCallback(void *data, const char *propname, char *propvalue, int propvalue_maxncpy)
 

Enumerations

enum  eUDIM_TILE_FORMAT { UDIM_TILE_FORMAT_NONE = 0 , UDIM_TILE_FORMAT_UDIM = 1 , UDIM_TILE_FORMAT_UVTILE = 2 }
 

Functions

void BKE_image_free_packedfiles (Image *image)
 
void BKE_image_free_views (Image *image)
 
void BKE_image_free_buffers (Image *image)
 
void BKE_image_free_buffers_ex (Image *image, bool do_lock)
 
void BKE_image_free_gputextures (Image *ima)
 
void BKE_image_free_data (Image *image)
 
void BKE_render_result_stamp_info (Scene *scene, Object *camera, RenderResult *rr, bool allocate_only)
 
StampDataBKE_stamp_info_from_scene_static (const Scene *scene)
 
bool BKE_stamp_is_known_field (const char *field_name)
 
void BKE_imbuf_stamp_info (const RenderResult *rr, ImBuf *ibuf)
 
void BKE_stamp_info_from_imbuf (RenderResult *rr, ImBuf *ibuf)
 
void BKE_stamp_info_callback (void *data, StampData *stamp_data, StampCallback callback, bool noskip)
 
void BKE_image_multilayer_stamp_info_callback (void *data, const Image &image, StampCallback callback, bool noskip)
 
void BKE_render_result_stamp_data (RenderResult *rr, const char *key, const char *value)
 
StampDataBKE_stamp_data_copy (const StampData *stamp_data)
 
void BKE_stamp_data_free (StampData *stamp_data)
 
void BKE_image_stamp_buf (Scene *scene, Object *camera, const StampData *stamp_data_template, unsigned char *rect, float *rectf, int width, int height)
 
bool BKE_imbuf_alpha_test (ImBuf *ibuf)
 
bool BKE_imbuf_write_stamp (const Scene *scene, const RenderResult *rr, ImBuf *ibuf, const char *filepath, const ImageFormatData *imf)
 
bool BKE_imbuf_write (ImBuf *ibuf, const char *filepath, const ImageFormatData *imf)
 
bool BKE_imbuf_write_as (ImBuf *ibuf, const char *filepath, const ImageFormatData *imf, bool save_copy)
 
ImBufAnimopenanim (const char *filepath, int flags, int streamindex, char colorspace[IMA_MAX_SPACE])
 
ImBufAnimopenanim_noload (const char *filepath, int flags, int streamindex, char colorspace[IMA_MAX_SPACE])
 
void BKE_image_tag_time (Image *ima)
 
bool BKE_image_has_ibuf (Image *ima, ImageUser *iuser)
 
ImBufBKE_image_acquire_ibuf (Image *ima, ImageUser *iuser, void **r_lock)
 
ImBufBKE_image_acquire_multilayer_view_ibuf (const RenderData &render_data, Image &image, const ImageUser &image_user, const char *pass_name, const char *view_name)
 
void BKE_image_release_ibuf (Image *ima, ImBuf *ibuf, void *lock)
 
ImBufBKE_image_preview (Image *ima, short max_size, short *r_width, short *r_height)
 
ImagePoolBKE_image_pool_new (void)
 
void BKE_image_pool_free (ImagePool *pool)
 
ImBufBKE_image_pool_acquire_ibuf (Image *ima, ImageUser *iuser, ImagePool *pool)
 
void BKE_image_pool_release_ibuf (Image *ima, ImBuf *ibuf, ImagePool *pool)
 
char BKE_image_alpha_mode_from_extension_ex (const char *filepath)
 
void BKE_image_alpha_mode_from_extension (Image *image)
 
ImageBKE_image_load (Main *bmain, const char *filepath)
 
ImageBKE_image_load_in_lib (Main *bmain, std::optional< Library * > owner_library, const char *filepath)
 
ImageBKE_image_load_exists (Main *bmain, const char *filepath, bool *r_exists=nullptr)
 
ImageBKE_image_load_exists_in_lib (Main *bmain, std::optional< Library * > owner_library, const char *filepath, bool *r_exists=nullptr)
 
ImageBKE_image_add_generated (Main *bmain, unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short gen_type, const float color[4], bool stereo3d, bool is_data, bool tiled)
 
ImageBKE_image_add_from_imbuf (Main *bmain, ImBuf *ibuf, const char *name)
 
void BKE_image_replace_imbuf (Image *image, ImBuf *ibuf)
 
void BKE_imageuser_default (ImageUser *iuser)
 
void BKE_image_init_imageuser (Image *ima, ImageUser *iuser)
 
void BKE_image_signal (Main *bmain, Image *ima, ImageUser *iuser, int signal)
 
void BKE_image_walk_all_users (const Main *mainp, void *customdata, void callback(Image *ima, ID *iuser_id, ImageUser *iuser, void *customdata))
 
ImageBKE_image_ensure_viewer (Main *bmain, int type, const char *name)
 
void BKE_image_ensure_viewer_views (const RenderData *rd, Image *ima, ImageUser *iuser)
 
void BKE_image_user_frame_calc (Image *ima, ImageUser *iuser, int cfra)
 
int BKE_image_user_frame_get (const ImageUser *iuser, int cfra, bool *r_is_in_range)
 
void BKE_image_user_file_path (const ImageUser *iuser, const Image *ima, char *filepath)
 
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)
 
void BKE_image_editors_update_frame (const Main *bmain, int cfra)
 
bool BKE_image_user_id_has_animation (ID *id)
 
void BKE_image_user_id_eval_animation (Depsgraph *depsgraph, ID *id)
 
RenderPassBKE_image_multilayer_index (RenderResult *rr, ImageUser *iuser)
 
void BKE_image_multiview_index (const Image *ima, ImageUser *iuser)
 
bool BKE_image_is_multilayer (const Image *ima)
 
bool BKE_image_is_multiview (const Image *ima)
 
bool BKE_image_is_stereo (const Image *ima)
 
RenderResultBKE_image_acquire_renderresult (Scene *scene, Image *ima)
 
void BKE_image_release_renderresult (Scene *scene, Image *ima, RenderResult *render_result)
 
bool BKE_image_is_openexr (Image *ima)
 
void BKE_image_backup_render (Scene *scene, Image *ima, bool free_current_slot)
 
void BKE_image_free_all_textures (Main *bmain)
 
void BKE_image_free_anim_ibufs (Image *ima, int except_frame)
 
void BKE_image_all_free_anim_ibufs (Main *bmain, int cfra)
 
void BKE_image_free_all_gputextures (Main *bmain)
 
void BKE_image_free_anim_gputextures (Main *bmain)
 
void BKE_image_free_old_gputextures (Main *bmain)
 
bool BKE_image_memorypack (Image *ima)
 
void BKE_image_packfiles (ReportList *reports, Image *ima, const char *basepath)
 
void BKE_image_packfiles_from_mem (ReportList *reports, Image *ima, char *data, size_t data_len)
 
void BKE_image_print_memlist (Main *bmain)
 
void BKE_image_merge (Main *bmain, Image *dest, Image *source)
 
bool BKE_image_scale (Image *image, int width, int height, ImageUser *iuser)
 
bool BKE_image_has_alpha (Image *image)
 
bool BKE_image_has_opengl_texture (Image *ima)
 
int BKE_image_get_tile_label (const Image *ima, const ImageTile *tile, char *label, int label_maxncpy)
 
bool BKE_image_get_tile_info (char *filepath, ListBase *tiles, int *r_tile_start, int *r_tile_range)
 
ImageTileBKE_image_add_tile (Image *ima, int tile_number, const char *label)
 
bool BKE_image_remove_tile (Image *ima, ImageTile *tile)
 
void BKE_image_reassign_tile (Image *ima, ImageTile *tile, int new_tile_number)
 
void BKE_image_sort_tiles (Image *ima)
 
bool BKE_image_fill_tile (Image *ima, ImageTile *tile)
 
bool BKE_image_is_filename_tokenized (char *filepath)
 
void BKE_image_ensure_tile_token (char *filepath, size_t filepath_maxncpy)
 
void BKE_image_ensure_tile_token_filename_only (char *filename, size_t filename_maxncpy)
 
bool BKE_image_tile_filepath_exists (const char *filepath)
 
char * BKE_image_get_tile_strformat (const char *filepath, eUDIM_TILE_FORMAT *r_tile_format)
 
bool BKE_image_get_tile_number_from_filepath (const char *filepath, const char *pattern, eUDIM_TILE_FORMAT tile_format, int *r_tile_number)
 
void BKE_image_set_filepath_from_tile_number (char *filepath, const char *pattern, eUDIM_TILE_FORMAT tile_format, int tile_number)
 
ImageTileBKE_image_get_tile (Image *ima, int tile_number)
 
ImageTileBKE_image_get_tile_from_iuser (Image *ima, const ImageUser *iuser)
 
int BKE_image_get_tile_from_pos (Image *ima, const float uv[2], float r_uv[2], float r_ofs[2])
 
void BKE_image_get_tile_uv (const Image *ima, const int tile_number, float r_uv[2])
 
int BKE_image_find_nearest_tile_with_offset (const Image *image, const float co[2], float r_uv_offset[2]) ATTR_NONNULL(2
 
int int BKE_image_find_nearest_tile (const Image *image, const float co[2]) ATTR_NONNULL(2) ATTR_WARN_UNUSED_RESULT
 
void BKE_image_get_size (Image *image, ImageUser *iuser, int *r_width, int *r_height)
 
void BKE_image_get_size_fl (Image *image, ImageUser *iuser, float r_size[2])
 
void BKE_image_get_aspect (Image *image, float *r_aspx, float *r_aspy)
 
void BKE_image_buf_fill_color (unsigned char *rect, float *rect_float, int width, int height, const float color[4])
 
void BKE_image_buf_fill_checker (unsigned char *rect, float *rect_float, int width, int height)
 
void BKE_image_buf_fill_checker_color (unsigned char *rect, float *rect_float, int width, int height)
 
unsigned char * BKE_image_get_pixels_for_frame (Image *image, int frame, int tile)
 
floatBKE_image_get_float_pixels_for_frame (Image *image, int frame, int tile)
 
bool BKE_image_is_dirty (Image *image)
 
void BKE_image_mark_dirty (Image *image, ImBuf *ibuf)
 
bool BKE_image_buffer_format_writable (ImBuf *ibuf)
 
bool BKE_image_is_dirty_writable (Image *image, bool *r_is_writable)
 
int BKE_image_sequence_guess_offset (Image *image)
 
bool BKE_image_has_anim (Image *image)
 
bool BKE_image_has_packedfile (const Image *image)
 
bool BKE_image_has_filepath (const Image *ima)
 
bool BKE_image_is_animated (Image *image)
 
bool BKE_image_has_multiple_ibufs (Image *image)
 
void BKE_image_file_format_set (Image *image, int ftype, const ImbFormatOptions *options)
 
bool BKE_image_has_loaded_ibuf (Image *image)
 
ImBufBKE_image_get_ibuf_with_name (Image *image, const char *filepath)
 
ImBufBKE_image_get_first_ibuf (Image *image)
 
GPUTexture * BKE_image_create_gpu_texture_from_ibuf (Image *image, ImBuf *ibuf)
 
void BKE_image_ensure_gpu_texture (Image *image, ImageUser *iuser)
 
GPUTexture * BKE_image_get_gpu_texture (Image *image, ImageUser *iuser)
 
GPUTexture * BKE_image_get_gpu_viewer_texture (Image *image, ImageUser *iuser)
 
ImageGPUTextures BKE_image_get_gpu_material_texture (Image *image, ImageUser *iuser, const bool use_tile_mapping)
 
bool BKE_image_has_gpu_texture_premultiplied_alpha (Image *image, ImBuf *ibuf)
 
void BKE_image_update_gputexture (Image *ima, ImageUser *iuser, int x, int y, int w, int h)
 
void BKE_image_update_gputexture_delayed (Image *ima, ImageTile *image_tile, ImBuf *ibuf, int x, int y, int w, int h)
 
void BKE_image_paint_set_mipmap (Main *bmain, bool mipmap)
 
void BKE_image_free_unused_gpu_textures (void)
 
RenderSlotBKE_image_add_renderslot (Image *ima, const char *name)
 
bool BKE_image_remove_renderslot (Image *ima, ImageUser *iuser, int slot)
 
RenderSlotBKE_image_get_renderslot (Image *ima, int index)
 
bool BKE_image_clear_renderslot (Image *ima, ImageUser *iuser, int slot)
 
PartialUpdateUser * BKE_image_partial_update_create (const Image *image)
 Create a new PartialUpdateUser. An Object that contains data to use partial updates.
 
void BKE_image_partial_update_free (PartialUpdateUser *user)
 free a partial update user.
 
void BKE_image_partial_update_register_free (Image *image)
 
void BKE_image_partial_update_mark_region (Image *image, const ImageTile *image_tile, const ImBuf *image_buffer, const rcti *updated_region)
 Mark a region of the image to update.
 
void BKE_image_partial_update_mark_full_update (Image *image)
 Mark the whole image to be updated.
 

Macro Definition Documentation

◆ IMA_MAX_SPACE

#define IMA_MAX_SPACE   64

Definition at line 37 of file BKE_image.hh.

◆ IMA_SIGNAL_COLORMANAGE

#define IMA_SIGNAL_COLORMANAGE   7

Definition at line 143 of file BKE_image.hh.

Referenced by BKE_image_save(), and BKE_image_signal().

◆ IMA_SIGNAL_FREE

◆ IMA_SIGNAL_RELOAD

◆ IMA_SIGNAL_SRC_CHANGE

#define IMA_SIGNAL_SRC_CHANGE   5

Definition at line 140 of file BKE_image.hh.

Referenced by BKE_image_signal(), and image_replace_exec().

◆ IMA_SIGNAL_USER_NEW_IMAGE

◆ IMA_UDIM_MAX

Typedef Documentation

◆ StampCallback

typedef void StampCallback(void *data, const char *propname, char *propvalue, int propvalue_maxncpy)

Definition at line 55 of file BKE_image.hh.

Enumeration Type Documentation

◆ eUDIM_TILE_FORMAT

Enumerator
UDIM_TILE_FORMAT_NONE 
UDIM_TILE_FORMAT_UDIM 
UDIM_TILE_FORMAT_UVTILE 

Definition at line 422 of file BKE_image.hh.

Function Documentation

◆ BKE_image_acquire_ibuf()

ImBuf * BKE_image_acquire_ibuf ( Image * ima,
ImageUser * iuser,
void ** r_lock )

Return image buffer for given image and user:

  • will lock render result if image type is render result and lock is not NULL
  • will return NULL if image is NULL or image type is render or composite result and lock is NULL

References the result, BKE_image_release_ibuf should be used to de-reference.

Definition at line 4812 of file source/blender/blenkernel/intern/image.cc.

References BLI_mutex_lock(), BLI_mutex_unlock(), Image_Runtime::cache_mutex, image_acquire_ibuf(), and Image::runtime.

Referenced by blender::ed::greasepencil::ImageBufferAccessor::acquire(), blender::draw::image_engine::SpaceNodeAccessor::acquire_image_buffer(), blender::bke::pbvh::pixels::apply_watertight_check(), blender::ed::space_node::backimage_fit_exec(), bake_images(), blender::ed::object::bake_object_check(), blender::ed::object::bake_targets_init_internal(), BKE_image_get_float_pixels_for_frame(), BKE_image_get_pixels_for_frame(), BKE_image_get_size(), BKE_image_has_alpha(), BKE_image_pool_acquire_ibuf(), BKE_image_preview(), BKE_image_save_options_init(), BKE_image_scale(), BKE_image_update_gputexture(), BKE_paint_canvas_key_get(), blender::realtime_compositor::CachedImage::CachedImage(), blender::ed::object::clear_single_image(), cmp_node_image_create_outputs(), colorfn(), blender::nodes::node_composite_cryptomatte_cc::CryptoMatteOperation::compute_image_domain(), blender::compositor::ImageNode::convert_to_operations(), blender::bke::pbvh::pixels::copy_pixels(), blender::bke::pbvh::pixels::copy_update(), cryptomatte_init_from_node_image(), blender::bke::pbvh::pixels::do_encode_pixels(), blender::ed::sculpt_paint::paint::image::do_paint_pixels(), blender::ed::sculpt_paint::paint::image::do_push_undo_tile(), blender::ed::space_node::draw_nodespace_back_pix(), draw_plane_marker_image(), ED_space_image_acquire_buffer(), ED_space_node_color_sample(), ED_space_node_get_position(), blender::io::usd::export_in_memory_texture(), eyedropper_cryptomatte_sample_image_fl(), finish_images(), blender::io::usd::get_in_memory_texture_filename(), blender::nodes::node_composite_cryptomatte_cc::CryptoMatteOperation::get_layers_from_image(), gpu_texture_create_tile_array(), icon_preview_startjob(), image_clipboard_copy_exec(), image_file_format_writable(), image_flip_exec(), image_from_context_has_data_poll(), image_get_gpu_texture(), image_invert_exec(), image_rect_update(), image_rotate_orthogonal_exec(), image_save_single(), image_scale_exec(), image_scale_invoke(), image_undosys_step_encode(), blender::nodes::node_geo_image_texture_cc::ImageFieldsFunction::ImageFieldsFunction(), blender::bke::image::partial_update::ImageTileData::init_data(), blender::bke::pbvh::pixels::mark_image_dirty(), metadata_panel_context_draw(), blender::ed::object::multiresbake_check(), blender::nodes::node_geo_image_info_cc::node_geo_exec(), paint_2d_bucket_fill(), paint_2d_canvas_set(), paint_2d_ensure_tile_canvas(), paint_2d_gradient_fill(), paint_2d_new_stroke(), paint_2d_redraw(), paint_sample_color(), palette_extract_img_exec(), project_paint_build_proj_ima(), project_paint_PickColor(), project_paint_uvpixel_init(), project_paint_uvpixel_mask(), ptile_restore_runtime_map(), RE_bake_ibuf_clear(), render_endjob(), blender::ed::space_node::sample_apply(), screen_opengl_render_apply(), blender::bke::image::partial_update::ImagePartialUpdateTest::SetUp(), blender::ed::space_node::snode_bg_viewmove_invoke(), texture_paint_camera_project_exec(), tile_fill_init(), uhandle_restore_list(), uiTemplateImage(), uiTemplateImageInfo(), blender::bke::pbvh::pixels::update_pixels(), blender::ed::space_node::viewer_border_exec(), blender::render::Context::viewer_output_to_viewer_image(), blender::ed::space_node::WIDGETGROUP_node_corner_pin_refresh(), blender::ed::space_node::WIDGETGROUP_node_crop_refresh(), blender::ed::space_node::WIDGETGROUP_node_sbeam_refresh(), blender::ed::space_node::WIDGETGROUP_node_transform_refresh(), and blender::ed::object::write_internal_bake_pixels().

◆ BKE_image_acquire_multilayer_view_ibuf()

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 )

Return image buffer for given image, user, pass, and view. Is thread-safe, so another thread can be changing image while this function is executed.

If the image is single-layer then the pass name is completely ignored.

If the image is multi-layer then this function does all needed internal configurations to read the pass. There is no need to acquire a temporary ImBuf prior to this call (which is what some legacy code had to do to ensure proper type and RenderResult).

References the result, BKE_image_release_ibuf should be used to de-reference.

Definition at line 4856 of file source/blender/blenkernel/intern/image.cc.

References BKE_image_is_multilayer(), BKE_image_multilayer_index(), BKE_scene_multiview_view_id_get(), BLI_assert, BLI_findlink(), BLI_findstringindex(), BLI_mutex_lock(), BLI_mutex_unlock(), get_multilayer_view_index(), image_acquire_ibuf(), IMB_freeImBuf(), ImageUser::layer, ImageUser::multi_index, offsetof, ImageUser::pass, RenderLayer::passes, and ImageUser::view.

Referenced by blender::compositor::BaseImageOperation::get_im_buf(), and blender::compositor::MultilayerBaseOperation::get_im_buf().

◆ BKE_image_acquire_renderresult()

RenderResult * BKE_image_acquire_renderresult ( Scene * scene,
Image * ima )

◆ BKE_image_add_from_imbuf()

Image * BKE_image_add_from_imbuf ( Main * bmain,
ImBuf * ibuf,
const char * name )

Create an image from ibuf. The reference-count of ibuf is increased, caller should take care to drop its reference by calling IMB_freeImBuf if needed.

Definition at line 1345 of file source/blender/blenkernel/intern/image.cc.

References BKE_image_replace_imbuf(), BLI_path_basename(), ImBuf::filepath, IMA_SRC_FILE, IMA_SRC_GENERATED, IMA_TYPE_IMAGE, and image_alloc().

Referenced by image_clipboard_paste_exec(), blender::ed::greasepencil::image_render::image_render_end(), new_image_from_plane_marker_exec(), and texture_paint_image_from_view_exec().

◆ BKE_image_add_generated()

Image * BKE_image_add_generated ( Main * bmain,
unsigned int width,
unsigned int height,
const char * name,
int depth,
int floatbuf,
short gen_type,
const float color[4],
bool stereo3d,
bool is_data,
bool tiled )

◆ BKE_image_add_renderslot()

RenderSlot * BKE_image_add_renderslot ( Image * ima,
const char * name )

◆ BKE_image_add_tile()

◆ BKE_image_all_free_anim_ibufs()

void BKE_image_all_free_anim_ibufs ( Main * bmain,
int cfra )

Does all images with type MOVIE or SEQUENCE.

Definition at line 1683 of file source/blender/blenkernel/intern/image.cc.

References BKE_image_free_anim_ibufs(), BKE_image_is_animated(), ListBase::first, Image::id, Main::images, and ID::next.

Referenced by do_render_full_pipeline().

◆ BKE_image_alpha_mode_from_extension()

void BKE_image_alpha_mode_from_extension ( Image * image)

◆ BKE_image_alpha_mode_from_extension_ex()

char BKE_image_alpha_mode_from_extension_ex ( const char * filepath)

◆ BKE_image_backup_render()

◆ BKE_image_buf_fill_checker()

void BKE_image_buf_fill_checker ( unsigned char * rect,
float * rect_float,
int width,
int height )

◆ BKE_image_buf_fill_checker_color()

◆ BKE_image_buf_fill_color()

void BKE_image_buf_fill_color ( unsigned char * rect,
float * rect_float,
int width,
int height,
const float color[4] )

◆ BKE_image_buffer_format_writable()

◆ BKE_image_clear_renderslot()

◆ BKE_image_create_gpu_texture_from_ibuf()

GPUTexture * BKE_image_create_gpu_texture_from_ibuf ( Image * image,
ImBuf * ibuf )

Not to be use directly.

◆ BKE_image_editors_update_frame()

void BKE_image_editors_update_frame ( const Main * bmain,
int cfra )

◆ BKE_image_ensure_gpu_texture()

void BKE_image_ensure_gpu_texture ( Image * image,
ImageUser * iuser )

Ensure that the cached GPU texture inside the image matches the pass, layer, and view of the given image user, if not, invalidate the cache such that the next call to the GPU texture retrieval functions such as BKE_image_get_gpu_texture updates the cache with an image that matches the give image user.

This is provided as a separate function and not implemented as part of the GPU texture retrieval functions because the current cache system only allows a single pass, layer, and stereo view to be cached, so possible frequent cache invalidation can have performance implications, and making invalidation explicit by calling this function will help make that clear and pave the way for a more complete cache system in the future.

Definition at line 336 of file image_gpu.cc.

References BKE_image_partial_update_mark_full_update(), ImageUser::layer, ImageUser::multi_index, and ImageUser::pass.

◆ BKE_image_ensure_tile_token()

void BKE_image_ensure_tile_token ( char * filepath,
size_t filepath_maxncpy )

Ensures that filename contains a UDIM token if we find a supported format pattern.

Note
This must only be the name component (without slashes).

Definition at line 3645 of file source/blender/blenkernel/intern/image.cc.

References BKE_image_ensure_tile_token_filename_only(), and BLI_path_basename().

Referenced by BKE_image_signal(), BKE_packedfile_unpack_image(), do_versions_after_linking_300(), and image_file_browse_exec().

◆ BKE_image_ensure_tile_token_filename_only()

void BKE_image_ensure_tile_token_filename_only ( char * filename,
size_t filename_maxncpy )

◆ BKE_image_ensure_viewer()

Image * BKE_image_ensure_viewer ( Main * bmain,
int type,
const char * name )

Ensures an Image exists for viewing nodes or render forces existence of 1 Image for render-output or nodes, returns Image.

Parameters
nameOnly for default, when making new one.

Definition at line 2773 of file source/blender/blenkernel/intern/image.cc.

References ListBase::first, Image::id, id_us_ensure_real(), IMA_SRC_VIEWER, image_alloc(), Main::images, ID::next, Image::source, Image::type, and ID::us.

Referenced by blender::ed::space_node::backimage_fit_exec(), blender::compositor::CompositorOperation::deinit_execution(), blender::ed::space_node::draw_nodespace_back_pix(), blender::draw::color_management::drw_color_management_type_for_space_node(), ED_node_composite_job(), ED_node_set_active(), ED_space_node_color_sample(), ED_space_node_get_position(), blender::draw::image_engine::SpaceNodeAccessor::get_image(), image_read_viewlayers_exec(), blender::nodes::node_composite_viewer_cc::node_composit_init_viewer(), blender::render::Context::output_to_render_result(), render_view_open(), blender::ed::space_node::sample_apply(), screen_opengl_render_init(), screen_render_exec(), screen_render_invoke(), blender::ed::space_node::snode_bg_viewmove_invoke(), blender::ed::space_node::viewer_border_exec(), blender::render::Context::viewer_output_to_viewer_image(), blender::ed::space_node::WIDGETGROUP_node_corner_pin_refresh(), blender::ed::space_node::WIDGETGROUP_node_crop_refresh(), blender::ed::space_node::WIDGETGROUP_node_sbeam_refresh(), blender::ed::space_node::WIDGETGROUP_node_transform_refresh(), and wm_draw_region_stereo_set().

◆ BKE_image_ensure_viewer_views()

◆ BKE_image_file_format_set()

◆ BKE_image_fill_tile()

bool BKE_image_fill_tile ( Image * ima,
ImageTile * tile )

◆ BKE_image_find_nearest_tile()

int int BKE_image_find_nearest_tile ( const Image * image,
const float co[2] )

◆ BKE_image_find_nearest_tile_with_offset()

int BKE_image_find_nearest_tile_with_offset ( const Image * image,
const float co[2],
float r_uv_offset[2] )

Return the tile_number for the closest UDIM tile to co.

Referenced by clip_uv_transform_resize(), clip_uv_transform_translation(), uv_nearest_image_tile_distance(), and uv_sculpt_stroke_init().

◆ BKE_image_free_all_gputextures()

void BKE_image_free_all_gputextures ( Main * bmain)

◆ BKE_image_free_all_textures()

void BKE_image_free_all_textures ( Main * bmain)

◆ BKE_image_free_anim_gputextures()

void BKE_image_free_anim_gputextures ( Main * bmain)

Same as BKE_image_free_all_gputextures but only free animated images.

Definition at line 570 of file image_gpu.cc.

References BKE_image_free_gputextures(), BKE_image_is_animated(), Main::images, and LISTBASE_FOREACH.

Referenced by ED_view3d_draw_offscreen().

◆ BKE_image_free_anim_ibufs()

void BKE_image_free_anim_ibufs ( Image * ima,
int except_frame )

Operates on one image only!

Parameters
except_frameThis is weak, only works for sequences without offset.

Definition at line 1674 of file source/blender/blenkernel/intern/image.cc.

References BLI_mutex_lock(), BLI_mutex_unlock(), Image::cache, Image_Runtime::cache_mutex, imagecache_check_free_anim(), IMB_moviecache_cleanup(), and Image::runtime.

Referenced by BKE_image_all_free_anim_ibufs().

◆ BKE_image_free_buffers()

void BKE_image_free_buffers ( Image * image)

◆ BKE_image_free_buffers_ex()

void BKE_image_free_buffers_ex ( Image * image,
bool do_lock )

Simply free the image data from memory, on display the image can load again (except for render buffers).

Definition at line 624 of file source/blender/blenkernel/intern/image.cc.

References BKE_image_free_gputextures(), BLI_mutex_lock(), BLI_mutex_unlock(), Image_Runtime::cache_mutex, image_free_anims(), image_free_cached_frames(), RE_FreeRenderResult(), Image::rr, and Image::runtime.

Referenced by BKE_image_free_buffers().

◆ BKE_image_free_data()

void BKE_image_free_data ( Image * image)

Free (or release) any data used by this image (does not free the image itself).

Note
Call from library.

Definition at line 650 of file source/blender/blenkernel/intern/image.cc.

References Image::id, and image_free_data().

◆ BKE_image_free_gputextures()

◆ BKE_image_free_old_gputextures()

void BKE_image_free_old_gputextures ( Main * bmain)

◆ BKE_image_free_packedfiles()

void BKE_image_free_packedfiles ( Image * image)

Definition at line 601 of file source/blender/blenkernel/intern/image.cc.

References image_free_packedfiles().

Referenced by image_save_as_exec().

◆ BKE_image_free_unused_gpu_textures()

void BKE_image_free_unused_gpu_textures ( void )

Delayed free of OpenGL buffers by main thread.

Definition at line 521 of file image_gpu.cc.

References BLI_thread_is_main(), and gpu_free_unused_buffers().

Referenced by wm_draw_update(), and WM_exit_ex().

◆ BKE_image_free_views()

◆ BKE_image_get_aspect()

void BKE_image_get_aspect ( Image * image,
float * r_aspx,
float * r_aspy )

◆ BKE_image_get_first_ibuf()

ImBuf * BKE_image_get_first_ibuf ( Image * image)

References the result, BKE_image_release_ibuf is to be called to de-reference. Use lock=NULL when calling BKE_image_release_ibuf().

TODO(sergey): This is actually "get first item from the cache", which is not so much predictable. But using first loaded image buffer was also malicious logic and all the areas which uses this function are to be re-considered.

Definition at line 5592 of file source/blender/blenkernel/intern/image.cc.

References BLI_mutex_lock(), BLI_mutex_unlock(), IMB_moviecacheIter_done(), IMB_moviecacheIter_free(), IMB_moviecacheIter_getImBuf(), IMB_moviecacheIter_new(), and IMB_refImBuf().

◆ BKE_image_get_float_pixels_for_frame()

◆ BKE_image_get_gpu_material_texture()

◆ BKE_image_get_gpu_texture()

GPUTexture * BKE_image_get_gpu_texture ( Image * image,
ImageUser * iuser )

Get the #GPUTexture for a given Image.

The requested GPU texture will be cached for subsequent calls, but only a single layer, pass, and view can be cached at a time, so the cache should be invalidated in operators and RNA callbacks that change the layer, pass, or view of the image to maintain a correct cache state. However, in some cases, multiple layers, passes, or views might be needed at the same time, like is the case for the realtime compositor. This is currently not supported, so the caller should ensure that the requested layer is indeed the cached one and invalidated the cached otherwise by calling BKE_image_ensure_gpu_texture. This is a workaround until image can support a more complete caching system.

Definition at line 476 of file image_gpu.cc.

References image_get_gpu_texture(), and ImageGPUTextures::texture.

Referenced by blender::draw::overlay::Paints::begin_sync(), blender::draw::overlay::MeshUVs::end_sync(), gpencil_image_texture_get(), blender::eevee::LookdevWorld::LookdevWorld(), OVERLAY_edit_uv_cache_init(), OVERLAY_image_empty_cache_populate(), OVERLAY_paint_cache_init(), and pygpu_texture_from_image().

◆ BKE_image_get_gpu_viewer_texture()

GPUTexture * BKE_image_get_gpu_viewer_texture ( Image * image,
ImageUser * iuser )

◆ BKE_image_get_ibuf_with_name()

ImBuf * BKE_image_get_ibuf_with_name ( Image * image,
const char * filepath )

◆ BKE_image_get_pixels_for_frame()

◆ BKE_image_get_renderslot()

◆ BKE_image_get_size()

◆ BKE_image_get_size_fl()

◆ BKE_image_get_tile()

ImageTile * BKE_image_get_tile ( Image * ima,
int tile_number )

◆ BKE_image_get_tile_from_iuser()

ImageTile * BKE_image_get_tile_from_iuser ( Image * ima,
const ImageUser * iuser )

◆ BKE_image_get_tile_from_pos()

◆ BKE_image_get_tile_info()

bool BKE_image_get_tile_info ( char * filepath,
ListBase * tiles,
int * r_tile_start,
int * r_tile_range )

Checks whether the given filepath refers to a UDIM tiled texture. If yes, the range from the lowest to the highest tile is returned.

Parameters
filepathmay be modified to ensure a UDIM token is present.
tilesmay be filled even if the result ultimately is false!

Definition at line 3419 of file source/blender/blenkernel/intern/image.cc.

References BKE_image_ensure_tile_token_filename_only(), BKE_image_get_tile_number_from_filepath(), BKE_image_get_tile_strformat(), BKE_image_is_filename_tokenized(), BLI_addtail(), BLI_filelist_dir_contents(), BLI_filelist_free(), BLI_genericNodeN(), BLI_path_join, BLI_path_split_dir_file(), dirname(), FILE_MAX, FILE_MAXDIR, FILE_MAXFILE, IMA_UDIM_MAX, max_ii(), MEM_SAFE_FREE, min_ii(), POINTER_FROM_INT, and tiles.

Referenced by BKE_image_signal(), get_udim_tiles(), and image_detect_frame_range().

◆ BKE_image_get_tile_label()

int BKE_image_get_tile_label ( const Image * ima,
const ImageTile * tile,
char * label,
int label_maxncpy )

Get tile index for tiled images.

Returns
The string length.

Definition at line 3403 of file source/blender/blenkernel/intern/image.cc.

References BLI_snprintf_rlen(), BLI_strncpy_rlen(), label, and tile.

◆ BKE_image_get_tile_number_from_filepath()

bool BKE_image_get_tile_number_from_filepath ( const char * filepath,
const char * pattern,
eUDIM_TILE_FORMAT tile_format,
int * r_tile_number )

◆ BKE_image_get_tile_strformat()

◆ BKE_image_get_tile_uv()

void BKE_image_get_tile_uv ( const Image * ima,
const int tile_number,
float r_uv[2] )

◆ BKE_image_has_alpha()

bool BKE_image_has_alpha ( Image * image)

Check if texture has alpha planes == 32 || planes == 16.

Definition at line 5322 of file source/blender/blenkernel/intern/image.cc.

References BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), ELEM, lock, and ImBuf::planes.

Referenced by uiTemplateImage().

◆ BKE_image_has_anim()

◆ BKE_image_has_filepath()

◆ BKE_image_has_gpu_texture_premultiplied_alpha()

bool BKE_image_has_gpu_texture_premultiplied_alpha ( Image * image,
ImBuf * ibuf )

◆ BKE_image_has_ibuf()

◆ BKE_image_has_loaded_ibuf()

◆ BKE_image_has_multiple_ibufs()

bool BKE_image_has_multiple_ibufs ( Image * image)

Checks whether the image consists of multiple buffers.

Definition at line 5473 of file source/blender/blenkernel/intern/image.cc.

References ELEM, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE, and IMA_SRC_TILED.

Referenced by image_get_multiview_index().

◆ BKE_image_has_opengl_texture()

bool BKE_image_has_opengl_texture ( Image * ima)

Check if texture has GPU texture code.

Definition at line 815 of file source/blender/blenkernel/intern/image.cc.

References Image::gputexture, and TEXTARGET_COUNT.

Referenced by BKE_image_free_old_gputextures(), and BKE_image_paint_set_mipmap().

◆ BKE_image_has_packedfile()

◆ BKE_image_init_imageuser()

◆ BKE_image_is_animated()

◆ BKE_image_is_dirty()

◆ BKE_image_is_dirty_writable()

◆ BKE_image_is_filename_tokenized()

bool BKE_image_is_filename_tokenized ( char * filepath)

Checks if the filename portion of the path contains a UDIM token.

Definition at line 3610 of file source/blender/blenkernel/intern/image.cc.

References BLI_path_basename().

Referenced by BKE_image_ensure_tile_token_filename_only(), BKE_image_get_tile_info(), and BKE_image_signal().

◆ BKE_image_is_multilayer()

bool BKE_image_is_multilayer ( const Image * ima)

For multi-layer images as well as for render-viewer and because rendered results use fake layer/passes, don't correct for wrong indices here.

Definition at line 3809 of file source/blender/blenkernel/intern/image.cc.

References ELEM, IMA_SRC_FILE, IMA_SRC_SEQUENCE, IMA_SRC_TILED, IMA_SRC_VIEWER, IMA_TYPE_MULTILAYER, IMA_TYPE_R_RESULT, Image::source, and Image::type.

Referenced by BKE_image_acquire_multilayer_view_ibuf(), blender::realtime_compositor::compute_image_user_for_pass(), and image_get_multiview_index().

◆ BKE_image_is_multiview()

◆ BKE_image_is_openexr()

bool BKE_image_is_openexr ( Image * ima)

For multi-layer images as well as for single-layer.

Definition at line 3918 of file source/blender/blenkernel/intern/image.cc.

References BLI_path_extension_check(), ELEM, Image::filepath, IMA_SRC_FILE, IMA_SRC_SEQUENCE, IMA_SRC_TILED, Image::source, and UNUSED_VARS.

◆ BKE_image_is_stereo()

◆ BKE_image_load()

Image * BKE_image_load ( Main * bmain,
const char * filepath )

Returns a new image or NULL if it can't load.

Note
: The _in_lib version allows to add a new image in a given library. It also affects the root path used for relative filepaths. See also BKE_id_new and BKE_id_new_in_lib documentation for more details.

Definition at line 1053 of file source/blender/blenkernel/intern/image.cc.

References BKE_image_load_in_lib().

Referenced by blender::bke::tests::ImageTest::load_image(), and blender::io::usd::process_usdz_textures().

◆ BKE_image_load_exists()

Image * BKE_image_load_exists ( Main * bmain,
const char * filepath,
bool * r_exists = nullptr )

Returns existing Image when filename/type is same.

Checks if image was already loaded, then returns same image otherwise creates new (does not load ibuf itself).

Note
: The _in_lib version allows to find an existing (or add a new) image in a given library. It also affects the root path used for relative filepaths. See also BKE_id_new and BKE_id_new_in_lib documentation for more details.

Definition at line 1095 of file source/blender/blenkernel/intern/image.cc.

References BKE_image_load_exists_in_lib().

Referenced by blender::io::usd::load_image(), blender::io::obj::load_image_at_path(), blender::io::usd::USDMaterialReader::load_tex_image(), WM_operator_drop_load_path(), and DocumentImporter::writeImage().

◆ BKE_image_load_exists_in_lib()

Image * BKE_image_load_exists_in_lib ( Main * bmain,
std::optional< Library * > owner_library,
const char * filepath,
bool * r_exists = nullptr )

◆ BKE_image_load_in_lib()

◆ BKE_image_mark_dirty()

◆ BKE_image_memorypack()

◆ BKE_image_merge()

◆ BKE_image_multilayer_index()

◆ BKE_image_multilayer_stamp_info_callback()

void BKE_image_multilayer_stamp_info_callback ( void * data,
const Image & image,
StampCallback callback,
bool noskip )

◆ BKE_image_multiview_index()

◆ BKE_image_packfiles()

◆ BKE_image_packfiles_from_mem()

◆ BKE_image_paint_set_mipmap()

void BKE_image_paint_set_mipmap ( Main * bmain,
bool mipmap )

Called on entering and exiting texture paint mode, temporary disabling/enabling mipmapping on all images for quick texture updates with glTexSubImage2D. images that didn't change don't have to be re-uploaded to OpenGL.

Definition at line 906 of file image_gpu.cc.

References BKE_image_free_gputextures(), BKE_image_has_opengl_texture(), ELEM, GPU_texture_mipmap_mode(), IMA_GPU_MIPMAP_COMPLETE, Main::images, LISTBASE_FOREACH, tex, TEXTARGET_2D, TEXTARGET_2D_ARRAY, and TEXTARGET_COUNT.

Referenced by ED_object_texture_paint_mode_enter_ex(), and ED_object_texture_paint_mode_exit_ex().

◆ BKE_image_partial_update_create()

PartialUpdateUser * BKE_image_partial_update_create ( const Image * image)

Create a new PartialUpdateUser. An Object that contains data to use partial updates.

Definition at line 543 of file image_partial_update.cc.

References image(), UNUSED_VARS, and blender::bke::image::partial_update::wrap().

Referenced by image_get_gpu_texture(), and blender::bke::image::partial_update::ImagePartialUpdateTest::SetUp().

◆ BKE_image_partial_update_free()

void BKE_image_partial_update_free ( PartialUpdateUser * user)

◆ BKE_image_partial_update_mark_full_update()

◆ BKE_image_partial_update_mark_region()

◆ BKE_image_partial_update_register_free()

void BKE_image_partial_update_register_free ( Image * image)

◆ BKE_image_pool_acquire_ibuf()

◆ BKE_image_pool_free()

◆ BKE_image_pool_new()

◆ BKE_image_pool_release_ibuf()

◆ BKE_image_preview()

ImBuf * BKE_image_preview ( Image * ima,
short max_size,
short * r_width,
short * r_height )

Return image buffer of preview for given image r_width & r_height are optional and return the original size of the image.

Definition at line 4947 of file source/blender/blenkernel/intern/image.cc.

References BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), Box, float, IMB_dupImBuf(), IMB_rect_from_float(), IMB_scale(), lock, ImBuf::x, and ImBuf::y.

Referenced by ui_tooltip_from_image().

◆ BKE_image_print_memlist()

void BKE_image_print_memlist ( Main * bmain)

Prints memory statistics for images.

Definition at line 1588 of file source/blender/blenkernel/intern/image.cc.

References ListBase::first, Image::id, image_mem_size(), Main::images, ID::name, ID::next, printf, and size().

◆ BKE_image_reassign_tile()

◆ BKE_image_release_ibuf()

void BKE_image_release_ibuf ( Image * ima,
ImBuf * ibuf,
void * lock )

Definition at line 4903 of file source/blender/blenkernel/intern/image.cc.

References BLI_mutex_lock(), BLI_mutex_unlock(), BLI_thread_unlock(), Image_Runtime::cache_mutex, IMB_freeImBuf(), lock, LOCK_VIEWER, RE_ReleaseResultImage(), and Image::runtime.

Referenced by blender::bke::pbvh::pixels::apply_watertight_check(), blender::ed::space_node::backimage_fit_exec(), bake_images(), blender::ed::object::bake_object_check(), blender::ed::object::bake_targets_init_internal(), BKE_image_fill_tile(), BKE_image_get_float_pixels_for_frame(), BKE_image_get_pixels_for_frame(), BKE_image_get_size(), BKE_image_has_alpha(), BKE_image_pool_release_ibuf(), BKE_image_preview(), BKE_image_save_options_init(), BKE_image_scale(), BKE_image_update_gputexture(), BKE_paint_canvas_key_get(), blender::realtime_compositor::CachedImage::CachedImage(), blender::ed::object::clear_single_image(), cmp_node_image_create_outputs(), colorfn(), blender::nodes::node_composite_cryptomatte_cc::CryptoMatteOperation::compute_image_domain(), blender::compositor::ImageNode::convert_to_operations(), blender::bke::pbvh::pixels::copy_pixels(), blender::bke::pbvh::pixels::copy_update(), cryptomatte_init_from_node_image(), blender::compositor::BaseImageOperation::deinit_execution(), blender::compositor::BaseImageOperation::determine_canvas(), blender::bke::pbvh::pixels::do_encode_pixels(), blender::ed::sculpt_paint::paint::image::do_paint_pixels(), blender::ed::sculpt_paint::paint::image::do_push_undo_tile(), blender::ed::space_node::draw_nodespace_back_pix(), draw_plane_marker_image(), ED_space_image_acquire_buffer(), ED_space_image_release_buffer(), ED_space_node_color_sample(), ED_space_node_get_position(), blender::io::usd::export_in_memory_texture(), eyedropper_cryptomatte_sample_image_fl(), finish_images(), blender::bke::image::partial_update::ImageTileData::free_data(), blender::compositor::BaseImageOperation::get_im_buf(), blender::compositor::MultilayerBaseOperation::get_im_buf(), blender::io::usd::get_in_memory_texture_filename(), blender::nodes::node_composite_cryptomatte_cc::CryptoMatteOperation::get_layers_from_image(), gpu_texture_create_tile_array(), icon_preview_startjob(), image_clipboard_copy_exec(), image_file_format_writable(), image_flip_exec(), image_from_context_has_data_poll(), image_get_gpu_texture(), image_invert_exec(), image_rect_update(), blender::ed::greasepencil::image_render::image_render_end(), image_rotate_orthogonal_exec(), image_save_single(), image_scale_exec(), image_scale_invoke(), image_undosys_step_encode(), blender::nodes::node_geo_image_texture_cc::ImageFieldsFunction::ImageFieldsFunction(), blender::bke::pbvh::pixels::mark_image_dirty(), metadata_panel_context_draw(), blender::ed::object::multiresbake_check(), blender::nodes::node_geo_image_info_cc::node_geo_exec(), paint_2d_bucket_fill(), paint_2d_canvas_free(), paint_2d_canvas_set(), paint_2d_ensure_tile_canvas(), paint_2d_gradient_fill(), paint_2d_new_stroke(), paint_2d_redraw(), paint_sample_color(), palette_extract_img_exec(), project_paint_end(), project_paint_PickColor(), project_paint_uvpixel_init(), project_paint_uvpixel_mask(), ptile_restore_runtime_map(), RE_bake_ibuf_clear(), blender::ed::greasepencil::ImageBufferAccessor::release(), blender::draw::image_engine::SpaceNodeAccessor::release_buffer(), render_endjob(), blender::ed::space_node::sample_apply(), screen_opengl_render_apply(), blender::ed::space_node::snode_bg_viewmove_invoke(), blender::bke::image::partial_update::ImagePartialUpdateTest::TearDown(), tile_fill_init(), uhandle_restore_list(), uiTemplateImage(), uiTemplateImageInfo(), blender::bke::pbvh::pixels::update_pixels(), blender::ed::space_node::viewer_border_exec(), blender::render::Context::viewer_output_to_viewer_image(), blender::ed::space_node::WIDGETGROUP_node_corner_pin_refresh(), blender::ed::space_node::WIDGETGROUP_node_crop_refresh(), blender::ed::space_node::WIDGETGROUP_node_sbeam_refresh(), blender::ed::space_node::WIDGETGROUP_node_transform_refresh(), blender::ed::object::write_internal_bake_pixels(), and blender::nodes::node_geo_image_texture_cc::ImageFieldsFunction::~ImageFieldsFunction().

◆ BKE_image_release_renderresult()

◆ BKE_image_remove_renderslot()

◆ BKE_image_remove_tile()

bool BKE_image_remove_tile ( Image * ima,
ImageTile * tile )

◆ BKE_image_replace_imbuf()

void BKE_image_replace_imbuf ( Image * image,
ImBuf * ibuf )

For a non-viewer single-buffer image (single frame file, or generated image) replace its image buffer with the given one. If an unsupported image type (multi-layer, image sequence, ...) the function will assert in the debug mode and will have an undefined behavior in the release mode.

Definition at line 1367 of file source/blender/blenkernel/intern/image.cc.

References BKE_image_free_buffers, BKE_image_mark_dirty(), BLI_assert, ImBufFloatBuffer::data, ELEM, ImBuf::float_buffer, IMA_GEN_FLOAT, IMA_NO_INDEX, IMA_SRC_FILE, IMA_SRC_GENERATED, IMA_TYPE_IMAGE, image_assign_ibuf(), image_colorspace_from_imbuf(), ImBuf::x, and ImBuf::y.

Referenced by BKE_image_add_from_imbuf(), and update_image_from_plane_marker_exec().

◆ BKE_image_scale()

bool BKE_image_scale ( Image * image,
int width,
int height,
ImageUser * iuser )

◆ BKE_image_sequence_guess_offset()

int BKE_image_sequence_guess_offset ( Image * image)

Guess offset for the first frame in the sequence.

Definition at line 5446 of file source/blender/blenkernel/intern/image.cc.

References BLI_path_sequence_decode().

Referenced by cmp_node_image_create_outputs().

◆ BKE_image_set_filepath_from_tile_number()

void BKE_image_set_filepath_from_tile_number ( char * filepath,
const char * pattern,
eUDIM_TILE_FORMAT tile_format,
int tile_number )

◆ BKE_image_signal()

void BKE_image_signal ( Main * bmain,
Image * ima,
ImageUser * iuser,
int signal )

Definition at line 3161 of file source/blender/blenkernel/intern/image.cc.

References BKE_image_add_tile(), BKE_image_ensure_tile_token(), BKE_image_free_buffers, BKE_image_get_tile, BKE_image_get_tile_info(), BKE_image_get_tile_strformat(), BKE_image_has_packedfile(), BKE_image_init_imageuser(), BKE_image_is_filename_tokenized(), BKE_image_packfiles(), BKE_image_partial_update_mark_full_update(), BKE_image_remove_tile(), BKE_image_set_filepath_from_tile_number(), BKE_image_walk_all_users(), BKE_ntree_update_main(), BKE_ntree_update_tag_id_changed(), BKE_packedfile_free(), BKE_packedfile_new(), BLI_freelistN(), BLI_listbase_count(), BLI_listbase_count_is_equal_to(), BLI_mutex_lock(), BLI_mutex_unlock(), BLI_path_abs(), BLI_path_is_rel(), BLI_path_rel(), Image_Runtime::cache_mutex, ELEM, FILE_MAX, Image::filepath, ImageTile::gen_flag, ImageTile::gen_x, ImageTile::gen_y, Image::id, ID_BLEND_PATH, ID_BLEND_PATH_FROM_GLOBAL, IMA_NO_INDEX, IMA_SIGNAL_COLORMANAGE, IMA_SIGNAL_FREE, IMA_SIGNAL_RELOAD, IMA_SIGNAL_SRC_CHANGE, IMA_SIGNAL_USER_NEW_IMAGE, IMA_SRC_FILE, IMA_SRC_GENERATED, IMA_SRC_SEQUENCE, IMA_SRC_TILED, IMA_TYPE_IMAGE, IMA_TYPE_MULTILAYER, IMA_TYPE_UV_TEST, image_free_packedfiles(), image_get_cached_ibuf_for_index_entry(), image_num_viewfiles(), image_remove_all_tiles(), image_tag_frame_recalc(), image_tag_reload(), image_update_views_format(), IMB_freeImBuf(), LISTBASE_FOREACH, MEM_freeN(), Image::packedfiles, pf, POINTER_AS_INT, printf, Image::runtime, ImageUser::scene, Image::source, STRNCPY, ImageTile::tile_number, Image::tiles, Image::type, ImBuf::x, and ImBuf::y.

Referenced by BKE_image_save(), BKE_packedfile_unpack_image(), blender::compositor::CompositorOperation::deinit_execution(), ED_space_image_auto_set(), ED_space_image_set(), image_clipboard_paste_exec(), image_foreach_path(), image_new_exec(), image_open_exec(), image_reload_exec(), image_replace_exec(), blender::ed::space_node::node_add_file_exec(), blender::render::Context::output_to_render_result(), proj_paint_add_slot(), screen_opengl_render_init(), screen_render_exec(), and screen_render_invoke().

◆ BKE_image_sort_tiles()

void BKE_image_sort_tiles ( Image * ima)

◆ BKE_image_stamp_buf()

◆ BKE_image_tag_time()

void BKE_image_tag_time ( Image * ima)

◆ BKE_image_tile_filepath_exists()

bool BKE_image_tile_filepath_exists ( const char * filepath)

When provided with an absolute virtual filepath, check to see if at least one concrete file exists. NOTE: This function requires directory traversal and may be inefficient in time-critical, or iterative, code paths.

Definition at line 3651 of file source/blender/blenkernel/intern/image.cc.

References BKE_image_get_tile_number_from_filepath(), BKE_image_get_tile_strformat(), BLI_assert, BLI_filelist_dir_contents(), BLI_filelist_free(), BLI_path_is_rel(), BLI_path_split_dir_part(), dirname(), FILE_MAXDIR, IMA_UDIM_MAX, and MEM_SAFE_FREE.

Referenced by BKE_image_load_in_lib().

◆ BKE_image_update_gputexture()

void BKE_image_update_gputexture ( Image * ima,
ImageUser * iuser,
int x,
int y,
int w,
int h )

Partial update of texture for texture painting. This is often much quicker than fully updating the texture for high resolution images.

Definition at line 882 of file image_gpu.cc.

References BKE_image_acquire_ibuf(), BKE_image_get_tile_from_iuser, BKE_image_release_ibuf(), BKE_image_update_gputexture_delayed(), and w().

Referenced by imapaint_image_update().

◆ BKE_image_update_gputexture_delayed()

void BKE_image_update_gputexture_delayed ( Image * ima,
ImageTile * image_tile,
ImBuf * ibuf,
int x,
int y,
int w,
int h )

Mark areas on the #GPUTexture that needs to be updated. The areas are marked in chunks. The next time the #GPUTexture is used these tiles will be refreshes. This saves time when writing to the same place multiple times This happens for during foreground rendering.

Definition at line 890 of file image_gpu.cc.

References BKE_image_partial_update_mark_full_update(), BKE_image_partial_update_mark_region(), BLI_rcti_init(), IMA_SRC_TILED, Image::source, w(), ImBuf::x, and ImBuf::y.

Referenced by BKE_image_update_gputexture(), and image_rect_update().

◆ BKE_image_user_file_path()

void BKE_image_user_file_path ( const ImageUser * iuser,
const Image * ima,
char * filepath )

◆ BKE_image_user_file_path_ex()

◆ BKE_image_user_frame_calc()

◆ BKE_image_user_frame_get()

int BKE_image_user_frame_get ( const ImageUser * iuser,
int cfra,
bool * r_is_in_range )

◆ BKE_image_user_id_eval_animation()

void BKE_image_user_id_eval_animation ( Depsgraph * depsgraph,
ID * id )

◆ BKE_image_user_id_has_animation()

◆ BKE_image_walk_all_users()

void BKE_image_walk_all_users ( const Main * mainp,
void * customdata,
void callbackImage *ima, ID *iuser_id, ImageUser *iuser, void *customdata )

◆ BKE_imageuser_default()

◆ BKE_imbuf_alpha_test()

◆ BKE_imbuf_stamp_info()

◆ BKE_imbuf_write()

bool BKE_imbuf_write ( ImBuf * ibuf,
const char * filepath,
const ImageFormatData * imf )

◆ BKE_imbuf_write_as()

bool BKE_imbuf_write_as ( ImBuf * ibuf,
const char * filepath,
const ImageFormatData * imf,
bool save_copy )

Same as BKE_imbuf_write() but crappy workaround not to permanently modify some, values in the imbuf.

Definition at line 2671 of file source/blender/blenkernel/intern/image.cc.

References BKE_imbuf_write(), ImBuf::foptions, ImBuf::ftype, ImageFormatData::planes, and ImBuf::planes.

Referenced by blender::io::usd::export_in_memory_texture(), and image_save_single().

◆ BKE_imbuf_write_stamp()

bool BKE_imbuf_write_stamp ( const Scene * scene,
const RenderResult * rr,
ImBuf * ibuf,
const char * filepath,
const ImageFormatData * imf )

◆ BKE_render_result_stamp_data()

◆ BKE_render_result_stamp_info()

◆ BKE_stamp_data_copy()

StampData * BKE_stamp_data_copy ( const StampData * stamp_data)

◆ BKE_stamp_data_free()

void BKE_stamp_data_free ( StampData * stamp_data)

◆ BKE_stamp_info_callback()

◆ BKE_stamp_info_from_imbuf()

◆ BKE_stamp_info_from_scene_static()

StampData * BKE_stamp_info_from_scene_static ( const Scene * scene)

Fills in the static stamp data (i.e. everything except things that can change per frame). The caller is responsible for freeing the allocated memory.

Definition at line 2439 of file source/blender/blenkernel/intern/image.cc.

References R_STAMP_ALL, and stampdata().

◆ BKE_stamp_is_known_field()

bool BKE_stamp_is_known_field ( const char * field_name)

Check whether the given metadata field name translates to a known field of a stamp.

Definition at line 2473 of file source/blender/blenkernel/intern/image.cc.

References stamp_metadata_fields, and STREQ.

Referenced by metadata_copy_custom_fields(), and metadata_is_custom_drawable().

◆ openanim()

◆ openanim_noload()

ImBufAnim * openanim_noload ( const char * filepath,
int flags,
int streamindex,
char colorspace[IMA_MAX_SPACE] )

Definition at line 2707 of file source/blender/blenkernel/intern/image.cc.

References IMB_open_anim().

Referenced by open_anim_filepath().